: FCK editor 2.x: // FCKeditor, $Config ['UserFilesPath']
. , php-. /, , . , FCKeditor - , . FCKeditor . FCKeditor. , , . , . $Config ['UserFilesPath'] , , FCKeditor . . FCKeditor 2.5.1 VersionBuild 17566, , . , , , FCKeditor.
1) fckeditor\editor\filemanager\connector\phpconfig.php
a) $Config; $Config ['Enabled'] = false;
i) , , : : .. FCKeditor , FCKeditor , :
if(!isset($_SESSION)){
session_start();
}
if(isset($_SESSION['SESSION_SERVER_RELATIVEPATH']) && $_SESSION['SESSION_SERVER_RELATIVEPATH']!="") {
$relative_path=$_SESSION['SESSION_SERVER_RELATIVEPATH'];
include_once($_SERVER['DOCUMENT_ROOT'].$relative_path."configurations/configuration.php");
}
N.B.: $_SESSION ['SESSION_SERVER_RELATIVEPATH']: , webroot; "/project/folder/path/" , . /configuration.php. , /configuration.php
ii) FCKeditor , , , ( , ). , , , (iii), ( ). :
if(!isset($_SESSION)){
session_name($_REQUEST['param_project_to_fck']);
session_start();
}
if(isset($_SESSION['SESSION_SERVER_RELATIVEPATH']) && $_SESSION['SESSION_SERVER_RELATIVEPATH']!="") {
$relative_path=$_SESSION['SESSION_SERVER_RELATIVEPATH'];
include_once($_SERVER['DOCUMENT_ROOT'].$relative_path."configurations/configuration.php");
}
, N.B. , (i)
iii) FCKeditor , , ( ). :
if(isset($_REQUEST['param_project_to_fck']) && $_REQUEST['param_project_to_fck']!=""){
$relative_path=base64_decode($_REQUEST['param_project_to_fck']);
include_once($_SERVER['DOCUMENT_ROOT'].$relative_path."configurations/configuration.php");
}
, N.B. (i)
b) , , :
$Config['UserFilesPath'] = '/userfiles/' ;
:
if(isset($SERVER_RELATIVEPATH) && $SERVER_RELATIVEPATH==$relative_path) { //to make it relatively secure so that hackers can not create any upload folder automatcally in the server, using a direct link and can not upload files there
$Config['Enabled'] = true ;
$file_upload_relative_path=$SERVER_RELATIVEPATH;
}else{
$Config['Enabled'] = false ;
exit();
}
// Path to user files relative to the document root.
//$Config['UserFilesPath'] = '/userfiles/' ;
//$Config['UserFilesPath'] = $file_upload_relative_path.'userfiles/' ;
$Config['UserFilesPath'] = '/userfiles'.$file_upload_relative_path;
$SERVER_RELATIVEPATH - , , .
$Config ['UserFilesPath'] , $file_upload_relative_path. bluehost linux, ( 0755) userfiles ( 0777 FCKeditor), . , userfiles - ( ) 0777, $config :
$Config['UserFilesPath'] = '/userfiles'.$file_upload_relative_path;
, ( ):
$Config['UserFilesPath'] = $file_upload_relative_path.'userfiles/' ;
, $Config ['UserFilesPath'] = '/userfiles/'; , .
2) 1) (a) (ii) (iii),
(a) fckeditor\editor\filemanager\browser\default\browser.html.
: var sConnUrl = GetUrlParam ('Connector');
:
var param_project_to_fck = GetUrlParam( 'param_project_to_fck' ) ;
: sUrl + = '& CurrentFolder =' + encodeURIComponent (this.CurrentFolder);
:
sUrl += '¶m_project_to_fck=' + param_project_to_fck ;
(b) ckeditor\editor\filemanager\browser\default\frmupload.html.
( SetCurrentFolder()):
sUrl += '&CurrentFolder=' + encodeURIComponent( folderPath ) ;
:
sUrl += '¶m_project_to_fck='+window.parent.param_project_to_fck;
3) , FCKeditor , php /:
include_once(Absolute/Folder/path/for/FCKeditor/."fckeditor/fckeditor.php") ;
$oFCKeditor = new FCKeditor(Field_name_for_editor_content_area) ;
$oFCKeditor->BasePath = http_full_path_for_FCKeditor_location.'fckeditor/' ;
$oFCKeditor->Height = 400;
$oFCKeditor->Width = 600;
$oFCKeditor->Value =Your_desired_content_to_show_in_editor;
$oFCKeditor->Create() ;
a) , 1) (a) (ii) (iii), : $oFCKeditor- > Create();
$oFCKeditor->Config["LinkBrowserURL"] = ($oFCKeditor->BasePath)."editor/filemanager/browser/default/browser.html?Connector=../../connectors/php/connector.php¶m_project_to_fck=".base64_encode($SERVER_RELATIVEPATH);
$oFCKeditor->Config["ImageBrowserURL"] = ($oFCKeditor->BasePath)."editor/filemanager/browser/default/browser.html?Type=Image&Connector=../../connectors/php/connector.php¶m_project_to_fck=".base64_encode($SERVER_RELATIVEPATH);
$oFCKeditor->Config["FlashBrowserURL"] = ($oFCKeditor->BasePath)."editor/filemanager/browser/default/browser.html?Type=Flash&Connector=../../connectors/php/connector.php¶m_project_to_fck=".base64_encode($SERVER_RELATIVEPATH);
b), 1) (a) (ii), : base64_encode ($ SERVER_RELATIVEPATH) : base64_encode (session_name())
.