FCKeditor 2.6.2使用修改說明(ASP)

來源:互聯網
上載者:User

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
%>

%>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" '<----新增加的行

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.