I'm using FCKeditor in a PHP environment and i'm triyng to get the default path used by the image & file browser to be "dynamically generated" so that it would be different for each user who is logged in. So far my code looks like this, and everything else works; any help?
<?php
$oFCKeditor = new FCKeditor('new_main') ;
$oFCKeditor->BasePath = '/fckeditor/' ;
$oFCKeditor->Value = $current_page_main;
$oFCKeditor->Config['UserFilesPath'] = '/' . $file_location . '/';
$oFCKeditor->Create() ;
?>
The variable $file_location is being set earlier in the script; and is a 3-4 letter abreviation like EIC and RMAD.
<?php
$oFCKeditor = new FCKeditor('new_main') ;
$oFCKeditor->BasePath = '/fckeditor/' ;
$oFCKeditor->Value = $current_page_main;
$oFCKeditor->Config['UserFilesPath'] = '/' . $file_location . '/';
$oFCKeditor->Create() ;
?>
The variable $file_location is being set earlier in the script; and is a 3-4 letter abreviation like EIC and RMAD.
Re: Dynamic folder for file & image storage.....
Re: Dynamic folder for file & image storage.....
Re: Dynamic folder for file & image storage.....
Re: Dynamic folder for file & image storage.....
Basically, I'm setting this in my php script before calling the FCKeditor include,
$file_location = "/" . $org . "/";
Then my config.php file looks like this:
$Config['UserFilesPath'] = "'$file_location'";
Re: Dynamic folder for file & image storage.....
Re: Dynamic folder for file & image storage.....
Re: Dynamic folder for file & image storage.....
Re: Dynamic folder for file & image storage.....
Basically, the error I'm getting is that FCKeditor can't process a directory with the name ''''
I feel like this is problably a really dumb php error with not using the right quote or putting slashes infront of it.
Re: Dynamic folder for file & image storage.....
Re: Dynamic folder for file & image storage.....
Re: Dynamic folder for file & image storage.....
I've narrowed it down to a problem being that I cannot pass a variable from the page where I'm calling fckeditor to the config.php of the "connector" for the filemanager.
Does anyone know why this would be happening?
Re: Dynamic folder for file & image storage.....
A way to work around this problem is using sessions. If you are not yet familiar with sessions in php, you should really start to learn about them.
The procedure then is really simple:
put something like
session_start();
$_SESSION['mypath'] = '/path/of/user/dir';
in your page and then
session_start();
in your config.php of the connector.
With $_SESSION['mypath'] you have access to the path.
Alternatively you could try to include (php-include) your page in the config.php. But this is unlikely to end well...
Re: Dynamic folder for file & image storage.....
I think sessions should be my solution. Thanks