帝国cms7.5+utf8的newstext编辑器字段,输入表单后台替换代码,保留备忘: 帝国自带的编辑器:
- <?=ECMS_ShowEditorVar("newstext",$ecmsfirstpost==1?"":stripSlashes($r[newstext]),"Default","","300","100%")?>
- <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>
百度编辑器对应的代码: - <?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.min.js"></script>
- <?php } ?>
- <?php
- /**
- * UEditor for ECMS编辑器字段配置
- * User: pkkgu 910111100@qq.com
- */
- $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="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="">
- )
-
- <script type="text/javascript" src="/e/extend/upword/ajaxfileupload.js"></script>
- <h1>选择word文档,点击按钮上传识别</h1>
- <input id="fileToUpload" type="file" size="45" name="fileToUpload"
- class="input">
- <input id="btnShow" type="button" value="上传word文档" class="button" onclick="ajaxFileUpload()" />
-
-
-
-
-
- </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>
|