Page 1 of 1
FCKeditor uses URLS instead of paths/TMCE path config probs
Posted: Wed Sep 05, 2007 7:21 pm
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
Re: FCKeditor uses URLS instead of paths
Posted: Wed Sep 05, 2007 8:04 pm
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...
Re: FCKeditor uses URLS instead of paths
Posted: Wed Sep 05, 2007 9:41 pm
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.
Re: FCKeditor uses URLS instead of paths
Posted: Thu Sep 06, 2007 2:52 pm
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.
?
There is no file to upload - it is already on the server. I already changed
and the *uploaded* files show a relative path which is fine now.
The problems are files already on the server.
Cheers,
Alex
Re: FCKeditor uses URLS instead of paths
Posted: Fri Sep 07, 2007 7:04 am
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.
Re: FCKeditor uses URLS instead of paths
Posted: Fri Sep 07, 2007 7:37 am
by RazorMedia
..or just switch to TinyMCE
Re: FCKeditor uses URLS instead of paths
Posted: Fri Sep 07, 2007 5:03 pm
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
Re: FCKeditor uses URLS instead of paths/TMCE path config probs
Posted: Fri Sep 07, 2007 5:53 pm
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
Re: FCKeditor uses URLS instead of paths/TMCE path config probs
Posted: Fri Sep 07, 2007 6:38 pm
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
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
Re: FCKeditor uses URLS instead of paths/TMCE path config probs
Posted: Fri Sep 07, 2007 6:53 pm
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
Re: FCKeditor uses URLS instead of paths/TMCE path config probs
Posted: Fri Sep 07, 2007 7:25 pm
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
Re: FCKeditor uses URLS instead of paths/TMCE path config probs
Posted: Fri Sep 07, 2007 9:04 pm
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 ...
Re: FCKeditor uses URLS instead of paths/TMCE path config probs
Posted: Fri Sep 07, 2007 10:48 pm
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
Re: FCKeditor uses URLS instead of paths/TMCE path config probs
Posted: Wed Oct 03, 2007 4:00 pm
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.