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

注意:

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

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

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

将ckedit文件夹放置在/sites/all/modules/下,
将CKeditor文件夹放置在/sites/all/modules/ckeditor/ckeditor文件夹下,
将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

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

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

编辑ckfinder文件夹下的config.php

注释掉这个函数 

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的桥

原文地址:https://www.cnblogs.com/suihui/p/4346194.html