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='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.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
posted on 2013-02-16 11:14 ECshop商城二次开发博客 阅读(2664) 评论(1) 编辑 收藏 举报