By default, FCKeditor does not show images with an absolute path (ie. http://www.yourwebsite.com/user_images/image1.gif) but with a relative path (images/image1.gif). [ Please correct me if I'm wrong. ]
When you want to show images with the 'http://...' please change the following:
In the config file change the ImageBrowserURL line.
[ fckconfig.js ]
FCKConfig.ImageBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Connector=connectors/php/connector.php&ServerPath=http://www.yourwebsite.com/user_images/&BasePath=/home/httpd/vhosts/yourwebsite.com/httpdocs/user_images/" ;
BasePath = the path to the folder of your images
ServerPath = the URL of the folder of your images
Then, in the file browser.html:
-- AFTER
var sServerPath = GetUrlParam( 'ServerPath' ) ;
if ( sServerPath.length > 0 )
oConnector.ConnectorUrl += 'ServerPath=' + escape( sServerPath ) + '&' ;
-- ADD the lines
var sBasePath = GetUrlParam( 'BasePath' ) ;
if ( sBasePath.length > 0 )
oConnector.ConnectorUrl += 'BasePath=' + escape( sBasePath ) + '&' ;
In the file connect.php do the following:
-- REPLACE
$GLOBALS["UserFilesDirectory"] = GetRootPath() . $GLOBALS["UserFilesPath"] ;
-- WITH
$GLOBALS["UserFilesDirectory"] = $_GET['BasePath'];
You can also remove the (annoying) Resource type in the IO.PHP file.
In the lines where you see '$resourceType', just remove the $resourceType, like so:
function GetUrlFromPath
// return $GLOBALS["UserFilesPath"] . $resourceType . $folderPath ;
return $GLOBALS["UserFilesPath"] . $folderPath ;
function ServerMapFolder
// $sResourceTypePath = $GLOBALS["UserFilesDirectory"] . $resourceType . '/' ;
$sResourceTypePath = $GLOBALS["UserFilesDirectory"];
Hope this helps.
Greetz, Bart
Tue, 05/31/2005 - 21:02
#1
RE: Absolute path and the image browser
RE: Absolute path and the image browser
I've very very often asked and wondered this. I've yet to hear a response. (Perhaps I just missed it?)
Jake
RE: Absolute path and the image browser
BTW, haven't looked at security issues yet. Needed to get this thing to work and worry about the lawsuits later.
RE: Absolute path and the image browser
Okay
found an easy solution:
in the file frmresourceslist.html
look for the function:
function GetFoldersAndFilesCallBack( fckXml )
Last row change this:
oListManager.AddFile( sFileName, 'http://www.yourserver.com/image' + sCurrentFolderPath + sFileName, sFileSize ) ;
RE: Absolute path and the image browser