woff 發表於 2008-7-2 02:00:01

{完整版}修改帖子標題80個字符的限制

需要修改如下幾個文件:

include/post.func.php
include/javascript/post_editor.js
modcp/editpost.inc.php
default/viewthread.htm
default/forumdisplay.htm
default/templates.lang.php
default/messages.lang.php

打開 include/post.func.php

查找




function checkpost() {
global $subject, $message, $disablepostctrl, $minpostsize, $maxpostsize;
if(strlen($subject) > 80) {
return 'post_subject_toolong';
}


把 > 80 改成 你想要的數字


打開 include/javascript/post_editor.js

查找






} else if(mb_strlen(theform.subject.value) > 80) {
                alert(lang['post_subject_toolong']);
                theform.subject.focus();




把 > 80 改成 你想要的數字

打開 modcp/editpost.inc.php

查找




require_once DISCUZ_ROOT.'./include/discuzcode.func.php';
                $subjectnew = dhtmlspecialchars(censor(trim($subjectnew)));
                if(strlen($subjectnew) > 80) {
                        showmessage('post_subject_toolong');




把 > 80 改成 你想要的數字
打開 default/viewthread.htm

查找



} else if(mb_strlen(theform.subject.value) > 80) {
                        alert("{lang post_subject_toolong}");
                        theform.subject.focus();
                        return false;


把 > 80 改成 你想要的數字


打開default/forumdisplay.htm

查找







} else if(mb_strlen(theform.subject.value) > 80) {
                        alert("{lang post_subject_toolong}");
                        theform.subject.focus();
                        return false;


把 > 80 改成 你想要的數字

打開default/templates.lang.php

查找







'post_subject_toolong' => '您的標題超過 80 個字符的限制。',


改成





'post_subject_toolong' => '對不起,您的標題超過 xx 個字符,請返回修改。',


打開 default/messages.lang.php
查找





'post_subject_toolong' => '對不起,您的標題超過80個字符,請返回修改標題長度。',


改成






'post_subject_toolong' => '對不起,您的標題超過xx 個字符,請返回修改。',




上傳所有修改好的文件后台更新 所有缓存
原文:http://x.discuz.net/viewthread-917453.html



完美控制貼子標題長度字符限制 For Discuz! 6.1 (不需要修改數據庫)


clcm8629 發表於 2011-6-27 11:10:55

原來還有這麼多內幕啊,長見識了,呵呵

evozzo22 發表於 2011-6-27 11:32:32

應該加分

芳禾炳学 發表於 2014-6-23 09:35:21

我也想了解,谢谢发帖的人
頁: [1]
查看完整版本: {完整版}修改帖子標題80個字符的限制