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

相關文章
相關標籤/搜索