When browsing for an image the filename returned looks like /mydir/Images/myfile.jpg ... I want to insert http://mydomain.com in front of the filepath/filename ... This can't be done in the connector config.php var $Config['UserFilesPath'] because http:// is not part of the file path and the browser won't work. It needs to be in the javascript somewhere, which I don't program in so well ... it's probably in some js function that ends returns the string and if I could find where to put it, it should be as simple something like return ('http:/' + the_original_var) ... or add it on the js routine that receives the value and puts it into the form. Yes, here is YOUR chance to tell me where to stick it hehehe
... Any asssistance is much appreciated...
Wed, 07/20/2005 - 16:47
#1
RE: How at add http:// to browser filename
Hi,

i add this javascript code in order to have URL with full path :
if( (GetE('txtUrl').value).substr(0,7) == 'http://')
{
e.src = GetE('txtUrl').value ;
} else {
e.src = 'http://' + window.location.host + '/' + GetE('txtUrl').value ;
}
to the file :
FCKeditor\editor\dialog\fck_image\fck_image.js
at the end of the function UpdateImage (~line 219).
Test and comment
it would be better to have a variable which configure this in a config file.
lleell00
RE: How at add http:// to browser filename
I needed to do the same thing with the link dialog, and got it going thusly:
in FCKEditor\editor\dialog\fck_link\fck_link.js
at the very bottom, in the function "SetURL", change:
document.getElementById('txtUrl').value = url ;
to
document.getElementById('txtUrl').value = window.location.host + url ;
Save, flush cache, and give it a whirl.
RE: How at add http:// to browser filename
Thanks for the posts guys! Both methods look good but for some reason don't work for me. I tried IE6 and Firefox 1.04 and used "delete files" to clear cache, closed, and restarted them. Sometimes I am able to "break" the filemanager by experimenting so I don't think caching is the problem
... all I know is I'm trying to get http:// to show up in front of the filepath that is normally returned in the URL box and the Preview box on the Image Properties dialog... no matter what I do I just get /home/username/blahblah/image.ext and never get an http in the front. This results in an incorrect url in the URL field and a broken image link in the preview field instead of a picture... if I manually type in the http:/ in front of the image url and tab to another field the preview is updated and the image appears... any ideas???
RE: How at add http:// to browser filename
follow here for a possible solution:
http://sourceforge.net/forum/message.php?msg_id=3257937