第一步:下載相對應編輯器的版本
首先,去百度搜索“百度ueditor編輯器”,然后點擊進入官網,找到下載頁面。找到我們想要的編輯器的版本,這點相信不要我多說了。下載下來,然后修改名稱為“ueditor”,並進行打包上傳到include目錄下。
溫馨提示:在安裝前,最好備份下所要修改的文件。
第二步:修改inc_func_funcAdmin.php文件
打開include下的inc文件夾內的inc_func_funcAdmin.php找到184行,貼入以下代碼。
else if($GLOBALS['cfg_html_editor']=='ueditor')
{
$fvalue = $fvalue=='' ? '<
p
></
p
>' : $fvalue;
$code = '<
script
type
=
"text/javascript"
charset
=
"utf-8"
src
=
"/include/ueditor/ueditor.config.js"
></
script
>
<
script
type
=
"text/javascript"
charset
=
"utf-8"
src
=
"/include/ueditor/ueditor.all.js"
></
script
>
<
link
rel
=
"stylesheet"
type
=
"text/css"
href
=
"/include/ueditor/themes/default/css/ueditor.css"
/>
<
textarea
name
=
"'.$fname.'"
id
=
"'.$fname.'"
style
=
"width:100%;"
>'.$fvalue.'</
textarea
>
<
script
type
=
"text/javascript"
>var ue = new
baidu.editor.ui.Editor();ue.render("'.$fname.'");</
script
>';
if($gtype=="print")
{
echo $code;
}
else
{
return $code;
}
}
|
如圖所示:
第三步:修改配置
進入網站后台-->系統-->系統基本參數-->核心設置-->將 Html編輯器的值改為 ueditor ,然后保存。 到了這一步,那么恭喜你,文本編輯器已經替換成功!
如圖所示:
<
p
></
p
> 沒必要就刪除,不然每篇文章后面會多出個
<
p
><br/></
p
>