1、打开admin/includes/lib_main.php文件
找到:(大约在306-323行左右)
/** * 生成编辑器 * @param string input_name 输入框名称 * @param string input_value 输入框值 */ 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); }
将这段代码修改为:
/** * 生成编辑器 * @param string input_name 输入框名称 * @param string input_value 输入框值 */ function create_html_editor($input_name, $input_value = ‘‘) { global $smarty; /* mod by wengwenjin 百度编辑器 begin */ $HTML=‘ <script type="text/javascript" charset="utf-8" src="../includes/ueditor/ueditor.config.js"></script> <script type="text/javascript" charset="utf-8" src="../includes/ueditor/ueditor.all.js"></script> <textarea name="‘.$input_name.‘" id="‘.$input_name.‘" style="width:100%;">‘.$input_value.‘</textarea> <script type="text/javascript"> UE.getEditor("‘.$input_name.‘",{ theme:"default", //皮肤 lang:"zh-cn", //语言 initialFrameWidth:680, //初始化编辑器宽度,默认650 initialFrameHeight:180 //初始化编辑器高度,默认180 }); </script>‘; $smarty->assign(‘FCKeditor‘, $HTML); /* mod by wengwenjin 百度编辑器 end */ }
2、把admin/js/jquery.js,admin/js/jquery.json.js,admin/js/selectzone_bd.js,admin/js/transport_bd.js复制到你网站相应的目录下
3、复制一份admin/templates/pageheader.htm,将他命名为pageheader_bd.htm文件,然后打开这个文件
找到:
{insert_scripts files="../js/transport.js,common.js"}
将这段代码修改为:
<!-- mod by wengwenjin 百度编辑器 begin --> {insert_scripts files="jquery.js,jquery.json.js,transport_bd.js,common.js"} <!-- mod by wengwenjin 百度编辑器 end -->
4、打开admin/templates/article_info.htm文件
找到:
{include file="pageheader.htm"} {insert_scripts files="../js/utils.js,selectzone.js,validator.js"}
将这段代码修改为:
<!-- mod by wengwenjin 百度编辑器 begin --> {include file="pageheader_bd.htm"} {insert_scripts files="../js/utils.js,selectzone_bd.js,validator.js"} <!-- mod by wengwenjin 百度编辑器 end -->
5、打开admin/templates/goods_info.htm文件
找到:
{include file="pageheader.htm"} {insert_scripts files="../js/utils.js,selectzone.js,colorselector.js"}
将这段代码修改为:
<!-- mod by wengwenjin 百度编辑器 begin --> {include file="pageheader_bd.htm"} {insert_scripts files="../js/utils.js,selectzone_bd.js,colorselector.js"} <!-- mod by wengwenjin 百度编辑器 end -->
6、打开admin/templates/topic_edit.htm文件
找到:
{include file="pageheader.htm"} {insert_scripts files="../js/utils.js,selectzone.js,colorselector_topic.js"}
将这段代码修改为:
<!-- mod by wengwenjin 百度编辑器 begin --> {include file="pageheader_bd.htm"} {insert_scripts files="../js/utils.js,selectzone_bd.js,colorselector_topic.js"} <!-- mod by wengwenjin 百度编辑器 end -->
7、打开admin/article.php文件
(1)找到:(大约在20行左右)
require_once(ROOT_PATH . "includes/fckeditor/fckeditor.php");
这段代码修改为:
/* mod by wengwenjin 百度编辑器 begin */ //require_once(ROOT_PATH . "includes/fckeditor/fckeditor.php"); /* mod by wengwenjin 百度编辑器 end */
(2)找到:(大约在207行左右)
create_html_editor(‘FCKeditor1‘,$article[‘content‘]);
将这段代码修改为:
create_html_editor(‘FCKeditor1‘,htmlspecialchars($article[‘content‘])); /* mod by wengwenjin 百度编辑器 */
8、打开admin/goods.php文件
(1)找到:(大约在107行左右)
include_once(ROOT_PATH . ‘includes/fckeditor/fckeditor.php‘); // 包含 html editor 类文件
将这段代码修改为:
/* mod by wengwenjin 百度编辑器 begin */ //include_once(ROOT_PATH . ‘includes/fckeditor/fckeditor.php‘); // 包含 html editor 类文件 /* mod by wengwenjin 百度编辑器 end */
(2)找到:(大约在414行左右)
create_html_editor(‘goods_desc‘, $goods[‘goods_desc‘]);
将这段代码修改为:
create_html_editor(‘goods_desc‘, htmlspecialchars($goods[‘goods_desc‘])); /* mod by wengwenjin 百度编辑器 */
9、打开admin/magazine_list.php文件
(1)找到:(大约在61行左右,第一次出现的地方)
include_once(ROOT_PATH.‘includes/fckeditor/fckeditor.php‘); // 包含 html editor 类文件
将这段代码修改为:
/* mod by wengwenjin 百度编辑器 begin */ //include_once(ROOT_PATH.‘includes/fckeditor/fckeditor.php‘); // 包含 html editor 类文件 /* mod by wengwenjin 百度编辑器 end */
(2)找到:(大约在83行左右,第二次出现的地方)
include_once(ROOT_PATH.‘includes/fckeditor/fckeditor.php‘); // 包含 html editor 类文件
将这段代码修改为:
/* mod by wengwenjin 百度编辑器 begin */ //include_once(ROOT_PATH.‘includes/fckeditor/fckeditor.php‘); // 包含 html editor 类文件 /* mod by wengwenjin 百度编辑器 end */
(3)找到:(大约在91行左右)
create_html_editor(‘magazine_content‘, $rt[‘template_content‘]);
将这段代码修改为:
create_html_editor(‘magazine_content‘, htmlspecialchars($rt[‘template_content‘])); /* mod by wengwenjin 百度编辑器 */
10、打开admin/topic.php文件
(1)找到:(大约在75行左右)
include_once(ROOT_PATH.‘includes/fckeditor/fckeditor.php‘); // 包含 html editor 类文件
将这段代码修改为:
/* mod by wengwenjin 百度编辑器 begin */ //include_once(ROOT_PATH.‘includes/fckeditor/fckeditor.php‘); // 包含 html editor 类文件 /* mod by wengwenjin 百度编辑器 end */
(2)找到:(大约在102行左右)
create_html_editor(‘topic_intro‘, $topic[‘intro‘]);
将这段代码修改为:
create_html_editor(‘topic_intro‘, htmlspecialchars($topic[‘intro‘])); /* mod by wengwenjin 百度编辑器 */
11、把整个ueditor文件夹复制到您网站根目录下includes文件夹里面
链接: http://pan.baidu.com/s/1kT7j3TX 密码: nu4i