fckeditor的图片上传路径写的不是很完美

解决方案 »

  1.   

    正好这几天我也在用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']
     ] ;
     
    6  关于' ,"" 号的输入问题.
       原文中 FCKConfig.AdditionalNumericEntities = "'" ;  插入后无效,便手动添置修改.
       $bible_content =stripslashes( $_GET['bible_content']);   解决双引号问题.
      $bible_content =ereg_replace( "'","\'",$bible_content );    解决单引号问题.
         参考文档:http://wiki.fckeditor.net/
         
      

  2.   

    编辑框里的内容直接&_POST插入数据库
    上传路径改动:editor\filemanager\upload\php\upload.php里改看到熟悉的move_uploaded_file函数,就知道怎么改了.