ecshop将编辑器更换为kindeditor

来源:互联网 发布:h3c数据中心网络认证 编辑:程序博客网 时间:2024/05/24 07:21

由于ecshop原版fckeditor编辑器过于陈旧,就有想法要更新编辑器,最开始想到的是ueditor,但是最后无法获取编辑器内的值,最后放弃.然后就转至kindeditor.

方法也是在网上搜索到的,并测试正常.但是最后就找不到原作者是谁.

具体的步骤如下:

1.下载kindeditor.

2.解压到includes文件夹下.

3.删除无用文件夹.asp/asp.net/jsp/examples 

4.admin\goods.php  416行左右  

create_html_editor('goods_desc', $goods['goods_desc']);  
 这个调用方法注释.   加入  

$FCKeditor = create_html_kindeditor('goods_desc', $goods['goods_desc'], 'theForm');    $smarty->assign('FCKeditor',    $FCKeditor);

5.admin\includes\lib_main.php

加入

function create_html_kindeditor($input_name, $input_value = '', $form_name = ''){    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>    ";    return $kindeditor;}

6.admin\templates\good_info.htm

大约429行  提交按钮  type更换才submit

7.大功告成

0 0