ckeditor to upload images

A few posts on how to do this, and a lot of frustrated people so here is how:

Download both ckeditor and ckfinder.

Decompress them into the root directory.

Include them in your php

include_once ‘ckeditor/ckeditor.php’;
include_once ‘ckfinder/ckfinder.php’;

hopefully no error messages? ok cool…. now simply

1
2
3
4
5
6
7
8
9
10
11
12
13
<?php
 
$ckeditor = new CKEditor();
$ckeditor->basePath = '/ckeditor/';
$ckeditor->config['filebrowserBrowseUrl'] = '/ckfinder/ckfinder.html';
$ckeditor->config['filebrowserImageBrowseUrl'] = '/ckfinder/ckfinder.html?type=Images';
$ckeditor->config['filebrowserFlashBrowseUrl'] = '/ckfinder/ckfinder.html?type=Flash';
$ckeditor->config['filebrowserUploadUrl'] = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files';
$ckeditor->config['filebrowserImageUploadUrl'] = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images';
$ckeditor->config['filebrowserFlashUploadUrl'] = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash';
$ckeditor->editor('CKEditor1');
 
?>

To add the field to the form.

Ensure that in ckfinder/userfiles is writable

You also need to alter in ckfinder/userfiles/config.php the function CheckAuthentication(), to return true, take note of the warning!!

ive put it all together in one zip file displaying the submission here

VN:F [1.9.9_1125]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.9_1125]
Rating: 0 (from 0 votes)

4,040 views

This entry was posted on Monday, September 19th, 2011 at 6:24 pm and is filed under Php, Programming. You can follow any responses to this entry through the RSS 2.0 feed.