Zen Cart Logo
Forums / All Other Contributions/Addons / fckeditor - browsing and uploading to /images

fckeditor - browsing and uploading to /images

Locked

Views: 4,686

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
29 Mar 2007, 5:13 PM
#1
jmatthewsr avatar

jmatthewsr

New Zenner

Join Date:
Dec 2006
Posts:
13
Plugin Contributions:
0

fckeditor - browsing and uploading to /images

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/' ;

  1. 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

30 May 2007, 12:40 AM
#2
mcoleman45 avatar

mcoleman45

New Zenner

Join Date:
May 2007
Posts:
7
Plugin Contributions:
0

Re: fckeditor - browsing and uploading to /images

This is exactly what I would like to do when I upload my pdf files for my products. You seem to understand the config files for zen cart and I was wondering if you could help me figure out what file to edit so that I could have it default to the directory the web developer has put my pdf files which is public_html/pdf. I'm not reall good at following the logic in the configuration files, but if you let me know which file and what needs to be changed, I think I can talk the web developer into changing it for me.

Thanks

30 May 2007, 11:56 PM
#3
jmatthewsr avatar

jmatthewsr

New Zenner

Join Date:
Dec 2006
Posts:
13
Plugin Contributions:
0

Re: fckeditor - browsing and uploading to /images

I haven't looked at this exactly, but ideally you would probably want to add a file type 'PDF' or similar:

$Config['AllowedExtensions']['PDF']

then use my post to make an exception for this type (I made an exception to the 'image' directory) and point the location somewhere else.

-justin

31 May 2007, 10:40 AM
#4
mcoleman45 avatar

mcoleman45

New Zenner

Join Date:
May 2007
Posts:
7
Plugin Contributions:
0

Re: fckeditor - browsing and uploading to /images

Thanks Justin. I actually got my developer to look at it. I'm hoping he can figure it out with the info you provided. Mary