PHP群:95885625 Hbuilder+MUI群:81989597 站长QQ:634381967
    您现在的位置: 首页 > CMS教程 > ecshop教程 > 正文

    ecshop编辑器FCKeditor修改成KindEditor编辑

    作者:admin来源:网络浏览:时间:2020-09-30 00:07:50我要评论
    导读:ecshop自带的编辑器无法批量上传图片,今天教大家如何修改替换。1、官方网站下载最新版kindeditor现在最先版本的是:kindeditor4.1.4,官方...
    ecshop自带的编辑器无法批量上传图片,今天教大家如何修改替换。
    ecshop编辑器FCKeditor修改成KindEditor编辑
    1、官方网站下载最新版kindeditor
    现在最先版本的是:kindeditor4.1.4,官方网址:http://www.kindsoft.net
    2、上传解压
    上传下载的压缩文件到你的网站include目录下,解压kindeditor4.1.4,将其文件夹名称改为:kindeditor

    3、修改php文件
    (1)打开admin/includes/lib_main.php,查找 create_html_editor
    将以下内容:
    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\"]', {
                        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);
    }

    (2)修改kindeditor/php/
    上传目录修改includes/kindeditor/php/upload_json.php如下:
    //文件保存目录路径
    $save_path = $php_path . '../../../images/upload/';
    //文件保存目录URL
    $save_url = $php_url . '../../../images/upload/';
    浏览服务器路径修改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/';
    4、最后一步2.7.3版本的ecshop中在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}’)” />
    转载请注明(B5教程网)原文链接:https://b5.mxunkeji.com/content-104-2028-1.html
    相关热词搜索: