帝国CMS默认编辑器不能使用的情况下整合百度编辑器UEditor

帝国CMS的编辑器实在烂到不可理喻,最新IE和Google Chrome都不再支持。因为一个小小的编辑器就换整个系统不现实,但编辑器不好用确实非常糟糕。所以现在就手动来整合一个超级好用的百度编辑器UEditor。下载UEditor PHP版本,这里以1.3.6为例。
UEditor PHP版本 http://ueditor.baidu.com/website/download.html
下载后解压,将文件夹名改为ueditor。
接着,上传到服务器,帝国CMS文件夹e\data\ecmseditor\目录下。

进入帝国CMS后台,点击顶部【系统】
再点击左侧【数据表与系统模型】>>>【管理数据表】
然后右侧找到相应的数据表,点击【管理字段】
在弹出的新窗口内找到字段名〖newstext〗,然后点击此行的【修改】
找到〖输入表单替换html代码〗。

图片[1]-帝国CMS默认编辑器不能使用的情况下整合百度编辑器UEditor-丁塔克

d043ad4bd11373f0b24fe6dca60f4bfbfbed0404.jpg (104.32 KB, 下载次数: 274)

下载附件

2019-1-6 17:59 上传


将右侧的代码全部删除,复制下面的代码到框内,然后点【提交】。

  1. <script type="text/javascript" src="/e/data/ecmseditor/ueditor/ueditor.config.js"></script>
  2. <script type="text/javascript" src="/e/data/ecmseditor/ueditor/ueditor.all.js"></script>
  3. <script type="text/javascript" charset="utf-8" src="/e/data/ecmseditor/ueditor/lang/zh-cn/zh-cn.js"></script>
  4. <link rel="stylesheet" href="/e/data/ecmseditor/ueditor/themes/default/ueditor.css">
  5. <script type="text/plain" id="myEditor" name="newstext" style="width:99%;height:450px;">
  6. <?=$ecmsfirstpost==1?"":stripSlashes($r[newstext])?>
  7. </script>
  8. <script type="text/javascript">
  9. var editor = new baidu.editor.ui.Editor();
  10. editor.render("myEditor");
  11. editor.classid = <?=$classid?>;
  12. editor.filepass = <?=$filepass?>;
  13. </script>
  14. <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#DBEAF5">
  15. <tr>
  16. <td bgcolor="#FFFFFF">
  17. <input name="dokey" type="checkbox" value="1"<?=$r[dokey]==1?’ checked’:”?>>关键字替换  
  18. <input name="copyimg" type="checkbox" id="copyimg" value="1">远程保存图片(
  19. <input name="mark" type="checkbox" id="mark" value="1"><a href="SetEnews.php" target="_blank">加水印</a>)  
  20. <input name="copyflash" type="checkbox" id="copyflash" value="1">远程保存FLASH(地址前缀:
  21. <input name="qz_url" type="text" id="qz_url" size="">)
  22. </td>
  23. </tr>
  24. <tr>
  25. <td bgcolor="#FFFFFF">
  26. <input name="repimgnexturl" type="checkbox" id="repimgnexturl" value="1">图片链接转为下一页  
  27. <input name="autopage" type="checkbox" id="autopage" value="1">自动分页,每
  28. <input name="autosize" type="text" id="autosize" value="5000" size="5">个字节为一页   取第
  29. <input name="getfirsttitlepic" type="text" id="getfirsttitlepic" value="" size="1">张上传图为标题图片(
  30. <input name="getfirsttitlespic" type="checkbox" id="getfirsttitlespic" value="1">缩略图: 宽
  31. <input name="getfirsttitlespicw" type="text" id="getfirsttitlespicw" size="3" value="<?=$public_r[spicwidth]?>">*高
  32. <input name="getfirsttitlespich" type="text" id="getfirsttitlespich" size="3" value="<?=$public_r[spicheight]?>">)
  33. </td>
  34. </tr>
  35. </table>

复制代码

如果需要修改编辑器的尺寸,在上面的代码内找到〖style="width:99%;height:450px;"〗进行修改即可。
举例:宽600像素,高500像素,则style="width:600px;height:500px;"
如果是自定义模型或改过模型,字段名不叫〖newstext〗的话,请把上面代码里面所有的〖newstext〗改成你的字段名(一共两处),否则会无法使用。
这样一次修改,只能针对一张数据表,如果有多张数据表,请每个都要修改。

UEditor的版本一定要和帝国CMS相同,否则会出现乱码。也就是说,都用GBK或者都用UTF-8。
这是最简单的整合方法,还有更多扩展应用,可以参看UEditor官网文档

php utf-8下载

© 版权声明
THE END
点赞15 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容