to all, I was having allot of trouble getting the BaseHref Config variable to work correctly with my editors. Whether I tried to set the value in runtime via
$oFCKeditor->Config['BaseHref'] = "http://mysite.com"
or changing the fckconfig.js file where the value is initiated via (line 35)
FCKConfig.BaseHref = 'http://mysite.com' ;
In the end I found it much easier to make my link paths absolute after the text field is posted. Here is the solution that I have found to work in PHP.
/*start with the standard impelmentation*/ <?php $oFCKeditor = new FCKeditor('infoletter') ; $oFCKeditor->BasePath = '/admin/fckeditor/' ; $oFCKeditor->Value = $infoletter ; $oFCKeditor->Create() ; ?> /* then when processing the form use the following lines*/ <? $siteURL= "mysite.com";//replace with the desired URL $infoletter=stripslashes($_POST['infoletter']);// get the submitted FCKeditor value $infoletter=str_replace("http://" . $siteURL, "", $infoletter);//first we eliminate anywhere where the path is already absolute (useful when updating) $infoletter=str_replace("/userfiles", "http://" . $siteURL . "/userfiles", $infoletter);//now add the URL anywhere that starts with the userfiles directory ?>
This was critical for me when creating an editable e-mail template that would be sent out via cron jobs. Hope it helps some of you as well.
Gliffen