discuz二次開發更換百度ueditor編輯器
修改前必讀:
1、修改編輯器后會造成以前發過的帖子再次進行修改時(也就是編輯帖子操作)出現很多被DZ重寫過的html標簽,不方便進行修改,所以盡量在安裝DZ后立刻進行修改。(當然,如果你有能力重寫代碼的話就可以無視啦)
2、修改前請先在本地進行嘗試或備份相關文件。
需要修改的文件:
templatedefaultforumpost_editor_body.htm
templatedefaultforumpost.htm
sourcefunctionfunction_Discuzcode.php
sourceincludepostpost_editpost.php
修改步驟:
一、首先下載百度的 ueditor utf-8 php 版,解壓出來后將文件夾名改為ueditor,然后放在論壇根目錄。
二、修改post_editor_body.htm(將下面代碼復制,打開文件全選之后粘貼。)
{lang e_editor_loading}$editor[value]var ue = UE.getEditor('{$editorid}_textarea');close{lang missed_data} {lang post_autosave_restore}
三、修改post.htm
搜索 “switchpost(”,找到“$_GET[action] == 'newthread'” 下面的ul標簽,之后將下面的代碼替換掉整段ul。
{lang draftbox}($savecount){lang post_newthread}{lang post_newthreadpoll}{lang post_newthreadreward}{lang post_newthreaddebate}{lang post_newthreadactivity}{lang post_newthreadtrade}{$_G[setting][threadplugins][$tpid][name]}
四、修改 function_Discuzcode.php ,大約在第 97 行,或者搜索 $htmlon , 在下面加上 $htmlon=1;
注:改這里是 DZ在提交時將替換編輯框里html標簽 的功能去掉了,如果不去掉會出現讀取帖子內容的時候連標簽一起顯示出來的問題。因為時間緊迫,沒有深入修改,就直接這么辦了,不影響編輯器使用,但是可能會出現一些安全上的問題(如用戶提交惡意js腳本等),有能力的朋友自己可以完善下。
五、修改 post_editpost.php ,大約在 217 行,或者搜索 dhtmlspecialchars ,第二個就是,然后將這一行注釋掉。
最后后臺更新下緩存,完成。
本文鏈接:http://www.heeleri.com//cmsjiaocheng/discuzjiaocheng/183422.html
版權聲明:本站資源均來自互聯網或會員發布,如果侵犯了您的權益請與我們聯系,我們將在24小時內刪除!謝謝!
標簽云