Hello everyone,
i am using FCK in PHP, and when i want to call a FCK in some page, it always bring some problem. I create a function to create a FCK object to use, but i have to modify the "BasePath" times and times when it moved to other server.
e.g. Following is the function:
function GenerateEditor($ObjName,$ObjVal,$id='Edit1',$width='',$height='')
{
global $SITE_PATH;
require_once dirname(dirname(__FILE__))."/fckeditor/fckeditor.php";
$width=($width=='')?"100%":$width;
if($height=='' || $height=='Med') $height='350px';
elseif($height=='Small') $height='140px';
elseif($height=='Large') $height='600px';
$oFCKeditor = new FCKeditor($ObjName) ;
$oFCKeditor->BasePath = '/fckeditor/';
$oFCKeditor->Value = $ObjVal;
$oFCKeditor->Width = $width;
$oFCKeditor->Height = $height;
$oFCKeditor->Create();
}
i think $oFCKeditor->BasePath = '/fckeditor/' is not a smarty one. e.g. i found the FCK at "/var/www/fckeditor", it works well, but if i found the fck file at "/var/www/abc/fckeditor", i have to modify that line to $oFCKeditor->BasePath = '/abc/fckeditor/'; Is there a way to make it works well automaticlly just like the line "require_once dirname(dirname(__FILE__))."/fckeditor/fckeditor.php";"?
Can anybody help me?
3Q
i am using FCK in PHP, and when i want to call a FCK in some page, it always bring some problem. I create a function to create a FCK object to use, but i have to modify the "BasePath" times and times when it moved to other server.
e.g. Following is the function:
function GenerateEditor($ObjName,$ObjVal,$id='Edit1',$width='',$height='')
{
global $SITE_PATH;
require_once dirname(dirname(__FILE__))."/fckeditor/fckeditor.php";
$width=($width=='')?"100%":$width;
if($height=='' || $height=='Med') $height='350px';
elseif($height=='Small') $height='140px';
elseif($height=='Large') $height='600px';
$oFCKeditor = new FCKeditor($ObjName) ;
$oFCKeditor->BasePath = '/fckeditor/';
$oFCKeditor->Value = $ObjVal;
$oFCKeditor->Width = $width;
$oFCKeditor->Height = $height;
$oFCKeditor->Create();
}
i think $oFCKeditor->BasePath = '/fckeditor/' is not a smarty one. e.g. i found the FCK at "/var/www/fckeditor", it works well, but if i found the fck file at "/var/www/abc/fckeditor", i have to modify that line to $oFCKeditor->BasePath = '/abc/fckeditor/'; Is there a way to make it works well automaticlly just like the line "require_once dirname(dirname(__FILE__))."/fckeditor/fckeditor.php";"?
Can anybody help me?
3Q
Re: How to make the "BasePath" fit the url automaticll
?