如何在php中配置fckeditor編輯器的方法_PHP教程

來源:互聯網
上載者:User
fckeditor編輯器是一個支援多語多的網頁線上編輯器,他可以支援asp,asp.net,jsp,php等,但是它預設的不是php而是asp哦,下面我們來看看如何在php中配置fckeditor編輯器吧。

下載解壓後為檔案夾減肥:

刪除/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三個檔案的所有檔案


一:修改檔案上傳語言為PHP
開啟fckconfig.js
找到:
var _FileBrowserLanguage = 'asp'
var _QuickUploadLanguage = 'asp'
改成:
var FCKConfig.DefaultLanguage = 'zh-cn' ;
var _FileBrowserLanguage = 'php'
var _QuickUploadLanguage = 'php'


二:啟用PHP檔案上傳

1:啟用FileBrowser:
開啟fckeditor/editor/filemanager/connectors/php/config.php(這裡對中文支援不好,大可要自行對中文名進行處理)

啟用檔案上傳:

找到:
$Config['Enabled'] = false

改成:
$Config['Enabled'] = true

設定上傳存放目錄:

找到:
$Config['UserFilesPath'] = '/userfiles/'
改成:
$Config['UserFilesPath'] = '你自己的項目路徑'


2:啟用QuickUpload
開啟fckeditor/editor/filemanager/upload/php/config.php
啟用檔案上傳:

找到:
$Config['Enabled'] = false
改成:
$Config['Enabled'] = true


設定上傳存放目錄:

找到:
$Config['UserFilesPath'] = '/userfiles/'
改成:
$Config['UserFilesPath'] = '你自己的項目路徑'

測試


將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

好了,這樣我們的php配置Fckeditor教程就到這裡了,上面講到了如果上傳中文名字會亂碼的問題,大家可在本站搜尋,有相關解決方案。

http://www.bkjia.com/PHPjc/631623.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/631623.htmlTechArticlefckeditor編輯器是一個支援多語多的網頁線上編輯器,他可以支援asp,asp.net,jsp,php等,但是它預設的不是php而是asp哦,下面我們來看看如何在...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.