1. 前往kindeditor官网下载最新版的压缩包。此是官网地址:http://kindeditor.net。
2. 将将压缩包解压后重新命名为kindeditor,将解压的文件夹拷贝至安装根目录下的includes文件夹。
3. 打开 “admin/goods.php" 文件,大约在107行出的 include_once(ROOT.PATH . 'includes/fckeditor/fckeditor.php') 处注释或删除。
4.在"admin/goods.php"文件,大约在415处的 create_html_editor()方法注释或删除,在417行处左右添加 $FCKeditor = create_html_kindeditor('goods_desc', $goods['goods_desc'], 'theForm'); 和 $smarty->assign('FCKeditor', $FCKeditor);
5. 打开"includes/lib_main.php" 文件里找到function create_html_editor()方法,将function create_html_editor()方法注释或删除,替换成以下方法:
function create_html_kindeditor($input_name, $input_value = '', $form_name = '') {
global $smarty;
$kindeditor = "<script src='/includes/kindeditor/kindeditor-all-min.js' charset='utf-8'></script>
<script src='/includes/kindeditor/lang/zh_CN.js' charset='utf-8'></script>
<script src='/includes/kindeditor/plugins/code/prettify.js' charset='utf-8'></script>
<script>KindEditor.ready(function(K) {
var editor1 = K.create('textarea[name=".$input_name."]',
{ cssPath : '/includes/kindeditor/plugins/code/prettify.css',
uploadJson : '/includes/kindeditor/php/upload_json.php',
fileManagerJson : '/includes/kindeditor/php/file_manager_json.php',
afterBlur : function() {
this.sync();
K.ctrl(document, 13, function() {
K('form[name=" . $form_name . "]')[0].submit();
});
K.ctrl(this.edit.doc, 13, function() {
K('form[name=" . $form_name . "]')[0].submit();
}); } }); prettyPrint(); }); </script>
<textarea id=\"$input_name\" name=\"$input_name\" style='width:700px;height:300px;'>$input_value</textarea>"; return $kindeditor; }
萌新声明:以上内容并非原创,查找资料后再次整理。仅用于资料学习(侵删)。