A-A+
dedecms5.7整合百度编辑器UEditor1.4.3版本插件
首先下载对应的版本百度编辑器,我用的GBK版本的。
http://pan.baidu.com/s/1eQXik9s
然后找到网站目录中的如下文件:
/include/inc/inc_fun_funAdmin.php
在其中添加如下代码,总共两个,愿意用哪个就用哪个,本人用第一个,第二个注释了。如果你用的是UTF-8就把下面的改为UTF-8呦。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | else if($GLOBALS['cfg_html_editor']=='ueditor') { $fvalue = $fvalue=='' ? '<p></p>' : $fvalue; $code = '<script type="text/javascript" charset="GBK" src="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/ueditor.config.js"></script>'; $code .= '<script type="text/javascript" charset="GBK" src="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/ueditor.all.min.js"></script>'; $code .= '<link rel="stylesheet" type="text/css" href="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/themes/default/css/ueditor.css"/>'; //$code .= '<textarea name="'.$fname.'" id="'.$fname.'" style="width:100%;">'.$fvalue.'</textarea>'; $code .= '<script type="text/plain" name="'.$fname.'" id="'.$fname.'">'.$fvalue.'</script>'; if( !empty($toolbar[$etype])) { $code .= '<script type="text/javascript">UE.getEditor("'.$fname.'",{toolbars:[["Source","|", "bold", "italic", "underline","|","fontsize","forecolor","emotion","Undo", "Redo"]],initialFrameHeight:100});</script>'; } else { $code .= '<script type="text/javascript">UE.getEditor("'.$fname.'",{initialFrameHeight:450});</script>'; } if($gtype=="print") { echo $code; } else { return $code; } } /* else if($GLOBALS['cfg_html_editor']=='ueditor') { $fvalue = $fvalue=='' ? '<p></p>' : $fvalue; $code = '<script type="text/javascript" charset="GBK" src="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/ueditor.config.js"></script> <script type="text/javascript" charset="GBK" src="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/ueditor.all.js"></script> <link rel="stylesheet" type="text/css" href="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/themes/default/css/ueditor.css"/> <textarea name="'.$fname.'" id="'.$fname.'" style="width:90%;">'.$fvalue.'</textarea> <script type="text/javascript">var ue = new baidu.editor.ui.Editor();ue.render("'.$fname.'");</script>'; if($gtype=="print") { echo $code; } else { return $code; } } */ |
第三步:修改配置
进入网站后台-->系统-->系统基本参数-->核心设置-->将 Html编辑器的值改为 ueditor ,然后保存。 到了这一步,那么恭喜你,文本编辑器已经替换成功!
使用小技巧:
使用百度编辑器栏目设置里面的栏目内容无法保存的解决方法:
这里需要修改下在栏目内容编辑时候使用默认ckeditor就可以了:
找到文件位置:/dede/templates/catalog_edit.htm和/dede/templates/catalog_add.htm
在里面查找:
GetEditor("content","","450","Default","print","false");
在其上面插入如下代码即可:
$GLOBALS['cfg_html_editor']='ckeditor';
布施恩德可便相知重
微信扫一扫打赏
支付宝扫一扫打赏