详情页

ECSHOP默认编辑器换成实用的KindEditor编辑器

时间:2024年01月31日

编辑:佚名

网站下载最新版kindeditor-4.1.5.zip  
kindeditor文档:http://kindeditor.net/doc.php
demo演示http://kindeditor.net/demo.php
KindEditor 4.1.11 (2016-03-31) [1143KB]:http://kindeditor.net/down.php
kindeditor-4.1.5备份下载
链接: https://pan.baidu.com/s/1Qd0CmeupzpzEyEIgDmLdzQ 提取码: 8f7r
文件: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\"]', {
                    allowFileManager : true,
                    width : '700px',
                    height: '300px',
                    resizeType: 0   //固定宽高
                });
            });
    </script>
    <textarea id=\"$input_name\" name=\"$input_name\" style='width:700px;height:300px;'>$input_value</textarea>
 <input type=\"submit\" value=\"提交\" />
    ";
    $smarty->assign('FCKeditor', $kindeditor);
}
复制代码
然后修改kindeditro/php/
上传目录修改includes/kindeditor/php/upload_json.php如下:
//文件保存目录路径
$save_path = $php_path . 'http://www.78moban.com/../images/upload/';
//文件保存目录URL
$save_url = $php_url . 'http://www.78moban.com/../images/upload/';
浏览服务器路径修改includes/kindeditor/php/file_manager_json.php如下:
//根目录路径,可以指定绝对路径,比如 /var/www/attached/
$root_path = $php_path . 'http://www.78moban.com/../images/upload/';
//根目录URL,可以指定绝对路径,比如 http://www.yoursite.com/attached/
$root_url = $php_url . 'http://www.78moban.com/../images/upload/';
PS:如果ECshop程序是GBK的话,就会出来乱码。
相关文章
猜你需要