Home  >  Article  >  Backend Development  >  FCKeditor中PHP配备

FCKeditor中PHP配备

WBOY
WBOYOriginal
2016-06-13 13:04:27774browse

FCKeditor中PHP配置
1、下载FCKeditor 多国语言版
2、解压后删除文件
   /FCKeditor/目录下除fckconfig.js,fckeditor.js,fckstyles.xml,fcktemplates.xml,fckeditor.php五个文件以外的所有文件
   删除目录/editor/_source,_testcases(基本上,所有_开头的文件夹或文件都是可选的)
   删除/editor/filemanager/browser/default/connectors/下除PHP目录的所有目录
   删除/editor/filemanager/upload/下的除PHP目录的所有目录
   删除/editor/lang/下的除了 en.js, zh.js, zh-cn.js三个文件的所有文件
3.打开/FCKeditor/fckconfig.js修改
     var FCKConfig.DefaultLanguage = ''zh-cn'' ;
    var _FileBrowserLanguage  = ''php'' ;
    var _QuickUploadLanguage  = ''php'' ;

要开启文件上传的话,还需要配置FCKeditor\editor\filemanager\upload\php\config.php以及\ FCKeditor\editor\filemanager\browser\default\connectors\php\config.php注意:上传中文名文件会乱码

4.调用方法
   将FCKeditor放在网站根目录在PHP文件里面,包含/FCKeditor/fckeditor.php文件包
   //含fckeditor类
   include("../FCKeditor/fckeditor.php") ;
  //设置编辑器路径
  $sBasePath = "/FCKeditor/";
//创建一个Fckeditor,表单的名称为ipaddr
$oFCKeditor = new FCKeditor(''ipaddr'') ;
$oFCKeditor->BasePath  = $sBasePath ;
//设置表单初始值
$oFCKeditor->Value  = ''This is some sample   text'' ;
$oFCKeditor->Create() ;

//还可设置
$oFCKeditor->Width
$oFCKeditor->Height
$oFCKeditor->ToolbarSet

5.定制调用路径直接将FCKeditor目录改为editor/,并且在调用的时候指定根路径为/editor/。
b.定制风格可以通过修改editor\skins目录下的Skin来定制风格,主要是修改CSS。
c.定制toolbar在fckconfig.js中,默认定制好了Default(有表格编辑等),Basic(简洁类型)两种toolbar,你也可以根据格式定制自己的toolbar,并且在php中使用$oFCKeditor->ToolbarSet=toolbarname调用
d.定制字体将fckconfig.js里面的FCKConfig.FontNames字体列表前面加上:宋体;黑体;隶书;楷体_GB2312;(注意保存为UTF8格式)
e.关闭文件上传将fckconfig.js里面的FCKConfig.LinkBrowser,FCKConfig.ImageBrowser, FCKConfig.FlashBrowser,FCKConfig.LinkUpload,FCKConfig.ImageUpload,FCKConfig.FlashUpload 设置为false
注意事项:请用Editplus之类的编辑器编辑配置文件,注意保存格式为utf8.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn