帝国cms 后台添加ueditor_ 帝国添加百度浏览器

时间:2026-03-07 栏目:电脑知识

1、先下载下面附件里的编辑器(选择你需要的编码的编辑器),解压进入文件夹把ueditor这个目录上传到帝国的插件目录里即:(/e/extend/)


2、后台--系统--数据表与系统模型--新闻系统数据表----管理字段----newstext 行 新闻正文  点击  ---   修改     [输入表单替换html代码 (增加字段时请留空) ]     添加下面的   编辑器代码 


3、e/extend/ueditor/php/config.json 修改 网站域名和 图片路径  


/* 前后端通信相关的配置,注释只允许使用多行方式 */

{

    /* 上传图片配置项 */

    "imageActionName": "uploadimage", /* 执行上传图片的action名称 */

    "imageFieldName": "upfile", /* 提交的图片表单名称 */

    "imageMaxSize": 2048000, /* 上传大小限制,单位B */

    "imageAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 上传图片格式显示 */

    "imageCompressEnable": true, /* 是否压缩图片,默认是true */

    "imageCompressBorder": 1600, /* 图片压缩最长边限制 */

    "imageInsertAlign": "none", /* 插入的图片浮动方式 */

    "imageUrlPrefix": "http://www.wfdmxx.com", /* 图片访问路径前缀 */

    "imagePathFormat": "d/file/p/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */

                                /* {filename} 会替换成原文件名,配置这项需要注意中文乱码问题 */

                                /* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */



编辑器代码:输入表单替换html代码


<?php

 $ziduan='newstext';//编辑器使用的字段名称

if($enews=='MAddInfo' || $enews=='MEditInfo'){//前台投稿

$qiantai=1;

 $ziduanzhi=$ecmsfirstpost==1?"":DoReqValue($mid,$ziduan,stripSlashes($r[$ziduan]));

 }else{//后台

$qiantai=0;

 $ziduanzhi=$ecmsfirstpost==1?"":stripSlashes($r[$ziduan]);

 }

 ?>

 <script>var classid='<?=$classid?>',infoid='<?=$id?>',filepass='<?=$filepass?>',ehash='<?=$ecms_hashur[ehref]?>',qiantai='<?=$qiantai?>';//把参数传给编辑器,增加支持7.2版本的金刚模式</script>

 <script type="text/javascript" charset="utf-8" src="<?=$public_r['newsurl']?>e/extend/ueditor/ueditor.config.js"></script>

 <script type="text/javascript" charset="utf-8" src="<?=$public_r['newsurl']?>e/extend/ueditor/ueditor.all.min.js"></script>

 <script type="text/javascript" charset="utf-8" src="<?=$public_r['newsurl']?>e/extend/ueditor/ueditor.toolbarconfig.js"></script>

 <textarea id="<?=$ziduan?>" name="<?=$ziduan?>"><?=$ziduanzhi?></textarea>

 <script type="text/javascript">

 <?=$ziduan?>=UE.getEditor('<?=$ziduan?>',{

 serverUrl: "<?=$public_r['newsurl']?>e/extend/ueditor/php/controller.php",//自己的请求接口

toolbars:Default,//工具栏配置文件,具体参考ueditor.toolbarconfig.js文件中说明

pageBreakTag:'',//帝国分页标签

initialFrameWidth:'100%',//编辑器宽

initialFrameHeight:300//编辑器高

//等等其它配置自行添加,参考UE默认配置文件复制修改即可

});

 //自定义请求参数

<?=$ziduan?>.ready(function(){

 <?=$ziduan?>.execCommand('serverparam',{

 'filepass':'<?=$filepass?>',//修改时候是信息ID

 'classid' :'<?=$classid?>',

 'qiantai':<?=$qiantai?>

 });

 });

 </script>

 <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#DBEAF5">

 <tr height="25">

 <td bgcolor="#FFFFFF"> <input name="dokey" type="checkbox" value="1"<?=$r[dokey]==1?' checked':''?>>

关键字替换&nbsp;&nbsp; <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>)&nbsp;&nbsp;

 <input name="copyflash" type="checkbox" id="copyflash" value="1">

远程保存FLASH(地址前缀:

<input name="qz_url" type="text" id="qz_url" size="">

 )</td>

 </tr>

 <tr height="25">

 <td bgcolor="#FFFFFF"><input name="repimgnexturl" type="checkbox" id="repimgnexturl" value="1"> 图片链接转为下一页&nbsp;&nbsp; <input name="autopage" type="checkbox" id="autopage" value="1">自动分页

,每

<input name="autosize" type="text" id="autosize" value="5000" size="5">

个字节为一页&nbsp;&nbsp; 取第

<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>


ueditor-gbk 版本添加以下代码: 请下载 ueditor-gbk版本编辑器代码,其他操作一样

 <?php

 $ziduan='newstext';//编辑器使用的字段名称

if($enews=='MAddInfo' || $enews=='MEditInfo'){//前台投稿

$qiantai=1;

 $ziduanzhi=$ecmsfirstpost==1?"":DoReqValue($mid,$ziduan,stripSlashes($r[$ziduan]));

 }else{//后台

$qiantai=0;

 $ziduanzhi=$ecmsfirstpost==1?"":stripSlashes($r[$ziduan]);

 }

 ?>

<script>var classid='<?=$classid?>',infoid='<?=$id?>',filepass='<?=$filepass?>',ehash='<?=$ecms_hashur[ehref]?>',qiantai='<?=$qiantai?>';//把参数传给编辑器,增加支持7.2版本的金刚模式</script>

 <script type="text/javascript" charset="utf-8" src="<?=$public_r['newsurl']?>e/extend/ueditor/ueditor.config.js"></script>

 <script type="text/javascript" charset="utf-8" src="<?=$public_r['newsurl']?>e/extend/ueditor/ueditor.all.min.js"></script>

 <script type="text/javascript" charset="utf-8" src="<?=$public_r['newsurl']?>e/extend/ueditor/ueditor.toolbarconfig.js"></script>

<link rel="stylesheet" href="/e/extend/ueditor/themes/default/css/ueditor.css">

<script type="text/plain" id="myEditor" name="newstext" style="width:99%;height:450px;"> 

<?=$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':''?>>关键字替换&nbsp;&nbsp;

<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>)&nbsp;&nbsp;

<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">图片链接转为下一页&nbsp;&nbsp;

<input name="autopage" type="checkbox" id="autopage" value="1">自动分页,每

<input name="autosize" type="text" id="autosize" value="5000" size="5">个字节为一页&nbsp;&nbsp; 取第

<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>


相关文章: