ติดตั้ง ckeditor และ ckfinder ใน drupal
จากคราวที่แล้วผมได้ทำการสอนการติดตั้ง ckeditor ไปแล้วซึ่งมันต้องติดตั้งผ่าน wysiwyg module อีกทีและยังไม่สามารถทำการ browse รูปภาพจากเครื่องเราเข้า server ได้
มาคราวนี้ผมจะแนะนำใหม่อีกสักรอบเพราะให้เราใช้งาน ckeditor ได้อย่างสมบูรณ์แบบโดยเราจะใช้งานร่วมกับ ckfinder ในการ browse รูปภาพกันครับ
ขั้นตอนการติดตั้ง
1. โหลด module ckeditor มาก่อน http://drupal.org/project/ckeditor
2. โหลด ckeditor มา http://ckeditor.com/download
3. โหลด ckfinder มา http://ckfinder.com/download
4. จากนั้นทำการติดตั้ง module ckeditor จากข้อ 1. ก่อนครับลงใน drupal ของเรา
5. แตกไฟล์ ckeditor ที่ได้มากจากข้อ 2. ลงในตัว module ckeditor โดยไว้ที่ modules/ckeditor/ckeditor ซึ่งไฟล์ข้างในจะมีบอกว่า COPY_HERE.txt

6. แตกไฟล์ ckfinder ในข้อ 3. ลงใน modules/ckeditor/

7. ทำการแก้ไขไฟล์ modules/ckeditor/ckfinder/config.php แล้วลบโค็ดด้านล่างออก
function CheckAuthentication()
{
// WARNING : DO NOT simply return "true". By doing so, you are allowing
// "anyone" to upload and list the files in your server. You must implement
// some kind of session validation here. Even something very simple as...
// return isset($_SESSION['IsAuthorized']) && $_SESSION['IsAuthorized'];
// ... where $_SESSION['IsAuthorized'] is set to "true" as soon as the
// user logs in your system.
// To be able to use session variables don't forget to add session_start().
return false;
}
จากนั้นหา
$baseUrl = '/ckfinder/userfiles/';
แก้ให้เป็นตาม path ของ server ที่ใช้งายจริงเช่น
$baseUrl = '/var/www/html/sites/default/module/ckeditor/ckfinder/userfiles/';
และเพิ่ม
require_once '../../../../includes/filemanager.config.php';
ในบรรทัดถัดไปจาก
$baseDir = resolveUrl($baseUrl);
เสร็จแล้วทำการบันทึกครับ modules/ckeditor/ckfinder/config.php
8. ต่อมาให้ทำการแก้ไขไฟล์ sites/default/settings.php โดยเอา # ออกและใส่ url เว็บไซต์เราลงไป
$cookie_domain = 'www.drupal.com';
9. เปิดการใช้งาน module

10. จากนั้นไปที่ User management > Permissions เปิดสิทธิ์การใช้งาน upload

11. จากนั้นไปการตั้งค่า Ckeditor ทำการแก้ไข profile และดูในส่วนของ File browser settings ให้เราเลือก File browser type เป็น Ckfinder

12. เพียงเท่านี้ ckeditor เราก็สามารถใช้งาน browse รูปได้แล้วครับ

thank : snappytux.com
บทความแนะนำ
