zoukankan      html  css  js  c++  java
  • ECSHOP默认编辑器换成实用的KindEditor编辑器

    官网下载最新版kindeditor-4.1.5.zip  http://www.kindsoft.net/down.php

    文件: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='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.cnblogs.com/../images/upload/';
    //文件保存目录URL
    $save_url = $php_url . 'http://www.cnblogs.com/../images/upload/';


    浏览服务器路径修改includes/kindeditor/php/file_manager_json.php如下:

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

    PS:如果ECshop程序是GBK的话,就会出来乱码。

    ------------------------------------------华丽丽的分割线--------------------- ------------------------------------

    源厂制造10-10000级洁净无尘车间防静电防尘用品!网址:http://www.lgfjd.com 微信号:614412
  • 相关阅读:
    x01.Weiqi.6: 立体棋子
    x01.Game.MapEditor: 地图编辑器
    SQL Server插入中文出现乱码??的解决办法
    Cachecontrol使用:header('Cachecontrol:private')
    验证身份证号码Javascript代码
    .Net GDI+缩放绘图
    Access(JETSQL)问题集锦
    Android开发中Google谷歌地图坐标系怎么转Baidu百度地图坐标系
    21、桥接模式(Bridge模式)详解
    22、装饰模式(装饰设计模式)详解
  • 原文地址:https://www.cnblogs.com/wangblognet/p/2913223.html
Copyright © 2011-2022 走看看