|
需要修改如下幾個文件:
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 (不需要修改數據庫)
|
|