帝國cms 整合百度編輯器ueditor完整教程(圖文)
阿新 • • 發佈:2019-02-17
一、UEditor簡介
帝國cms自帶文字編輯器是fckeditor,用起來效果不太理想。
百度也推出了自己的編輯器UEditor
UEditor是由WEB前端研發部開發的所見即所得的開源富文字編輯器,具有輕量、可定製、使用者體驗優秀等特點。開源基於BSD協議,所有原始碼在協議允許範圍內可自由修改和使用。百度UEditor的推出,可以幫助不少網站開者在開發富文字編輯器所遇到的難題,節約開發者因開發富文字編輯器所需要的大量時間,有效降低了企業的開發成本。
下邊先來貼出幾張相片瀏覽一下百度編輯器UEditor一些特色功能吧!
二、帝國CMS6.6整合UEditor
2.上傳至帝國cms的/e/data/ecmseditor/下
3.修改欄位輸入表單,具體操作:系統-->新建表與系統模型-->管理資料表-->管理欄位
如下圖所示
4.將下列程式碼複製入下圖所示紅框內
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | < script type = "text/javascript" src = "/e/data/ecmseditor/ueditor/editor_config_admin.js" ></ script > < script type = "text/javascript" src = "/e/data/ecmseditor/ueditor/editor_all_min_admin.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 > </ tr > </ table > |
5./e/admin/AddNews.php,333行 <html>之上增加一行新增程式碼來解決某些瀏覽器可能錯位問題
1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
6.關閉網頁,重新啟動。