您现在的位置是:首页 > 教程 > 帝国CMS教程帝国CMS教程
帝国cms整合百度编辑器ueditor的方法
忆翠2023-05-19 22:08:43帝国CMS教程已有人查阅
导读1、根据自己使用的帝国cms版本编码下载对应的ueditor版本解压附件,重命名为”ueditor“,将”ueditor“文件夹上传至帝国cms的/e/data/ecmseditor/下
1、根据自己使用的帝国cms版本编码下载对应的ueditor版本
下载地址 http://ueditor.baidu.com/website/download.html#ueditor
2、解压附件,重命名为”ueditor“,将”ueditor“文件夹上传至帝国cms的/e/data/ecmseditor/下
3、进入帝国CMS后台,依次点击:系统 - 新建表与系统模型 - 管理数据表 - 管理字段,修改字段输入表单
4、修改”newstext 新闻正文“字段
5、将以下代码,覆盖到”输入表单替换HTML代码“处
<script type="text/javascript" src="/e/data/ecmseditor/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="/e/data/ecmseditor/ueditor/ueditor.all.js"></script>
<link rel="stylesheet" href="/e/data/ecmseditor/ueditor/themes/default/ueditor.css">
<script type="text/plain" id="myEditor" name="newstext">
<?=$ecmsfirstpost==1?"":stripSlashes($r[newstext])?>
</script>
<script type="text/javascript">
var editor = new baidu.editor.ui.Editor();
editor.render("myEditor");
editor.classid = <?=$classid?>;
editor.filepass = <?=$filepass?>;
</script>
<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 href="SetEnews.php" 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>
6、帝国CMS百度编辑器整合完成,其他模型整合同理。帝国CMS前台显示代码高亮教程。将以下代码复制到要显示代码高亮的页面。
<script src="/e/data/ecmseditor/ueditor/third-party/SyntaxHighlighter/shCore.js" type="text/javascript"></script>
<link rel="stylesheet" href="/e/data/ecmseditor/ueditor/third-party/SyntaxHighlighter/shCoreDefault.css">
<script type="text/javascript">
SyntaxHighlighter.all();
</script>
最后在加一条解决百度编辑器代码高亮不换行的BUG1、找到高亮代码显示的css文件 /e/data/ecmseditor/ueditor/third-party/SyntaxHighlighter/shCoreDefault.css
2、搜索
width:100%!important;margin:.3em 0 .3em 0!important;position:relative!important;overflow:auto!important;background-color:#f5f5f5!important;border:1px solid #ccc!important;
3、替换成以下代码
width:100%!important;margin:.3em 0 .3em 0!important;position:relative!important;overflow:auto!important;background-color:#f5f5f5!important;border:1px solid #ccc!important;word-break:break-all;
4、保存完成附上原来的代码
<?=ECMS_ShowEditorVar("newstext",$ecmsfirstpost==1?"":stripSlashes($r[newstext]),"Default","","1000px","800px")?>
<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 href="SetEnews.php<?=$ecms_hashur[whehref]?>" 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>
本文标签:
很赞哦! ()
上一篇:帝国CMS常用变量有哪些
相关文章
随机图文
开启SSL之后帝国CMS后台登录一片空白的解决方法
如今网站安全越来越重视,未配置SSL证书的域名容易被劫持,所以,建议广大站长尽量配置SSL证书,但有朋友在使用帝国CMS配置SSL域名证书后,访问后台一片空白。帝国CMS怎么调用当前栏目下的栏目简介
(一)、当前栏目ID或专题ID:$GLOBALS[navclassid],(二)、使用范例:调用当前栏目下的栏目简介。帝国CMS信息反馈开启和判断是否开启验证码的方法
发过一次帝国CMS信息反馈开启验证码的方法,有的小伙伴说太简陋了,能不能写详细点,然后增加下判断验证码是否开启的方法,小编今天就整理详细说明一下!帝国CMS登录后台提示"您的Cookie没有开启,不能登陆成功"的解决方法
如果没有动过文件特别是/e/config/config.php文件的话!请按照如下操作肯定就OK了!到你的主机或者服务器环境里找到php.ini文件(如果不知道在哪联系你的空间商就行了)找到如下:out
留言与评论 (共有 条评论) |