Recently while studying phpcms, I found the default editor not very user-friendly. I personally don’t prefer CKEditor; I like the domestic lightweight KindEditor more. After researching, I decided to replace it. Tested successfully with local UTF-8, GBK not tested. Anyone interested can give it a try – the method is the same!
Let me show the effect!

Here are the specific steps:
First, download a new editor from the KindEditor official website, extract it, and rename the entire folder tokindeditor, then copy it to/statics/js/ directory;
Then modify/phpcms/libs/classes/form.class.php
Search for
- if(!defined('EDITOR_INIT')) {
If you haven’t modified this file before, it’s on line 18.
Replace
<script type="text/javascript" src="'.JS_PATH.'ckeditor/ckeditor.js"></script>'; define('EDITOR_INIT', 1);
with
- $str .= '<script charset=”utf-8″ type=”text/javascript” src=”'.JS_PATH.'kindeditor/kindeditor-min.js”></script>';
- $str .= '<script charset=”utf-8″ type=”text/javascript” src=”'.JS_PATH.'kindeditor/lang/zh_CN.js”></script>';
- define('EDITOR_INIT', 1);
- $str .= "<script type=/”text/javascript/”>/r/n”;
- $str .= “KindEditor.ready(function(K) {/r/n”;
- $str .= “editor = K.create('textarea[id=/”$textareaid/”]', {/r/n”;
- $str .= “allowFileManager : true,/r/n”;
- $str .= “width : '99%',”;
- $str .= “height : '400px'”;
- $str .= “});”;
- $str .= “});”;
- $str .= '</script>';
,,,KindEditor,,,!
:
/statics/js/kindeditor/php/file_manager_json.php
:
- //,, /var/www/attached/
- $root_path = $php_path . '../attached/';
- //URL,, http://www.yoursite.com/attached/
- $root_url = $php_url . '../attached/';
phpcms
- //,, /var/www/attached/
- $root_path = $php_path . '../../../../uploadfile/';
- //URL,, http://www.yoursite.com/attached/
- $root_url = $php_url . '../../../../uploadfile/';
/statics/js/kindeditor/php/upload_json.php
- //
- $save_path = $php_path . '../attached/';
- //URL
- $save_url = $php_url . '../attached/';
- //
:
- //
- $save_path = $php_path . '../../../../uploadfile/';
- //URL
- $save_url = $php_url . '../../../../uploadfile/';
- //
,,!!
/statics/css/zh-cn-system.css:
- .addContent{width:960px; margin:0 auto; overflow:hidden;}
:
- .addContent{width:99%; margin:0 auto; overflow:hidden;}
,,,,!
KindEditor,,
,,,,,,!!!
,,,!
2013-01-09:
2013-01-09 ,“”“”,,!!:
- href="/statics/js/kindeditor/plugins/runCode/runCode.css" rel="stylesheet" type="text/css" />
<script language=“javascript” type=“text/javascript” src=“/statics/js/kindeditor/plugins/runCode/zztuku_runCode.js”></script>
http://www.zztuku.com/Html/PHPcms/20121218_5127.html