Page 1 of 1

[SOLVED] FCKeditor / Newsletters' images -> Absolute path

Posted: Mon 10. Sep 2007, 19:10
by StudioZ
Anyone would know where I could edit the necessary FCKeditor config file,
to make images inserted through the FCKeditor FileManager, use absolute paths instead of relative paths ?

Thanks,

Yves

Posted: Mon 10. Sep 2007, 19:21
by update
/include/inc_ext/fckeditor/editor/filemanager/browser/default/connectors/php/config.php:

Code: Select all

// Path to user files relative to the document root.
//$Config['UserFilesPath'] = '/userfiles/' ;
$path = explode('/include/',$_SERVER['PHP_SELF']);
$baseFolder = empty($path[0]) ? '' : $path[0];
$Config['UserFilesPath'] = $baseFolder.'/picture/upload/' ;

// Fill the following value it you prefer to specify the absolute path for the
// user files directory. Usefull if you are using a virtual directory, symbolic
// link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
// Attention: The above 'UserFilesPath' must point to the same directory.
$Config['UserFilesAbsolutePath'] = '' ;
perhaps there is something to tweak?

Posted: Mon 10. Sep 2007, 19:52
by StudioZ
Thank you Claus for your hint !
Unfortunetly and without success, tried all sorts of flavors
and combinations possible to make FCKeditor pull the images from this absolute path:
http://www.logotypes.ca/design/picture/upload/

:roll:

Really don't know where else to look at :?

Thanks,

Yves

Posted: Mon 10. Sep 2007, 21:51
by Goran
Yves, I'm just curious, why you need absolute paths instead of relative paths?

Posted: Mon 10. Sep 2007, 22:16
by StudioZ
Hi Goran,
Goran wrote:Yves, I'm just curious, why you need absolute paths instead of relative paths?
Simply for these reasons :
I created a newsletter template where all the basic recurrent images like
the logo etc. ... are setup in the template with absolute paths.
This way, all the images appear in any email client.
The CSS is defined inside the template.
The only way to make it behave as expected (AFAIK).
Now... just for the editorial images which need to be changed from times to times... I need my customers to
easily present these without having to go in FCKeditor's source view,
modifying the relative paths to absolute paths.

Although... If this is not possible I will simply edit these images paths
by hand, the hard way. :wink:

Cheers,

Yves

Posted: Tue 11. Sep 2007, 02:56
by Goran
Try following, works fine for me:

1. Open /include/inc_ext/fckeditor/editor/filemanager/browser/default/connectors/php/config.php
2. Replace

Code: Select all

$Config['UserFilesPath'] = $baseFolder.'/picture/upload/' ;
with:

Code: Select all

$Config['UserFilesPath'] = 'http://www.domain.com/picture/upload/' ;
3. Replace

Code: Select all

$Config['UserFilesAbsolutePath'] = '' ;
with:

Code: Select all

$Config['UserFilesAbsolutePath'] = '/home/user/public_html/picture/upload/' ;

Don't forget to change values for UserFilesAbsolutePath and domain name

Posted: Tue 11. Sep 2007, 03:11
by DeXXus
I don' t have a phpWCMS installation to experiment with, but you might investigate this post from the FCKeditor forums:
http://fckeditor.biz/viewtopic.php?p=2530#2530

Posted: Tue 11. Sep 2007, 03:42
by StudioZ
Thank you Goran for your help !

It partially work for my test.
I edited as you suggested and for me, the way I am setup, "logotypes.ca" being an addon domain to my main domain account "malouin.ws".

Here's what I edited :

Code: Select all

$Config['UserFilesPath'] = $baseFolder.'http://www.logotypes.ca/design/picture/upload/' ;

Code: Select all

$Config['UserFilesAbsolutePath'] = '/home/malouin/public_html/logotypes/design/picture/upload/' ;
Here's an example of the weird path it produces:

Code: Select all

<img src="/designhttp://www.logotypes.ca/design/picture/upload/image/myimage.jpg" alt="" />
I have the feeling that this is a bit crooked to accomplish :wink:
I would need to find the good way to edit my main phpwcms config file to make it match for my needs. :roll:

Here's what I feel may needs to be edited the right way:

Code: Select all

// $phpwcms['site']              = 'http://'.$_SERVER['SERVER_NAME'].'/';
$phpwcms["site"]              = "http://www.logotypes.ca/";
$phpwcms['DOC_ROOT']          = $_SERVER['DOCUMENT_ROOT'];
$phpwcms['root']              = 'design';
If this is impossible I will just teach my customer on how to edit the paths in the Source (not user friendly tough :roll:)

Will see what else I can find when I am back ... :roll:

Thanks,

Yves

Posted: Tue 11. Sep 2007, 09:59
by Goran
StudioZ wrote: Here's what I edited :

Code: Select all

$Config['UserFilesPath'] = $baseFolder.'http://www.logotypes.ca/design/picture/upload/' ;
Yves, this is wrong...read again my instruction above, you need to remove $baseFolder. from 'UserFilesPath'.....and leave only the url path to /picture/upload/ directory. I have tested and this setting works 100% on my installation.

Posted: Tue 11. Sep 2007, 21:36
by StudioZ
Yep :D :D :D
My mistake :oops:
Forgot to remove the crucial $baseFolder. portion.

Your tweak is working perfectly :) :D

Thanks again Goran :wink:
You made my day 8)

Cheers,

Yves