国外设计欣赏网站 - DOOOOR.com

 找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,微信登陆

搜索

[Drupal教程] Drupal 7.X 配置ckeditor和ckfinder编辑器实现图片上传--不用wysisyg

[复制链接]
发表于 2-18-2012 07:23 | 显示全部楼层 |阅读模式
注意:
1、这里的ckeditor编辑器是独立模块,不是那个wysiwyg模块。
2、这里的图片上传仅仅为文章内图片,非字段图片。
方法:
1、下载文件
(1)  http://drupal.org/project/ckeditor drupal的ckeditor模块.
8 [6 o: `8 y7 e7 _  D: \(2)  http://ckeditor.com/download CKeditor源码% `5 K$ }; F$ L2 @, }
(3)  http://ckfinder.com/download CKfinder(注意,不是免费的)
然后将(1)ckedit文件夹放置在/sites/all/modules/下,将(2)CKeditor文件夹放置在/sites/all/modules/ckeditor/ckeditor文件夹下,将(3)CKfinder文件夹放置在/sites/all/modules/ckeditor/文件夹下。
/sites/all/modules/ckeditor.api.php/sites/all/modules/ckeditor/ckeditor/ckeditor/ckeditor.php/sites/all/modules/ckeditor/ckfinder/ckfinder.php
2、安装模块
3、配置模块,/admin/config/content/ckeditor
" |7 @! O* ?' s. u% C6 [主要说明为什么个人喜欢用这个模块而不是wysiwyg,因为可以方便配置DrupalBreak, DrupalPageBreak,LinkToNode等按钮。
  A4 X* K. z7 }5 y; D  e- ^, y" c0 c其他根据个人情况自己定义。
4、配置CKfinder实现图片及文件上传! v8 X! W$ ?% O% W
在配置中的File browser settings选项中 File browser type及以下两项选择CKfinder。
编辑ckfinder文件夹下的config.php
注释掉这个函数 //
function CheckAuthentication(){        return false;}
这个函数会检查用户认证,在其他程序设计中更改为其他认证方式以返回true,但不能直接改成true,否则会有安全问题,drupal中会有$ T& y; c& l" C4 E  Z" b
/sites/all/modules/ckeditor/includes/filemanager.config.php负责检查。
增加以下代码,路径是正确的,如果文件路径和我的一样的话
require_once '../../../../includes/filemanager.config.php';
修改$baseUrl为自己为drupal的文件上传目录通常为:
$baseUrl = '/sites/boofee.net/files/';
打开/site/youdomain/settings.php,更改$cookie_domain为你自己的域名
$cookie_domain = 'www.boofee.net';
就可以正常上传图片及文件(超链接)了,注意显示图片的话需要文本格式Full HTML mode。

) d/ d  l4 K6 u* ?3 Y) ]: {
本文选自Boofee,谢谢!
3 t, S) R# y/ P* O$ Z/ Y: q
0 v# N, N3 H7 Z% p. l

, M' |# N) ^+ R7 Z' O9 E

|2011-2026-版权声明|平台(网站)公约|DOOOOR 设计网 ( 吉ICP备2022003869号 )

GMT+8, 2-12-2025 23:08 , Processed in 2.039225 second(s), 175 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表