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

本文详细介绍如何在ECShop中将FCKEditor替换成KindEditor,包括下载安装KindEditor、修改PHP代码、调整文件上传路径等步骤,并提供解决商品页提交内容空白问题的方法。

ecshop在win8部分电脑上,不管用任何浏览器,都打不开,即使升级到最新版本都不行,问题应该吃在fckeditor兼容上。fckeditor 很久未升级,换掉该编辑器是最佳方法

第一步:下载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");
 
如果发现商品页出现提交内容为空白的时候,需要在提交时做一次同步,打开文件“\admin\templates\goods_info.htm,找 到”document.forms['theForm'].submit();“,大概在第508行,在这行代码前增加同步的js代码:
editor.sync();//同步编辑框的文字;
document.forms['theForm'].submit(); 
 
最后一步在admin/template/goods_info.htm中 将提交按钮
 
<input type=”button” value=”{$lang.button_submit}” on click=”validate(‘{$goods.goods_id}’)” />
 
修改为
 
<input type=”submit” value=”{$lang.button_submit}” on click=”validate(‘{$goods.goods_id}’)” />
 
ok,大功告成,在ecshop最新版本亲测正常使用。

ecshop编辑器fckeditor换百度ueditor编辑器教程

http://www.zuimoban.com/php/ecshop/1886.html

转载于:https://my.oschina.net/u/1260221/blog/421825

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值