修改discuz X3.2論壇標(biāo)題80個字符的長度限制
關(guān)于discuz論壇標(biāo)題限制80個字符的修改,我已經(jīng)修改很多次了,但是每次都是去亂找,看網(wǎng)上的,因為這個修改的文件比較多,這一次為了不以后還麻煩,干脆自己也記錄一下吧。
1:修改數(shù)據(jù)庫,需要執(zhí)行sql語句
數(shù)據(jù)表前綴要和你的一致,有的人在安裝論壇的時候,會修改這個。
ALTER TABLE `pre_forum_post` CHANGE `subject` `subject` VARCHAR(200) NOT NULL;ALTER TABLE `pre_forum_rsscache` CHANGE `subject` `subject` char(200) NOT NULL;ALTER TABLE `pre_forum_thread` CHANGE `subject` `subject` char(200) NOT NULL;


2:修改js驗證文件,找到static/js/forum_post.js文件,在里面找下下面這一段,
if(($('postsubmit').name != 'replysubmit' && !($('postsubmit').name == 'editsubmit' && !isfirstpost) && theform.subject.value == "") || !sortid && !special && trim(message) == "") {showError('抱歉,您尚未輸入標(biāo)題或內(nèi)容');return false;} else if(mb_strlen(theform.subject.value) > 80) {showError('您的標(biāo)題超過 80 個字符的限制');return false;}
修改為
if(($('postsubmit').name != 'replysubmit' && !($('postsubmit').name == 'editsubmit' && !isfirstpost) && theform.subject.value == "") || !sortid && !special && trim(message) == "") {showError('抱歉,您尚未輸入標(biāo)題或內(nèi)容');return false;} else if(mb_strlen(theform.subject.value) > 200) {showError('您的標(biāo)題超過 200 個字符的限制');return false;}


3:還是修改js文件,找到sitatic/js/forum.js文件,里面也有差不多的一段
if(theform.message.value == '' || theform.subject.value == '') {s = '抱歉,您尚未輸入標(biāo)題或內(nèi)容';theform.message.focus();} else if(mb_strlen(theform.subject.value) > 80) {s = '您的標(biāo)題超過 80 個字符的限制';theform.subject.focus();}
修改為
if(theform.message.value == '' || theform.subject.value == '') {s = '抱歉,您尚未輸入標(biāo)題或內(nèi)容';theform.message.focus();} else if(mb_strlen(theform.subject.value) > 200) {s = '您的標(biāo)題超過 200 個字符的限制';theform.subject.focus();}
4:修改模版文件,找到templatedefaultforumpost_editor_extra.htm文件,
除了第一個80,其他全部換成200.
5:還是修改程序文件,找到templatedefaultforumforumdisplay_fastpost.htm這里面也要修改
除了第一個和最后一個80,其他全部換成200.
6:修改驗證函數(shù)文件,找到source/function/function_post.php文件
if(dstrlen($subject) > 80) {return 'post_subject_toolong';}
修改為
if(dstrlen($subject) > 200) {return 'post_subject_toolong';}


7:語言包也還是修改下,在source/language/lang_messege.php里面
'post_subject_toolong' => '抱歉,您的標(biāo)題超過 80 個字符修改標(biāo)題長度',
修改為
'post_subject_toolong' => '抱歉,您的標(biāo)題超過 200 個字符修改標(biāo)題長度',
8:最后更新下緩存就行,后面幾個文件都是把數(shù)字80緩存200,你直接換也行,批量換代碼也行。