Howdy,
I am trying to get the full image URL to output.
I have created a server based CMS and I am wanting the HTML to output with the full image name. For instance the website is http://www.mydomain.com/UserFiles/Pic1.jpg and it is only outputting /UserFiles/Pic1.jpg
Where do I edit the code so that it will add my domain?
Or can someone point me to the direction of where I can edit the images folder to be the folder on a different web server?
Thanks.
Tue, 12/19/2006 - 09:02
#1
RE: Full Image URL?
Well, I actually figured it out.
I went into the fck_image.js and added my own variable and added it to
function SetUrl( url, width, height, alt )
{
if ( sActualBrowser == 'Link' )
{
GetE('txtLnkUrl').value = httpUrl + url ;
UpdatePreview() ;
}
else
{
GetE('txtUrl').value = httpUrl + url ;
GetE('txtWidth').value = width ? width : '' ;
GetE('txtHeight').value = height ? height : '' ;
if ( alt )
GetE('txtAlt').value = alt;
UpdatePreview() ;
UpdateOriginal( true ) ;
}
window.parent.SetSelectedTab( 'Info' ) ;
}
RE: Full Image URL?
I tried to apply these changes to my fck_image.js file but the URL used for every img tags remains relative to the document root.
Am I missing something? I'd really like to use FCKeditor as an online HTML email editor and need full img URLs so that the images will get displayed in the email once it is sent.
SetUrl seems to hardly ever be called at all.
Mind you, I do loose patience very quickly when trying to work out what js function calls which other js function ...
Thanks for the this far though,
oDn
RE: Full Image URL?
Hi again,
I've at last managed to solve the issue with a dirty hack.
I'm currently using the php connector so I'm sorry for all the other users who have different connectors.
Still, it might help you out a little.
I edited the following:
* "FCKeditor\editor\filemanager\browser\default\connectors\php\io.php"
on line 26 within the function definition of GetUrlFromPath() replace
return $GLOBALS["UserFilesPath"] . $resourceType . $folderPath ;
with
return 'http://' . $_SERVER['SERVER_NAME'] . $GLOBALS["UserFilesPath"] . $resourceType . $folderPath ;
* "FCKeditor\editor\filemanager\upload\php\upload.php"
starting line 113 replace
if ( $Config['UseFileType'] )
$sFileUrl = $Config["UserFilesPath"] . $sType . '/' . $sFileName ;
else
$sFileUrl = $Config["UserFilesPath"] . $sFileName ;
with
if ( $Config['UseFileType'] )
$sFileUrl = 'http://' . $_SERVER['SERVER_NAME'] . $Config["UserFilesPath"] . $sType . '/' . $sFileName ;
else
$sFileUrl = 'http://' . $_SERVER['SERVER_NAME'] . $Config["UserFilesPath"] . $sFileName ;
This will allow you to have full URLs for your images within the editor when you use the browser and when you upload new files.
Hope that helped.
RE: Full Image URL?
Don't forget to also change "FCKeditor\editor\filemanager\browser\default\connectors\php\io.php" on line 25

replace
return RemoveFromEnd( $GLOBALS["UserFilesPath"], '/' ) . $folderPath ;
with
return RemoveFromEnd( 'http://' . $_SERVER['SERVER_NAME'] . $GLOBALS["UserFilesPath"], '/' ) . $folderPath ;
That should be it
RE: Full Image URL?
this._def("relative_urls", true);!
RE: Full Image URL?
this._def("relative_urls", true);!
RE: Full Image URL?
Your code works perfectly ! Thank you !
Yet, once the image is insert in the editor, when I click on Image properties in the context menu (right click on the image), I've got this script error :
Line 81
Error : 'length' is NULL or is not an object
Code : 0
URL : .../dialog/fck_image.js
Then, all data of the image are missing (url, width, height,...) in the Image dialog box. And the button 'ok' disappear as well...
I've tried to see in fck_contextmenu.js if I can do something, but difficult to see exactly where...
Do you have this problem as well ?
Regards,
Benoleg