帝国ECMS7.X 整合百度编辑器UEditor 1.4.3带水印功能
1.本插件只能是网站安装在域名根目录下,如果不是,请自行修改相关路径。
2.上传到帝国/e/extend/目录下
3.使用本项目上的controller.php文件,替换编辑器自带的PHP文件(目录/e/extend/ueditor/php/controller.php)
4.修改帝国CMS字段HTML,替换为以下代码
<?php if(!isset($Field)){ ?>
<script type="text/javascript" src="/e/extend/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="/e/extend/ueditor/ueditor.all.js"></script>
<?php } ?>
<?php
/**
* ECMS UEditor编辑器字段配置
*/
$Field = 'newstext'; //*字段名称
$FieldVal = $ecmsfirstpost==1?"":stripSlashes($r[$Field]);
$isadmin = 0;
if($enews=='AddNews'||$enews=='EditNews')
{ $isadmin=1; }
else
{ $FieldVal = empty($ecmsfirstpost)?DoReqValue($mid,$Field,$FieldVal):$r[$Field]; }
?>
<script id="<?=$Field?>" name="<?=$Field?>" type="text/plain"><?=$FieldVal?></script>
<script type="text/javascript">
var ue = UE.getEditor('<?=$Field?>',{
pageBreakTag:'[!--empirenews.page--]' //分页符
, serverUrl: "/e/extend/ueditor/php/controller.php?isadmin=<?=$isadmin?>"
//,toolbars:[['FullScreen', 'Source', 'Undo', 'Redo','Bold']] //选择自己需要的工具按钮名称
});
ue.ready(function(){
ue.execCommand('serverparam', {
'classid' : '<?=$classid?>',
'filepass': '<?=$filepass?>',
'userid' : '<?=$isadmin?$logininid:$muserid?>',
'username': '<?=$isadmin?$loginin:$musername?>',
'rnd' : '<?=$isadmin?$loginrnd:$mrnd?>'
});
});
</script>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#DBEAF5">
<tr>
<td bgcolor="#FFFFFF"><input name="copyimg" type="checkbox" id="copyimg" value="1" checked="checked">
远程保存图页 取第
<input name="getfirsttitlepic" type="text" id="getfirsttitlepic" value="1" size="1">
张上传图为标题图片(
<input name="getfirsttitlespic" type="checkbox" id="getfirsttitlespic" value="1" checked="checked">
缩略图: 宽
<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>插件下载:
<< 上一篇
下一篇 >>
