• 展开微博窗口
  • QQ:52619941
  • 微信:cnmemory
  • 展开分类目录
  • 还没有账号?

Memory

将Ecshop后台fckeditor升级更改为kindeditor 4.1.10编辑器

第一步:下载kindeditor,下载地址为:http://www.kindsoft.net/down.php 下载最新版本的,现在是4.1.10
下载之后,把里面不要的语言和演示文件删除,有,asp、asp.net jsp和examples四个文件夹删掉。

把文件夹改名为:kindeditor,然后上传到根目录includes/下面,和fckeditor同一级就是了。以后可以把fckeditor删除了。

第二步:修改admin/includes/lib_main.php把里面的create_html_editor方法修改为创建kindeditor的内容:
直接替换就ok了:

function  create_html_editor ($input_name, $input_value = '')
{
global $smarty;
$kindeditor="<script charset='utf-8' src='../includes/kindeditor/kindeditor-min.js'></script>
<script>
var editor;
KindEditor.ready(function(K) {
editor = K.create('textarea[name=\"$input_name\"]', {
allowFileManager : true,
width : '700px',
height: '300px',
resizeType: 0   //固定宽高
});
});
</script>
<textarea id=\"$input_name\" name=\"$input_name\" style='width:700px;height:300px;'>$input_value</textarea>
";

$smarty->assign('FCKeditor', $kindeditor);  //这里前面的 FCKEditor 不要变
}

第三步:修改文件上传路径

修改kindeditor/php目录下面的upload_json.php里面的
//文件保存目录路径
$save_path = $php_path . '../../../images/upload/';
//文件保存目录URL
$save_url = $php_url . '../../../images/upload/';

kindeditor默认上传图片的路径是upload下面的image目录下面,以年月日为目录,如:image/20130401 我们把它修改为:以年月划分比较好。
在upload_json.php找到$ymd = date("Ymd"); 改为:$ymd = date("Ym");就可以了。

第四步:浏览服务器路径修改
修改includes/kindeditor/php/file_manager_json.php

//根目录路径,可以指定绝对路径,比如 /var/www/attached/
$root_path = $php_path . '../../../images/upload/';
//根目录URL,可以指定绝对路径,比如 http://www.yoursite.com/attached/
$root_url = $php_url . '../../../images/upload/';

第五步:注释掉goods.php和article.php文件中关于fckeditor的路径
注释掉goods.php 文件的第107行

//    include_once(ROOT_PATH . 'includes/fckeditor/fckeditor.php'); // 包含 html editor 类文件


注释掉article .php 文件的第19行

 

//    require_once(ROOT_PATH . "includes/fckeditor/fckeditor.php");
码字很辛苦,转载请注明来自雨林寒舍《将Ecshop后台fckeditor升级更改为kindeditor 4.1.10编辑器》

评论

  1. 一个程序猿 #1

    网站不错!

    回复
    2016-01-31
  2. 一个程序猿 #2

    一舍友打游戏,一女生找他聊天,他说:“我要打游戏没空。”哥笑了,说:屌丝活该单身一辈子。可是过了一会儿,男的找他聊,他立马退了游戏聊天。哥笑不出来了,突然觉得宿舍不安全了。 一个程序员社区 http://www.1024xyz.com

    回复
    2016-01-31
  3. puz_zle #3

    有意思

    回复
    2015-06-13
  4. puz_zle #4

    哈哈哈

    回复
    2015-06-13
  5. 99 #5

    阿萨德发生地方

    回复
    2014-12-27
  6. 阿龙 #6

    sdf

    回复
    2014-12-27
  7. 99 #7

    回复
    2014-12-26
  8. 11 #8

    321321

    回复
    2014-12-26