I'm trying to set up an FCKditor on an administration area, and I am having problems getting the file uploads to save to the right folder, and for that folder to display in the browser window.
I'm using the PHP version, and I've made the editor with:
The values for FS_ROOT, and $folder are instantiated earlier, and I use them earlier around the page so I know that they are fine.
When I try to upload a file, instead of going to the folder that I've specified, the file always gets added to the 'standard' folder of <root>/userfiles/image/ and that pretty much breaks everything that I need.
The biggest problem that I can see is that the $folder value needs to be dynamic all the time, so I can't hard-code this in, and I can't set this in the actual PHP config file as it changes all the time, and the config file doesn't know where to get the value of that variable from.
Is there something that I'm doing wrong, or that I need to do differently to have this be able to read in my config options, or is this something that's beyond what FCKeditor can do? :S Any help is greatly appreciated.
I'm using the PHP version, and I've made the editor with:
$bodyEditor = new FCKEditor ("body"); $bodyEditor->BasePath = WEB_ROOT."/common/fckeditor/"; $bodyEditor->Value = $body; $bodyEditor->Config ["UserFilesPath"] = "/members/".$folder."/images/"; $bodyEditor->Config ["UserFilesAbsolutePath"] = FS_ROOT."/members/".$folder."/images/";
The values for FS_ROOT, and $folder are instantiated earlier, and I use them earlier around the page so I know that they are fine.
When I try to upload a file, instead of going to the folder that I've specified, the file always gets added to the 'standard' folder of <root>/userfiles/image/ and that pretty much breaks everything that I need.
The biggest problem that I can see is that the $folder value needs to be dynamic all the time, so I can't hard-code this in, and I can't set this in the actual PHP config file as it changes all the time, and the config file doesn't know where to get the value of that variable from.
Is there something that I'm doing wrong, or that I need to do differently to have this be able to read in my config options, or is this something that's beyond what FCKeditor can do? :S Any help is greatly appreciated.
Re: File browser doesn't recognise config.
I've made it work by using session variables to store the values that I need. so, the code now looks like:
Then I had to edit the config.php file to:
As I said... this is far from an optimal way to achieve this, especially when there's supposed to be ways of setting the config without having to hack things around like that.
I just hope that the client doesn't ever want to upgrade FCKeditor... as I just know it'll break a lot of stuff like this.