phpcms整合KindEditor编辑器
文章描述:
phpcms整合KindEditor编辑器
KindEditor
官网:http://kindeditor.net/
1、打开phpcms/libs/classes/form.class.php
查找以下代码,大约在19行
$str = '<script type="text/javascript" src="'.JS_PATH.'ckeditor/ckeditor.js"></script>';
define('EDITOR_INIT', 1);
替换
$str .= '<script charset="utf-8" type="text/javascript" src="'.JS_PATH.'kindeditor/kindeditor-all.js"></script>';
$str .= '<script charset="utf-8" type="text/javascript" src="'.JS_PATH.'kindeditor/kindeditor-all-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:'440px;'";
$str .= "});";
$str .= "});";
$str .= '</script>';
2、打开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/';
替换:
//根目录路径,可以指定绝对路径,比如 /var/www/attached/
$root_path = $php_path . '../../../../uploadfile/';
//根目录URL,可以指定绝对路径,比如 http://www.yoursite.com/attached/
$root_url = $php_url . '../../../../uploadfile/';
3、打开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/';
发布时间:2021/07/01
发表评论