Greetings,
I am hosting multiple sites on a single codebase (via DNS tricks) using FCK as the editor. I have created objects in PHP5 that hold DB connection info and root paths for the current site being edited, but for some reason they are not recognized by the time FCK gets to the config.php file in the file manager.
For example, in the config.php file I have something like this:
// Path to user files relative to the document root.
$Config['UserFilesPath'] = "http://www." . $site->get('url') . '/UserFiles/';
// Fill the following value it you prefer to specify the absolute path for the
// user files directory. Usefull if you are using a virtual directory, symbolic
// link or alias. Examples: 'C:\\MySite\\UserFiles\\' or '/root/mysite/UserFiles/'.
// Attention: The above 'UserFilesPath' must point to the same directory.
$Config['UserFilesAbsolutePath'] = $site->get('rootPath') . '/UserFiles/';
I can't get this to work for the life of me. If I hard code the values stored in these objects, it works fine. I am certain the objects have been instantiated, as I make a call from the $site object right before the FCK editor is invoked and it is fine.
I am guessing this is a problem with scope. That prompted me to declare the object variable as global just after the Config variable, i.e.:
global $Config ;
global $site;
This didn't help either. Any suggestions would be greatly appreciated as this is my final hold up for rolling out my new and improved CMS.
Thanks!
Tue, 12/05/2006 - 07:39
#1
RE: PHP Objects in connector config
If your own site config has not been included, then how would the connector know what values to use? After all, the filemanager is a separate instance of code which is called in isolation to your own CMS - there has to be some link...
Kae
RE: PHP Objects in connector config
Can you set $Config['UserFilesPath'] and $Config['UserFilesAbsolutePath'] on instantiation of the FCK editor object? This would seem the most straightforward way to "tell" FCK where to look for images and files rather than messing around inside of its code.
RE: PHP Objects in connector config
As I said, the filemanager is completely isolated from the main FCKeditor window. You need to add a connection in the filemanager to your config.
RE: PHP Objects in connector config
In any event I just got it patched up, so thanks for pointing me in the right direction!