說真的,FCKEditor和新版的CKEditor在整合CKFinder上真的有差異,而且還差異蠻大的。
整合動作1
修改 CKEditor的config.js,增加CKEditor要讀取檔案路徑的設定,這樣才能順利的讀Image(JPG,GIF,BMP,PNG)和Flash以及檔案。
整合動作2
修改CKFider的config.js
把相關的設定設定好,才能上傳檔案,對於相對路徑和絕對路徑的概念清楚一點比較好
整合動作3
沒有了,就是進到程式中去呼叫CKFinde和CKEditor,進行相關的設定。
CKEditor整合CKFinder在php中的宣告方式
$CKEditor = new CKEditor();
$CKEditor->returnOutput = true;
$CKEditor->basePath = ‘CKEditor的路徑’;
$CKEditor->config[‘width’] = 800;
$CKEditor->textareaAttributes = array(“cols” => 80, “rows” => 20);
CKFinder::SetupCKEditor( $CKEditor, ‘CKFinder的路徑’);
$initialValue = ‘<p>請在這邊輸入內容</p>’;
$code = $CKEditor->editor(“editor1”, $initialValue);
FCKEditor整合CKFinder在php中的宣告方式
$fckeditor = new FCKeditor( ‘FCKeditor1’ ) ;
$fckeditor->BasePath = ‘CKEditor的路徑’ ;
$fckeditor->Value = ‘<p>請在這邊輸入內容</p>’ ;
$fckeditor->Config[‘EnterMode’] = ‘br’;
$fckeditor->Width = ‘800’;
$fckeditor->Height = ‘600’;
CKFinder::SetupFCKeditor( $fckeditor, ”CKFinder的路徑’ ) ;
CKEditor和 FCKEditor程式撰寫上也是有差異的,宣告方式完全不同,而且差蠻多的,我看,我還要花很多時間來練習一下。因為文字輸入區的部份,已經變成文字區域了textarea了,與先前有所不同。
不過,這次使用CKEditor整合CKFinder比上次FCKEditor整合CKFinder時,省了很多的時間,官方文件說真的,給的不夠,很多人看不太懂範例,那要用這套文書編輯器,還是有一點門檻的。
隨機文章
- 使用WIRESHARK抓DHCP封包查亂發IP (2016-11-01)
- 山水牌(SANSUI)音響HD-878開箱實測 (2011-06-11)
- CodeIgniter 初階設定 (2012-05-27)
- I got the website stop message. Ubuntu Web-Server on Proxmox VE is crashed. (2021-02-20)
- 20171031 09:50 PTT 無法連線 (2017-10-31)