帝国CMS修改默认编辑器为百度编辑器UEditor的方法

分类:二次开发教程 发布时间:2019-04-02 16:46:09

摘要:帝国CMS如何&怎样使用UEditor,整合UEditor的详细教程&方法,帝国CMS修改&替换默认编辑器为百度编辑器UEditor的方法,插件形式!改动量超少!

帝国默认编辑器确实非常难用,今天开拓族做了一个教程用最简单的方法来替换默认编辑器的方法!

同时支持前台投稿和后台发布!

效果演示

帝国CMS修改默认编辑器为百度编辑器UEditor的方法 第1张

下载百度编辑器ueditor,将ueditor解压到后上传到帝国的插件目录里即:(/e/extend/)

下载地址:百度编辑器UEditor 1.4.3 UTF-8下载
下载地址:百度编辑器UEditor 1.4.3 GBK下载

位置:后台>系统》数据表与系统模型>管理数据表,找到你要使用编辑器的数据表。

然后给需要更换编辑器的字段替换代码:下面截图是文章模型的新闻正文字段newstext,

帝国CMS修改默认编辑器为百度编辑器UEditor的方法 第2张

替换这两个表单的代码为以下代码.TXT里的代码:

替换newstext输入表单和投稿表单.txt
7caf8e18e4256948614faef82ecd45c4.txt (2.73 KB)

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. <?=ECMS_ShowEditorVar("newstext",$ecmsfirstpost==1?"":stripSlashes($r[newstext]),"Default","","300","100%")?>
  2. <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#DBEAF5">
  3. <tr> 
  4. <td bgcolor="#FFFFFF"> <input name="dokey" type="checkbox" value="1"<?=$r[dokey]==1?' checked':''?>>
  5. 关键字替换&nbsp;&nbsp; <input name="copyimg" type="checkbox" id="copyimg" value="1">
  6. 远程保存图片(
  7. <input name="mark" type="checkbox" id="mark" value="1">
  8. <a href="SetEnews.php?<?=$ecms_hashur[ehref]?>&" target="_blank">加水印</a>)&nbsp;&nbsp; 
  9. <input name="copyflash" type="checkbox" id="copyflash" value="1">
  10. 远程保存FLASH(地址前缀: 
  11. <input name="qz_url" type="text" id="qz_url" size="">
  12. )</td>
  13. </tr>
  14. <tr>
  15. <td bgcolor="#FFFFFF"><input name="repimgnexturl" type="checkbox" id="repimgnexturl" value="1"> 图片链接转为下一页&nbsp;&nbsp; <input name="autopage" type="checkbox" id="autopage" value="1"> 自动分页
  16. ,每 
  17. <input name="autosize" type="text" id="autosize" value="5000" size="5">
  18. 个字节为一页&nbsp;&nbsp; 取第 
  19. <input name="getfirsttitlepic" type="text" id="getfirsttitlepic" value="" size="1">
  20. 张上传图为标题图片( 
  21. <input name="getfirsttitlespic" type="checkbox" id="getfirsttitlespic" value="1">
  22. 缩略图: 宽 
  23. <input name="getfirsttitlespicw" type="text" id="getfirsttitlespicw" size="3" value="<?=$public_r[spicwidth]?>">
  24. *高
  25. <input name="getfirsttitlespich" type="text" id="getfirsttitlespich" size="3" value="<?=$public_r[spicheight]?>">
  26. )</td>
  27. </tr>
  28. </table>

投稿表单替换html代码如下:

  1. <?=ECMS_ShowEditorVar("newstext",$ecmsfirstpost==1?"":DoReqValue($mid,'newstext',stripSlashes($r[newstext])),"Default","","300","100%")?>