zoukankan      html  css  js  c++  java
  • ecshop 整合 kindedotor

    网上的资料很多 自己记录下 以供使用

    1.上传kiededotor 到 include 目录下

    2.修改 /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();*/
        
    $kindeditor = <<<EOT
    
    <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 : '100%',
                        height: '300px',
                        resizeType: 0   //固定宽高
                    });
                });
        </script>
        <textarea id="$input_name" name="$input_name" style='700px;height:300px;'>$input_value</textarea>
    EOT;
        
    
        
        $smarty->assign('FCKeditor', $kindeditor);
    }

    3.修改 \includes\kindeditor\php\   file_manager_json.php  和upload_json.php  文件 保证图片 浏览上传等功能

    file_manager_json.php 头部文件

    require_once 'JSON.php';
    
    $php_path = dirname(__FILE__) . '/';
    $php_url = dirname($_SERVER['PHP_SELF']) . '/';
    
    //根目录路径,可以指定绝对路径,比如 /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/';
    //图片扩展名
    $ext_arr = array('gif', 'jpg', 'jpeg', 'png', 'bmp');

    upload_json.php

    define('IN_ECS', true);
    require_once 'JSON.php';
    require_once 'http://www.cnblogs.com/init.php';
    
    $php_path = dirname(__FILE__) . '/';
    $php_url = dirname($_SERVER['PHP_SELF']) . '/';

    $file_url = $save_url . $new_file_name; 下面添加

    //判断并给符合条件图片加上水印
        if ($file_ext == 'jpg' || $file_ext == 'jpeg' || $file_ext == 'png' || $file_ext == 'gif' || $file_ext == 'bmp' )
        {
            require_once(ROOT_PATH . '/includes/cls_image.php');
            $image = new cls_image($GLOBALS['_CFG']['bgcolor']);
        
            if (intval($GLOBALS['_CFG']['watermark_place']) > 0 && !empty($GLOBALS['_CFG']['watermark']))
            {
            
                $image->add_watermark($file_path,'','http://www.cnblogs.com/'.$GLOBALS['_CFG']['watermark'], $GLOBALS['_CFG']['watermark_place'], $GLOBALS['_CFG']['watermark_alpha']);
            }
        }
  • 相关阅读:
    开源文档管理系统LogicalDOC测试报告---安装篇
    QualityCenter的备份
    hudson任务配置说明
    windows server 2003断开远程之后自动注销用户
    使用javaservice 将jboss 注册为服务
    mysql主从同步配置(windows环境)
    更改MYSQL数据库不区分大小写表名
    MySQL的mysqldump工具的基本用法
    MySql中delimiter的作用是什么?
    Ubuntu安装配置Mysql
  • 原文地址:https://www.cnblogs.com/yxbs/p/2889922.html
Copyright © 2011-2022 走看看