使用kindeditor来替换ecshop的fckeditor编辑器,让ecshop可以批量上传图片

ecshop一直使用的编辑器是fck,这个不用多说,相信很多朋友用的很悲剧吧,特别是图片不能批量上传图片。
今天小编就分享一下怎么换掉fck,放上实用的kindeditor,最新ecshop版本的哦。方法如下:

步骤一:进入kindeditor的官网,http://kindeditor.net/index.php下载最新的编辑器版本,将文件上传到网站includes/目录下,注意,不要有多余的目录,要可以访问到includes/kindeditor/kindeditor-min.js

步骤二:

1、修改admin/includes/lib_main.php

function create_html_editor($input_name, $input_value = '')
{
    global $smarty;

    $editor = new FCKeditor($input_name);
    $editor->BasePath   = '../includes/fckeditor/';
    $editor->ToolbarSet = 'Normal';
    $editor->Width      = '100%';
    $editor->Height     = '320';
    $editor->Value      = $input_value;
    $FCKeditor = $editor->CreateHtml();
    $smarty->assign('FCKeditor', $FCKeditor);
}

替换为

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\"]', {//www.lyecs.com
                    allowFileManager : true,
                    width : '100%',
                    height: '300px',
                    resizeType: 0   //固定宽高
                });
            });
    </script>
    <textarea id=\"$input_name\" name=\"$input_name\" style='width:100%;height:300px;'>$input_value</textarea>
 <input type=\"submit\" value=\"提交\" />
    ";
    $smarty->assign('FCKeditor', $kindeditor);
}

2、找到

includes/kindeditor/php/upload_json.php

//文件保存目录路径
$save_path = $php_path . '../attached/';
//文件保存目录URL
$save_url = $php_url . '../attached/';

替换为

//文件保存目录路径www.lyecs.com老杨ecshop二次开发
$save_path = $php_path . '../../../images/upload/';
//文件保存目录URL
$save_url = $php_url . '../../../images/upload/';

3、includes/kindeditor/php/file_manager_json.php

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

改为:

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

3、找到admin/template/goods_info.htm

 <input type="button" value="{$lang.button_submit}" class="button" onclick="validate('{$goods.goods_id}')" />

修改为

<input type="submit" value="{$lang.button_submit}" class="button" onclick="validate('{$goods.goods_id}')" />

进后台刷新就可以了

如果上传图片发现没有文件权限,记得进服务器刷一遍777权限。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值