帝国默认编辑器确实非常难用,今天开拓族做了一个好代码教程用最简单的方法来替换默认编辑器的方法!
同时支持前台投稿和后台发布!
效果演示
下载百度编辑器ueditor,将ueditor解压到后上传到帝国的插件目录里即:(/e/extend/)
下载地址:百度编辑器UEditor 1.4.3 UTF-8下载下载地址:百度编辑器UEditor 1.4.3 GBK下载
位置:后台>系统》数据表与系统模型>管理数据表,找到你要使用编辑器的数据表。
然后给需要更换编辑器的字段替换代码:下面截图是文章模型的新闻正文字段newstext,
替换这两个表单的代码为以下代码.TXT里的代码:
OK了 大功告成!
注意:如果改了后台目录请更改\ueditor\ueditor.toolbarconfig.js这个文件内admin为你的登录路径
window.open('/e/admin/ecmseditor/FileMain.php?type=1&classid='+classid+'&infoid='+infoid+'&filepass='+filepass+'&sinfo=1&doing=1'+ehash,'','width=700,height=550,scrollbars=yes');
tips:如果不想用了想还原回帝国CMS默认编辑器,只需要在输入表单替换html代码这里填入下面的代码:
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 | <?=ECMS_ShowEditorVar( "newstext" , $ecmsfirstpost ==1? "" : stripSlashes ( $r [newstext]), "Default" , "" , "300" , "100%" )?> <table width= "100%" border= "0" cellpadding= "3" cellspacing= "1" bgcolor= "#DBEAF5" > <tr> <td bgcolor= "#FFFFFF" > <input name= "dokey" type= "checkbox" value= "1" <?= $r [dokey]==1? ' checked' : '' ?>> 关键字替换 <input name= "copyimg" type= "checkbox" id= "copyimg" value= "1" > 远程保存图片( <input name= "mark" type= "checkbox" id= "mark" value= "1" > <a rel= "nofollow noopener noreferrer" href= "SetEnews.php?<?=$ecms_hashur[ehref]?>&" target= "_blank" >加水印</a>) <input name= "copyflash" type= "checkbox" id= "copyflash" value= "1" > 远程保存FLASH(地址前缀: <input name= "qz_url" type= "text" id= "qz_url" size= "" > )</td> </tr> <tr> <td bgcolor= "#FFFFFF" ><input name= "repimgnexturl" type= "checkbox" id= "repimgnexturl" value= "1" > 图片链接转为下一页 <input name= "autopage" type= "checkbox" id= "autopage" value= "1" > 自动分页 ,每 <input name= "autosize" type= "text" id= "autosize" value= "5000" size= "5" > 个字节为一页 取第 <input name= "getfirsttitlepic" type= "text" id= "getfirsttitlepic" value= "" size= "1" > 张上传图为标题图片( <input name= "getfirsttitlespic" type= "checkbox" id= "getfirsttitlespic" value= "1" > 缩略图: 宽 <input name= "getfirsttitlespicw" type= "text" id= "getfirsttitlespicw" size= "3" value= "<?=$public_r[spicwidth]?>" > *高 <input name= "getfirsttitlespich" type= "text" id= "getfirsttitlespich" size= "3" value= "<?=$public_r[spicheight]?>" > )</td> </tr> </table> |
投稿表单替换html代码如下:
1 | <?=ECMS_ShowEditorVar( "newstext" , $ecmsfirstpost ==1? "" :DoReqValue( $mid , 'newstext' , stripSlashes ( $r [newstext])), "Default" , "" , "300" , "100%" )?> |
以上就是帝国CMS修改默认编辑器为百度编辑器UEditor的方法。把疼爱都给你,把疼痛都给我。更多关于帝国CMS修改默认编辑器为百度编辑器UEditor的方法请关注haodaima.com其它相关文章!