帝国ECMS7.0 整合百度编辑器UEditor 1.4.3
本帖最后由 yun 于 2017-4-25 22:16 编辑UEditor for ECMS
百度编辑器UEditor 1.4.3 深度整合 帝国ECMS7.0
使用说明
1.下载UEditor编辑器 [下载地址]
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编辑器字段配置
* User: dingwei
*/
$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>
UEditor1.4.3_for_ECMS7.0_utf-8.part1.rar
上传一下附件:
页:
[1]