This note was taken on Drupal-5.7, fckeditor-5.x-2.1 (module), fckeditor-2.5.1, and ckfinder-1.1.
- Locate the file named settings.php inside your drupal directory (usually sites/default/settings.php) and set $cookie_domain variable to the appropiate domain (remember to uncomment that line). If you do not do this, FCKeditor will claim that file browser is disabled.
- Download ckfinder and put it inside the directory of fckeditor module, after which you will see something like below:
% ls
CHANGELOG.txt fckeditor.info filemanager.config.php
ckfinder fckeditor.install img_assist_fckeditor.js
ckfinder_php_1.1.tar.gz fckeditor.module LICENSE.txt
fckeditor plugins FCKeditor_2.5.1.tar.gz
fckeditor.popup.html po fckeditor.config.js
fckeditor.popup.js fckeditor.css fckeditor.utils.js
README.txt - Edit the fckconfig.js file in the FCKeditor directory and modify the following settings:
FCKConfig.LinkBrowserURL = '/ckfinder/ckfinder.html' ;
FCKConfig.ImageBrowserURL = '/ckfinder/ckfinder.html?type=Images' ;
FCKConfig.FlashBrowserURL = '/ckfinder/ckfinder.html?type=Flash' ;
FCKConfig.LinkUploadURL = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files' ;
FCKConfig.ImageUploadURL = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images' ;
FCKConfig.FlashUploadURL = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash' ; - Edit
fckconfig.modulefckeditor.module, and replace the lines
if ($advanced_uploads) {
$element['#suffix'] .= $js_id .".Config['LinkBrowserURL'] = \"". $module_full_path ."/fckeditor/editor/filemanager/browser/default/browser.html?Connector=". $connector_path ."&ServerPath=". $files_path ."\";
". $js_id .".Config['ImageBrowserURL'] = \"". $module_full_path ."/fckeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=". $connector_path ."&ServerPath=". $files_path ."\";
". $js_id .".Config['FlashBrowserURL'] = \"". $module_full_path ."/fckeditor/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=". $connector_path ."&ServerPath=". $files_path ."\";\n";
}with the following:
if ($advanced_uploads) {
$element['#suffix'] .= $js_id.".Config['LinkBrowserURL'] = '".$module_full_path."/ckfinder/ckfinder.html';
".$js_id.".Config['ImageBrowserURL'] = '".$module_full_path."/ckfinder/ckfinder.html?type=Images';
".$js_id.".Config['FlashBrowserURL'] = '".$module_full_path."/ckfinder/ckfinder.html?type=Flash';\n";
} - Open file ckfinder/config.php, and replace the empty function CheckAuthentication() with the following code:
function CheckAuthentication()
{
static $authenticated;
if (!isset($authenticated)) {
$drupal_path = "../../../";
if(!file_exists($drupal_path . "/includes/bootstrap.inc")) {
$drupal_path = "../..";
do {
$drupal_path .= "/..";
$depth = substr_count($drupal_path, "..");
}
while(!($bootstrapFileFound = file_exists($drupal_path . "/includes/bootstrap.inc")) && $depth<10);
}
if (!isset($bootstrapFileFound) || $bootstrapFileFound) {
$cwd = getcwd();
chdir($drupal_path);
require_once "./includes/bootstrap.inc";
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
$authenticated = user_access("allow fckeditor file uploads");
chdir($cwd);
}
}
return $authenticated;
}
$Config['Enabled'] = CheckAuthentication();
$baseUrl = '/' . file_directory_path() . '/';Please note that you must call this function right after declaration, otherwise the "session_start()" function call inside bootstrap.inc will cause error.
Comments
thanks for this information
Tue, 04/01/2008 - 16:00 — Anonymousthankss..
it really works fine!
Cannot find fckconfig.module
Tue, 04/08/2008 - 01:48 — AnonymousHi Daisy,
Thanks for the ckfinder stuff. I have searched the directory structure of my Drupal fckeditor install and cannot find fckconfig.module.
Can you give me a clue as to where it should be?
Regards
Martin Fuggle
It should be "fckeditor.module"
Tue, 04/08/2008 - 15:06 — voyageurSorry for my bad typo. I have fixed it above.
Thanks
Mon, 04/14/2008 - 22:51 — AnonymousMany thanks for your reply...
Regards -- Martin Fuggle
Still having trouble
Mon, 04/14/2008 - 23:49 — AnonymousHi Daisy,
I am sorry to be a bother but I am still having trouble. I have checked all the releases to make sure that they are the same as you have used and they are except that I am using Drupal-5.5. That should not have an impact on my issue.
I cannot located the following text string in the file fckeditor_module. Is there some way that I have the wrong version of the Drupal fckeditor module?
As I say I am sorry to trouble you but I would like to use ckfinder if poss...
Cheers
Martin
if ($advanced_uploads) {
$element['#suffix'] .= $js_id .".Config['LinkBrowserURL'] = \"". $module_full_path ."/fckeditor/editor/filemanager/browser/default/browser.html?Connector=". $connector_path ."&ServerPath=". $files_path ."\";
". $js_id .".Config['ImageBrowserURL'] = \"". $module_full_path ."/fckeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=". $connector_path ."&ServerPath=". $files_path ."\";
". $js_id .".Config['FlashBrowserURL'] = \"". $module_full_path ."/fckeditor/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=". $connector_path ."&ServerPath=". $files_path ."\";\n";
}
Found the text!
Tue, 04/15/2008 - 02:32 — AnonymousHi Daisy,
I found the stuff in fckeditor.module. Initially I used a text searh function in the editor I use and for some reason (no doubt user error) it didn't find it.
Cheers
Martin
Glad to know it worked
Thu, 04/17/2008 - 17:31 — voyageurAnd thank you for telling me, Martin.
Set $baseUrl
Tue, 05/20/2008 - 15:26 — AnonymousI had to do one more step: $baseUrl = '/' . file_directory_path() . '/'; in the file ckfinder/config.php
You are right.
Thu, 05/22/2008 - 03:01 — voyageurI checked my diff in ckfinder/config.php. Sure enough, I also had this line patched. Thank you for pointing it out.
Daisy
Response 200, T_Static error
Sat, 05/24/2008 - 04:11 — AnonymousParse error: syntax error, unexpected T_STATIC in /..**../modules/fckeditor/ckfinder/config.php on line 23 ...
Can you help on that?
Trying to integrate with 6.2 It is almost there. I am not sure where to go from here.
It's a php error. I guess,
Thu, 05/29/2008 - 03:13 — voyageurIt's a php error.
I guess, you may try to remove your line 23 and see if the error persists. If it does, then it would be somewhere above this line that has problem.
Good luck.
Daisy
Non default baseUrl, baseDir
Mon, 05/26/2008 - 22:53 — AnonymousFirst thaks a lot for great text... As I am not using the default location for baseUrl and baseDir (different per use using tokens) - here is my changed code:
function CheckAuthentication()
{
static $authenticated;
if (!isset($authenticated)) {
$drupal_path = "../../../";
if(!file_exists($drupal_path . "/includes/bootstrap.inc")) {
$drupal_path = "../..";
do {
$drupal_path .= "/..";
$depth = substr_count($drupal_path, "..");
}
while(!($bootstrapFileFound = file_exists($drupal_path . "/includes/bootstrap.inc")) && $depth<10);
}
if (!isset($bootstrapFileFound) || $bootstrapFileFound) {
$cwd = getcwd();
chdir($drupal_path);
require_once "./includes/bootstrap.inc";
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
$authenticated = user_access("allow fckeditor file uploads");
//cdmaslo A
if (isset($_SESSION['FCKeditor']['UserFilesPath'], $_SESSION['FCKeditor']['UserFilesAbsolutePath'])) {
$GLOBALS['fck_user_files_path'] = $_SESSION['FCKeditor']['UserFilesPath'];
$GLOBALS['fck_user_files_absolute_path'] = $_SESSION['FCKeditor']['UserFilesAbsolutePath'];
}
//cdmaslo Z
chdir($cwd);
}
}
return $authenticated;
}
$Config['Enabled'] = CheckAuthentication();
//cdmaslo A
if (!empty($fck_user_files_path)) {
$baseUrl = $fck_user_files_path;
$baseDir = $fck_user_files_absolute_path;
}
else {
// Nothing in session? Shouldn't happen... anyway let's try to upload it in the (almost) right place
// Path to user files relative to the document root.
$baseUrl = '/' . file_directory_path() . '/'; // cdmaslo original
$baseDir = resolveUrl($baseUrl);// cdmaslo original
}
// cdmaslo Z
See comments with cdmaslo for changes
Thank you for sharing. Daisy
Thu, 05/29/2008 - 03:15 — voyageurThank you for sharing.
Daisy
V 2.6.3 ?
Mon, 09/08/2008 - 15:27 — AnonymousThanks for these detailed instructions. One question: Has anyone successfully enabled this in v2.6.3? I can't seem to find any reference to 'advanceduploads' in the file. It looks like the if() has been re-written as a switch, and there are several new parameters in the file. Can't seem to get it to work.
Thanks for any help.
Not yet
Mon, 09/08/2008 - 19:10 — voyageurI am sorry but we haven't looked into V2.6.3 yet.
drupal 6.4+fckeditor module 6.x
Wed, 09/17/2008 - 10:25 — AnonymousHello all thanks for this great tutorial.
Now I'm using Drupal 6.4 + FCKed module for 6.x and the last FCKeditor.
The n.4 step is totally differnt in 6.x release and I don't know what to do/change.
Please If someone knows how,I would be very grateful!
thanks in advance
jM.
I found the solution for the new version!
Fri, 11/14/2008 - 16:03 — AnonymousWith a bit of trial and error, I managed to find what you have to change in this new version :)
In the steep #4, when you have to edit the fckeditor.module file, look for the following lines:
$js .= $js_id .".Config['LinkBrowserURL'] = '". $module_full_path ."/fckeditor/editor/filemanager/browser/default/browser.html?Connector=". $connector_path ."&ServerPath=". $files_path ."';\n";
$js .= $js_id .".Config['ImageBrowserURL'] = '". $module_full_path ."/fckeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=". $connector_path ."&ServerPath=". $files_path ."';\n";
$js .= $js_id .".Config['FlashBrowserURL'] = '". $module_full_path ."/fckeditor/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=". $connector_path ."&ServerPath=". $files_path ."';\n";
Then replace these previous lines for the following ones:
$js .= $js_id .".Config['LinkBrowserURL'] = '".$module_full_path."/ckfinder/ckfinder.html';\n";
$js .= $js_id .".Config['ImageBrowserURL'] = '".$module_full_path."/ckfinder/ckfinder.html?type=Images';\n";
$js .= $js_id .".Config['FlashBrowserURL'] = '".$module_full_path."/ckfinder/ckfinder.html?type=Flash';\n";
The other steeps are the same.
I hope I have helped!
Best regards,
Tiago Paolini
Thanks!
Fri, 11/14/2008 - 21:04 — voyageurThis is awesome. Thank you!
Post new comment