Thought I would add this since it took some time and others may want the same behavior. Basically I had 2 issues, 1 was that my zen cart is not in the root directory, 2 is that I wanted fckeditor to use my zencart/images folder for browsing and uploading, NOT the default ($UserFilesPath/Image folder).
1) My zen site is not located at my root directory, ie its located at /cart/, because of this the following files need to be changed:
<zenroot>/editors/fckeditor/editor/filemanager/browser/default/connectors/php/config.php:
// Path to user files relative to the document root.
$Config['UserFilesPath'] = '/cart/images/' ;
<zenroot>editors/fckeditor/editor/filemanager/upload/php/config.php
$Config['UserFilesPath'] = '/cart/images/' ;
2) The upload.php and io.php files need to be changed to add an exception when the file type is "image", all other types (file,flash,media) are fine if they go in the /cart/images/<type> folder.
io.php:
function GetUrlFromPath( $resourceType, $folderPath )
{
if ( $resourceType == '' || /*gpg mod*/strtolower($resourceType) == "image" )
upload.php ~ line 88:
if ( $Config['UseFileType'] /*gpg mod*/ && strtolower($sType) != "image")
{
$sServerDir .= $sType . '/' ;
}
-------------------------------------
function ServerMapFolder( $resourceType, $folderPath )
{
//gpg mod
if( strtolower( $resourceType ) == "image" )
{
$sResourceTypePath = $GLOBALS["UserFilesDirectory"] . '/';
}
else
{
// Get the resource type directory.
$sResourceTypePath = $GLOBALS["UserFilesDirectory"] . strtolower( $resourceType ) . '/' ;
}
------------------------------------------
***Note that I merged the latest fckeditor (2.4.1) into the version downloaded from zen cart (thought this might solve my problems initially), so upload.php contains a new UserFileType option.
** Also note that since UserFilePath is set to /cart/images. fckeditor will look for files of type "Image" in /cart/images and all other types in the folder /cart/images/<type> (ex: /cart/images/Flash). Weird side effect, but doesn't bother me. This could be re-worked.
What would be nice is to re-work this so that a directory can be specified for each file type.
Now someone will reply with some easy setting I missed :-), oh well.
-Justin
Bookmarks