Drupal 7 配置ckeditor和ckfinder编辑器实现图片上传--不用wysisyg

注意:php

一、这里的ckeditor编辑器是独立模块,不是那个wysiwyg模块。
二、这里的图片上传仅仅为文章内图片,非字段图片。
 

一、下载文件
(1) http://drupal.org/project/ckeditor drupal的ckeditor模块
(2) http://ckeditor.com/download CKeditor源码
(3) http://ckfinder.com/download CKfinder(注意,不是免费的)api

(4)http://www.drupal.org/project/transliteration (可选,上传图片重命名)安全

将ckedit文件夹放置在/sites/all/modules/下,
将CKeditor文件夹放置在/sites/all/modules/ckeditor/ckeditor文件夹下,
将CKfinder文件夹放置在/sites/all/modules/ckeditor/文件夹下。cookie

正确路径为:dom

/sites/all/modules/ckeditor.api.php
/sites/all/modules/ckeditor/ckeditor/ckeditor/ckeditor.php
/sites/all/modules/ckeditor/ckfinder/ckfinder.php

二、安装模块编辑器

三、配置模块,/admin/config/content/ckeditor函数

四、配置CKfinder实现图片及文件上传ui

在配置中的File browser settings选项中 File browser type及如下两项选择CKfinder。url

编辑ckfinder文件夹下的config.phpspa

注释掉这个函数 

function CheckAuthentication(){        return false;}

这个函数会检查用户认证,在其余程序设计中更改成其余认证方式以返回true,但不能直接改为true,不然会有安全问题,drupal中会有
/sites/all/modules/ckeditor/includes/filemanager.config.php负责检查。

增长如下代码,路径是正确的,若是文件路径和个人同样的话

require_once '../../../../includes/filemanager.config.php';

注释

//$baseUrl = '/ckfinder/userfiles/';

 

5.配置/site/youdomain/settings.php文件

设置$baser_url
$base_url='http://localhst/drupal71';
设置$cookie_domain:
$cookie_domain='http://localhst/drupal71';

就能够正常上传图片及文件(超连接)了,注意显示图片的话须要文本格式Full HTML mode。

 

如今的解决方法是:上传用 IMCE

https://www.drupal.org/project/IMCE

#######################################

另一种编辑器安装方法

安装

wysiwyg      https://www.drupal.org/project/wysiwyg  //一种整合编辑器的方式,下载 ckeditor 版本要低于4.0

IMCE        https://www.drupal.org/project/imce  //图片上传,在wysiwyg 配置文件里面改

imce_wysiwyg    https://www.drupal.org/project/imce_wysiwyg // 安装imce的桥

相关文章
相关标签/搜索