I have fckeditor plus imce editor; photos not in Image file.

Sometimes when try the images button and browse server, get imce editor, sometimes fckeditor browser.
fckeditor browser would seem ok, but it looks in wrong place for my images.

How could I change the folder where it browses?
(I tried one change, but php error that stopped the whole site!)

Comments

DocMartin’s picture

I'd searched for info before making above post.

The problem hasn't gone (and despite having IMCE, I find fck's browser still pops up at times, looking in wrong place); I searched some more, inc threads I'd looked thro.

The following in post from gpdinoz perhaps looked hopeful:

Version 5. These are the files you need to edit.
modules/fckeditor/fckeditor/editor/filemanager/browser/default/connectors/php/config.php
modules/fckeditor/fckeditor/editor/filemanager/upload/php/config.php

To use the php connector line 24 in each of the above files need to be changed to
$Config['Enabled'] = true ;
This enables the php connector

Change the following to where you want to the files uploaded to. below is what I use.
// Path to user files relative to the document root.
$Config['UserFilesPath'] = '/files/' ;

I'd thought changing the userfilespath to files might help, but not so.

Searching for info on fckeditor itself (not the module), I find a couple of posts at
http://sourceforge.net/tracker/index.php?func=detail&aid=1312834&group_i...

*edit php/config.php as follow :

add the follwing lines after each
"$Config['DeniedExtensions']" setting:

$Config['ConfigDirectories']['File'] = "your files dir";
$Config['ConfigDirectories']['Image'] = "your images
dir";
$Config['ConfigDirectories']['Flash'] = "your flash
dir";
$Config['ConfigDirectories']['Media'] = "your media
dir ";

*edit php/io.php as follow :

at the start of GetUrlFromPath and ServerMapFolder
functions add :
global $Config ;

then replace each use of :
$resourceType
by
$Config['ConfigDirectories'][$resourceType]

followed by

It's important to get the

$Config['UserFilesPath']
$Config['UserFilesAbsolutePath']

Variables (in
editor/filemanager/browser/default/connectors/php/config.php)
correct as well.

UserFilesPath controls the prefix prefixed to the
folder/file_name.xxx when insterted into the webpage (think
http://mysite.com/ as a value)

UserFilesAbsolutePath controls the starting point for all
media types. I had all my media files in "images" so i used
something similar to "/root/mysite/images" as a value.

I also changed 1 thing in io.php that isnt listed here...

Changed "if ( $resourceType == '' )" to "if ( $resourceType
== '' || $Config['ConfigDirectories'][$resourceType] == '')"
in function getUrlFromPath() as i set my media specific
paths to "" because i want 'em all in the images/ directory.

Looks more complicated than I'd expected!
Not about to try just now, esp after I made an edit before that crashed my site! Later, maybe.
Advice on whether the above looks worthwhile would be welcome - so too an easier method. (I'd figured that might simply have to replace "Image" with "images" in one place - but oh no, not fixed that simply!)

DocMartin’s picture

Continuing the sound of one hand clapping nature of this thread:

I've revisited fckeditor pages on source forge, and seen re patch at: http://tinyurl.com/pepft

Wasn't clear if the 2.3 version would work with my 2.3.something version of the editor, but I figured what the heck, let's be rash.
And, the patch there works: can download 2.3 version zip files, and copy over to the ...../connectors/php/ folder.
Yet to try uploading to images folder; so far been using ftp for my images, and haven't figured what to do re other users n images.

Hope this helps someone.

fckeditor doesn't seem to indicate this fix works (yet) in 2.4, or that ability to readily change files browsed will be included in main version of fckeditor.

DocMartin’s picture

Title: How to change folder(s) browsed? » Change folders browsed by fckeditor (2.3) - eg Image to images
Status: Active » Fixed

Submitting this largely to change main title of this "thread".

Anonymous’s picture

Status: Fixed » Closed (fixed)