FCKeditor uses URLS instead of paths/TMCE path config probs

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
faglork

FCKeditor uses URLS instead of paths/TMCE path config probs

Post by faglork »

Hi all,

I noticed that when you select an image with FCKs images insert dialog and chose the "search server"  button in the upload dialogue box, the resulting image code uses a full url for the pic, like
I do not like this - should it become necessary to switch domains (legal issues, product re-branding ect.) you have to edit *each and every* inserted image by hand to correct this.

How can I change this behaviour to use paths relative to server root? Like
/images/uploads/picname.jpg
Is there a corrsponding  config setting somewhere? Or do I have to tamper with the code, and if so, does anyone know *where*?

Cheers,
Alex
Last edited by faglork on Fri Sep 07, 2007 5:05 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: FCKeditor uses URLS instead of paths

Post by Dr.CSS »

It was put in as some were having trouble with relative paths, you will have to mess with the file...

Or as you are using it edit them to the shorter path...
chrisl
Forum Members
Forum Members
Posts: 57
Joined: Fri Dec 30, 2005 10:08 am

Re: FCKeditor uses URLS instead of paths

Post by chrisl »

Mark's suggestion is good - edit the URL manually as you go along or you could try changing the

$config['uploads_url']  in the main configuration.
faglork

Re: FCKeditor uses URLS instead of paths

Post by faglork »

clorne wrote: Mark's suggestion is good - edit the URL manually as you go along
Nope - you can't tell that a client ... they will mess it all up.
clorne wrote: or you could try changing the

$config['uploads_url']  in the main configuration.

Code: Select all

$config['uploads_url'] 
?

There is no file to upload - it is already on the server. I already changed

Code: Select all

$config['uploads_url'] 
and the *uploaded* files show a relative path which is fine now.

The problems are files already on the server.

Cheers,
Alex
chrisl
Forum Members
Forum Members
Posts: 57
Joined: Fri Dec 30, 2005 10:08 am

Re: FCKeditor uses URLS instead of paths

Post by chrisl »

I do not know what versions you are using but if you are using FCK module version 1.0.3 and go to

\modules\FCKeditorX\FCKeditor\editor\filemanager\browser\default\connectors\php\config.php

at about line 27 you will find

$Config['UserFilesPath'] = $config['uploads_url'] ;

the FCK user file is taking the variable $config['uploads_url'] from CMSMS's config file.

As before you can change the main config file or the PHP connector config to read

$Config['UserFilesPath'] = '/uploads';  -- if uploads is your uploads directory.
RazorMedia

Re: FCKeditor uses URLS instead of paths

Post by RazorMedia »

..or just switch to TinyMCE
faglork

Re: FCKeditor uses URLS instead of paths

Post by faglork »

clorne wrote: I do not know what versions you are using but if you are using FCK module version 1.0.3 and go to

\modules\FCKeditorX\FCKeditor\editor\filemanager\browser\default\connectors\php\config.php

at about line 27 you will find

$Config['UserFilesPath'] = $config['uploads_url'] ;

the FCK user file is taking the variable $config['uploads_url'] from CMSMS's config file.

As before you can change the main config file or the PHP connector config to read

$Config['UserFilesPath'] = '/uploads';  -- if uploads is your uploads directory.


Ahhhhhhhhh .... my CMSMS' config.php says

Code: Select all

$config['uploads_url'] = $config['root_url'] . '/uploads';

ok, I will try that ... THX!


@RazorMedia: I will give it a try. So far it looks good, even better configuirable than FCK ... only 2 problems:

1)

TinyMCE obviously does not get its upload directory from CMSMS' config.php ... and it uses a path relative to the CMSMS directory like
uploads/images
but I want it to use
/uploads/images

changing
/htdocs/modules/TinyMCE/tinymce/jscripts/tiny_mce/plugins/simplebrowser/connectors/php/config.php

Code: Select all

$Config['UserFilesPath'] = str_replace($config["root_url"].'/', '', $config["uploads_url"]);
to
 $Config['UserFilesPath'] = $config["uploads_url"];
resulted in the loss of thumbnail pics in TinyMCE's filebrowser .... ($config["uploads_url"] is set to /uploads , btw.)

2)

There is no preview pic in the image insertion dialogue. I changed umask to 002, even 000 ... no way. No problems in FCK, though ...
When I look at the dialogue's html  code, there isnt even an img code in the corresponding DIV ... what gives?
Any ideas?

Cheers,
Alex
chrisl
Forum Members
Forum Members
Posts: 57
Joined: Fri Dec 30, 2005 10:08 am

Re: FCKeditor uses URLS instead of paths/TMCE path config probs

Post by chrisl »

If you are still looking to FCK try the following settings

\modules\FCKeditorX\FCKeditor\editor\filemanager\upload\php\config.php

Code: Select all

$Config['UserFilesPath'] = 'uploads/' ;
$Config['UserFilesAbsolutePath'] = $config['uploads_path'].'/' ;
\modules\FCKeditorX\FCKeditor\editor\filemanager\browser\default\connectors\php\config.php

Code: Select all

$Config['UserFilesPath'] = 'uploads/';
$Config['UserFilesAbsolutePath'] = $config['uploads_path'].'/' ;
also have a look at the FCK ImageManager plugin

http://www.saulmade.nl/FCKeditor/FCKPlugins.php
faglork

Re: FCKeditor uses URLS instead of paths/TMCE path config probs

Post by faglork »

clorne wrote: If you are still looking to FCK try the following settings

\modules\FCKeditorX\FCKeditor\editor\filemanager\upload\php\config.php

Code: Select all

$Config['UserFilesPath'] = 'uploads/' ;
$Config['UserFilesAbsolutePath'] = $config['uploads_path'].'/' ;
I had already set this to

Code: Select all

$Config['UserFilesPath'] = '/uploads/images/';
$Config['UserFilesAbsolutePath'] = '' ;
and it works fine for uploaded files.
clorne wrote: \modules\FCKeditorX\FCKeditor\editor\filemanager\browser\default\connectors\php\config.php

Code: Select all

$Config['UserFilesPath'] = 'uploads/';
$Config['UserFilesAbsolutePath'] = $config['uploads_path'].'/' ;
Thanks!!! That *almost* did the trick.
But now I *always* (on upload *and*  choosing form server) get paths relative to CMSMS install :-(

clorne wrote: also have a look at the FCK ImageManager plugin

http://www.saulmade.nl/FCKeditor/FCKPlugins.php
Ok, I will look into that.


In my opinion, this is confusing to the max!

The uploads path is ALREADY SET in CMSMS's config.php - so why for God's sake do we have to tamper with a whole bunch of config files (five! up to now!)?? FIVE different config files just to specify ONE path??

Additionally - the image browser of TinxMCE - which features the very same code AFAIK! - shows thumbnails, the *same* browser in the FCK installation does not. Needless to say that FCKs image preview works, but TinyMCE's not ...

Ist there anyone out there  who has sufficient FCK/TinyMCE  knowledge to clean this mess up for future installations?

Cheers,
Alex
faglork

Re: FCKeditor uses URLS instead of paths/TMCE path config probs

Post by faglork »

Eureka!!!
clorne wrote:
\modules\FCKeditorX\FCKeditor\editor\filemanager\browser\default\connectors\php\config.php

Code: Select all

$Config['UserFilesPath'] = 'uploads/';
$Config['UserFilesAbsolutePath'] = $config['uploads_path'].'/' ;
Changing it to

Code: Select all

$Config['UserFilesPath'] = '/uploads/';
did the trick ... thanks again for that hint.

Now I have to replicate that with TinyMCE ... after that I promis to wrap it all up and post it ...

Cheers,
Alex
faglork

Re: FCKeditor uses URLS instead of paths/TMCE path config probs

Post by faglork »

Well ...

I thought that there *must* be a simpler solution. Ok, maybe not ;-)

I changed
/config.php

Code: Select all

$config['uploads_url'] = $config['root_url'] . '/uploads';
to
$config['uploads_url'] = '/uploads/';
and

/modules/FCKeditorX/FCKeditor/editor/filemanager/browser/default/connectors/php/config.php
back to

Code: Select all

$Config['UserFilesPath'] = $config['uploads_url'];
Surprisingly, the result is a FULL URL http://www.domain.com/uploads/images/pic.jpg

Now, my understanding is that the latter config should take the variable from the first one?
Or am I mistaken? Where does it get the full url??

Confused,
Alex


Well, I'll be damned ... due to a friggin' bug in my WS_FTP it did not transfer the first file, I now corrected it, and it works.

Phew.

Guess what doesnt work? Uploading files now gives /filename.jpg which is completely wrong.

So, I changed in
/modules/FCKeditorX/FCKeditor/editor/filemanager/upload/php

Code: Select all

// Path to user files relative to the document root.
$Config['UserFilesPath'] = $config['uploads_url'].'/' 
[color=red](shouldn't that be $config['image_uploads_url'] anyway?)[/color]
to 
$Config['UserFilesPath'] = '/uploads/images/';

AND

// 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'] = $config['uploads_path'].'/' ; 

to

$Config['UserFilesAbsolutePath'] = '' ;

and TATAAAA!!

So ... it seems that this one does NOT get the variables from /config.php
... why not?

Alex
Last edited by faglork on Fri Sep 07, 2007 8:16 pm, edited 1 time in total.
faglork

Re: FCKeditor uses URLS instead of paths/TMCE path config probs

Post by faglork »

Ok,

on with TinyMCE.

The uploads url setting in /config.php is

Code: Select all

$config['uploads_url'] = '/uploads/';
the UserFilesPath setting in
/modules/TinyMCE/tinymce/jscripts/tiny_mce/plugins/simplebrowser/connectors/php
is

Code: Select all

$Config['UserFilesPath'] = $config["uploads_url"];
Well, the resulting image url after image insertion is

uploads/images/filename.jpg

instead of

/uploads/images/filename.jpg

despite the explicitely given opening slash in

Code: Select all

$config['uploads_url'] = '/uploads/';


Why, oh why??

I am off for a few beers ...

Alex

Ps: And the image preview doesn't work, either ...
KO
Power Poster
Power Poster
Posts: 562
Joined: Mon Nov 06, 2006 7:55 pm

Re: FCKeditor uses URLS instead of paths/TMCE path config probs

Post by KO »

You might get the image preview working by changing the "image_transform_lib_path" in config.php to lib/filemanager/ImageManager/Classes

And probably you need to put in the beginning your path from root in front of it.

br, K
styson

Re: FCKeditor uses URLS instead of paths/TMCE path config probs

Post by styson »

Any new word on this issue.  I get to upgrade a site from 1.08 to 1.1.3.1 and bring it live this weekend and I just discuvvored this "Feature" of the editors which is going to turn a short task into an all day task.  Needless to say my cleint is not happy. 

After the upgrade I get to fix the editor so it doesn't use full URls again, once we decide what editor to use.
Locked

Return to “[locked] Installation, Setup and Upgrade”