FCKeditor 2.6.2配置修改说明

=========================================================================

一、精简FCKeditor目录,目录里只留下以下3个文件1个文件夹

fckconfig.js

fckstyles.xml

fcktemplates.xml

[editor]

注意:

将fckeditor.asp移出Fckeditor的目录,安全性高些,调用

fckeditor.js这个文件经测试不需要,因为我们用ASP,这个网上一般都说是保留,实际上如果你不用js调用的话它是多余的,删除也是安全性原因

精简Fckeditor

1、删除FCKeditor文件夹里所有以"_下划线"开头的文件和文件夹

2、删除FCKeditor\editor\filemanager\connectors\文件夹里除asp文件夹外的其它语言都删除。

====================================================================

二、修改FCKeditor\fckconfig.js文件

1、将以下几个参数,全部改为false,主要为了安全考虑

FCKConfig.LinkBrowser = true ;

FCKConfig.ImageBrowser = true ;

FCKConfig.FlashBrowser = true ;

FCKConfig.LinkUpload = true ;

FCKConfig.ImageUpload = true ;

FCKConfig.FlashUpload = true ;

然后用如下方法调用,可打开上传设置:

<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
With oFCKeditor
   .BasePath   = sBasePath & "FCKeditor/"

   .Config("LinkBrowser") = "true"
   .Config("ImageBrowser") = "true"
   .Config("FlashBrowser") = "true"
   .Config("LinkUpload") = "true"
   .Config("ImageUpload") = "true"
   .Config("FlashUpload") = "true"
  
   .Value   = content
   .Height   = 350
   .Create "Content"
End With
%>

<% br="">Dim oFCKeditor
Set oFCKeditor = New FCKeditor
With oFCKeditor
  .BasePath  = sBasePath & "FCKeditor/"

  .Config("LinkBrowser") = "true"
  .Config("ImageBrowser") = "true"
  .Config("FlashBrowser") = "true"
  .Config("LinkUpload") = "true"
  .Config("ImageUpload") = "true"
  .Config("FlashUpload") = "true"
  
  .Value  = content
  .Height  = 350
  .Create "Content"
End With
%>

2、修改上传所用语言,默认是PHP

var _FileBrowserLanguage  = 'asp' ;  // asp | aspx | cfm | lasso | perl | php | py

var _QuickUploadLanguage  = 'asp' ;  // asp | aspx | cfm | lasso | perl | php | py

3、其它修改:

FCKConfig.ToolbarComboPreviewCSS = 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' ;

FCKConfig.DefaultLanguage    = 'zh-cn' ;

FCKConfig.TabSpaces    = 1 ;

去掉表情菜单smiley或将表情文件夹images\smiley移出fck目录,防止暴露fck的后台地址

FCKConfig.SmileyPath  = FCKConfig.BasePath + 'images/smiley/msn/' ; '表情文件夹地址

FCKConfig.SmileyImages  = ['regular_smile.gif','sad_smile.gif','wink_smile.gif','teeth_smile.gif','confused_smile.gif','tounge_smile.gif','embaressed_smile.gif','omg_smile.gif','whatchutalkingabout_smile.gif','angry_smile.gif','angel_smile.gif','shades_smile.gif','devil_smile.gif','cry_smile.gif','lightbulb.gif','thumbs_down.gif','thumbs_up.gif','heart.gif','broken_heart.gif','kiss.gif','envelope.gif'] ;

==========================================================================三、修改打开文件上传
文件:FCKeditor\editor\filemanager\connectors\asp\config.asp
a)使配置生效
ConfigIsEnabled = True

b)设置上传目录
修改
ConfigUserFilesPath = "/yourpath/"  '"/userfiles/"

c)修改上传到当天的目录下,比如:"image/2008-7-1/7say.gif","file/2008-7-1/7say.rar",
ConfigFileTypesPath.Add "File", ConfigUserFilesPath & "file/" '增加& "file/"
ConfigQuickUploadPath.Add "File", ConfigUserFilesPath & "file/" & date '增加& "file/" & date

ConfigFileTypesPath.Add "Image", ConfigUserFilesPath & "image/"   '增加& "image/"
ConfigQuickUploadPath.Add "Image", ConfigUserFilesPath & "Image/" & date '增加& "Image/" & date

ConfigFileTypesPath.Add "Flash", ConfigUserFilesPath & "flash/" '增加& "flash/"
ConfigQuickUploadPath.Add "Flash", ConfigUserFilesPath & "Flash/" & date '增加& "Flash/" & date

ConfigFileTypesPath.Add "Media", ConfigUserFilesPath & "media/" '增加& "media/"
ConfigQuickUploadPath.Add "Media", ConfigUserFilesPath & "Media/" & date '增加& "Media/" & date

'这样修改可快速上传,并且浏览服务器可查看并选择已上传的图片,亲自测试通过。
========================================================================================
四、修改上传生成随机文件名
文件:FCKeditor\editor\filemanager\connectors\asp\commands.asp
在文件最下面加如下方法:
   '//取得一个不重复的序号,生成随机文件名
  Public Function GetNewID()
    dim ranNum, dtNow
    randomize
    dtNow=Now()
    ranNum=int(90*rnd)+10
    GetNewID=year(dtNow) & right("0" & month(dtNow),2) & right("0" & day(dtNow),2) & right("0" & hour(dtNow),2) & right("0" & minute(dtNow),2) & right("0" & second(dtNow),2) & ranNum
  End Function
  '========================

修改163-165行
      ' Get the uploaded file name.
      sFileName  = oUploader.File( "NewFile" ).Name
      sExtension  = oUploader.File( "NewFile" ).Ext

      ' Get the uploaded file name.
      sExtension  = oUploader.File( "NewFile" ).Ext
      'sFileName  = oUploader.File( "NewFile" ).Name
      sFileName  = GetNewID() &"."& sExtension  '<--修改的行

========================================================================================
五、修改快速上传中文乱码(网上看到的,本人未遇到过)
文件:FCKeditor\editor\filemanager\connectors\asp\io.asp
修改215行:
在Response.Clear后增加两行:
Response.CodePage=65001 '<----新增加的行
Response.Charset="UTF-8" '<----新增加的行

posted on 2011-08-30 15:40  努力实现目标  阅读(564)  评论(0编辑  收藏  举报