ecshop将编辑器更换为kindeditor

由于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.大功告成


转载于:https://my.oschina.net/moore0903/blog/264803

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值