帝國cms7.0整合百度編輯器ueditor教程開始
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> //開源軟件:Vevb.com
- </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>
最后在加一條解決百度編輯器代碼高亮不換行的BUG
1、找到高亮代碼顯示的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、保存完成
新聞熱點
疑難解答