發表文章

目前顯示的是 4月, 2017的文章

CI 使用ckeditor,ckfinder的替代品

圖片
ckeditor 免費使用的沒錯 但是如果要上傳圖片的話就需要另外掛載ckfinder來使用 然而ckfinder需要付費才能使用全部的功能 例如把上傳的圖片刪除就需要付費才有辦法使用 而且要根據使用者來自定義資料夾的話ckfinder實現起來頗複雜(在網路上找了很久都看不懂) 後來找到了這一款 "Filemanager" https://github.com/simogeo/Filemanager 這一款不輸ckfinder,重點是免費使用 把這兩個ckeditor 和 Filemanager 下載下來後放到想放的assets裡 再來就參考這一篇 https://github.com/moemoe89/codeigniter-ckeditor-filemanager STEP1 去找 CI的 index.php 檔案 把 $application_folder = 'application'; 改成 $application_folder = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'application'; 把 $system_path = 'system'; 改成 $system_path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'system'; STEP2 找到filemanager資料夾裡面的scripts裡的  filemanager.config.js.default  這個檔案 複製一份把檔名的.default去掉 STEP3 再來到filemanager -> connnectors -> php 找到這個檔案   default.config.php 在裡面任意處加上 ob_start(); include('../../../../index.php'); ob_end_clean(); $CI =& get_instance(); $CI->load->driver('session');