Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2006
    Posts
    13
    Plugin Contributions
    0

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

    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

  2. #2
    Join Date
    May 2007
    Posts
    7
    Plugin Contributions
    0

    Default 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

  3. #3
    Join Date
    Dec 2006
    Posts
    13
    Plugin Contributions
    0

    Default 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

  4. #4
    Join Date
    May 2007
    Posts
    7
    Plugin Contributions
    0

    Default 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

 

 

Similar Threads

  1. v154 Apple Ipad and uploading multiple images to the store
    By Annie_zaz in forum Installing on a Mac Server
    Replies: 13
    Last Post: 8 Feb 2016, 03:50 PM
  2. Error in fckeditor - Unable to add any images
    By canemasters in forum General Questions
    Replies: 4
    Last Post: 21 Jan 2009, 04:46 AM
  3. Links and Images point to localhost when browsing from another computer
    By customgt in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 2 Jul 2008, 03:34 PM
  4. Adding Images trouble with fckeditor
    By arpeggio in forum General Questions
    Replies: 1
    Last Post: 14 Aug 2007, 04:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR