简单的使用fckeditor编辑器

正好这几天我也在用fck,有点经验,交流一下。
第一步下载

文档简介                                                         (tip:可将此处问题复制再来进行ctrl+f   查找出相应处理位置.)
  对于文中相关的配置值,在不明确在哪个文件下时,请用全站检索功能,便中找出。  
1   关于fck的皮肤问题
2   关于fck的构造问题
3     关于fck的宽高问题
4     关于文件上传问题
5     关于toolbar的设置
6   其它       字符串的 '   "号问题。


1关于fck的皮肤问题
fck_editor.css       this   file   defines   the   main   interface,   including   the   toolbar,   its   items   (buttons,   panels,   etc.)   and   the   context   menu.     这个定义主界面,包括工具条,和   工具条里面的项,buttons,   panels,   其它,和上下文目录。
fck_dialog.css       (this   file   defined   the   dialog   boxes   basic   structure   (standard   for   all   dialogs).   这个定义对话框的基本样式
fck_strip.gif                     这张图片用来画出所有的按钮,如需要改变button的样式时,重新制做16*16   icon   根据相同的顺序来设置。  

更改皮肤风格       三选一/
FCKConfig.SkinPath   =   FCKConfig.BasePath   +   'skins/silver/ '   ;     银色
FCKConfig.SkinPath   =   FCKConfig.BasePath   +   'skins/office2003/ '   ;      
FCKConfig.SkinPath   =   FCKConfig.BasePath   +   'skins/default/ '   ;      


2     关于fck的构造问题.
文件夹       FCKeditor/fckeditor.php     里面查找
function   __construct(   $instanceName   )
  {
$this-> InstanceName =   $instanceName   ;     //表单里面的名字
$this-> BasePath =   '/fckeditor/ '   ;                                             //基本路径,见意不要改动。
$this-> Width =   '100% '   ;                                                           //这里设定宽度,可以按%   和值来选定.
$this-> Height =   '500 '   ;                                                             //这里设定高度
$this-> ToolbarSet =   'Default '   ;                                             //采用哪几种工具条,有Default,base,具体   fckconfig.js里面设定.
$this-> Value       =   ' '   ;                                                                   //这个来设定fck的初始值。
$this-> Config =   array()   ;
}


3     关于fck的宽高问题
方法1     文件夹       FCKeditor/fckeditor.php     里面查找
function   __construct(   $instanceName   )
  {
$this-> InstanceName =   $instanceName   ;    
$this-> BasePath =   '/fckeditor/ '   ;                                            
$this-> Width =   '100% '   ;                                                           //这里设定宽度,可以按%   和值来选定.
$this-> Height =   '500 '   ;                                                             //这里设定高度
$this-> ToolbarSet =   'Default '   ;                                            
$this-> Value       =   ' '   ;                                                                  
$this-> Config =   array()   ;
}

方法2     在你构造一个新对象时,直接设定宽高   。例
    include_once( "FCKeditor/fckeditor.php ");

$oFCKeditor   =   new   FCKeditor( "bible_content ")   ;
//   FCKeditor所在目录
$oFCKeditor-> BasePath   =   'FCKeditor/ '   ;  
//load   the   tmp  
$oFCKeditor-> > Width     =           '100% '   ;                       //这里设定宽度,可以按%   和值来选定.
                        $this-> Height =         '500 '   ;                                                             //这里设定高度
$oFCKeditor-> Create(   'EditorDefault ',   '100% ',500);

4     关于文件上传问题
一     基本配置
4.1找到editor\filemanager\upload\php\config.php

      $Config[’Enabled’]   =   false   ;     false   ->   true
$Config[’UseFileType’]   =   false   ;   false   ->   true

4.2找到editor\filemanager\browser\default\connectors\php\config.php
$Config[’Enabled’]   =   false;       false   ->   true

    选用php设定为     php
var   _FileBrowserLanguage   =   ‘php’   ;   //   asp   |   aspx   |   cfm   |   lasso   |   perl   |   php   |   py
var   _QuickUploadLanguage   =   ‘php’   ;   //   asp   |   aspx   |   cfm   |   lasso   |   php

                          二       如何取消,和设置从服务器上选取图片.
                                FCKConfig.LinkBrowser   =   false   ;
FCKConfig.ImageBrowser   =   false   ;
FCKConfig.FlashBrowser   =   false   ;
即可..查找方式,全站检索.

                          三       如何处理   文件上传路径
  ConfigUserFilesPath   =   "/UserFiles/ "       可以设定你想要的路径,请对应好相关的文件上传   .

四   上传文件类型控制.
.../connectors/php/config.php   you   can   configure   what   extensions   are   allowed   or   denied   for   specific   filetypes.   The   filetypes   you   can   configure   are:  
Files,   e.g.   :   'htm ',   'html ',   'php ',   'php3 ',   'php5 ',   'phtml ',   'asp ',   'aspx ',   'ascx ',   'jsp ',   'cfm ',   'cfc ',   'pl ',   'bat ',   'exe ',   'dll ',   'reg ',   'cgi ',   'asmx '  


5     关于toolbar的设置
1   设置在toolbar   中显示和不显示哪些。  
FCKConfig.ToolbarSets[ "Default "]   =   [       //参照相关英语原意来配制。
[ 'Save ', 'NewPage ', 'Preview ', '- ', 'Cut ', 'Copy ', 'Paste '],
[ 'Undo ', 'Redo ', '- '],
[ 'Bold ', 'Italic ', 'Underline ', 'StrikeThrough ', '- ', 'Subscript ', 'Superscript '],
[ 'JustifyLeft ', 'JustifyCenter ', 'JustifyRight ', 'JustifyFull '],
'/ ',
[ 'Link ', 'Unlink '],
[ 'Image ', 'Table ', 'Rule ', 'Smiley ', 'SpecialChar ', 'PageBreak '],
[ 'FontName ', 'FontSize '],
[ 'TextColor ']
  ]   ; 
还有FCKConfig.ToolbarSets[ "Basic"]   可以自行定义自己的需要的工具菜单
       

参考文档:http://wiki.fckeditor.net/ 
         

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值