DISCUZ! X3.2论坛标题字数(80个字符)限制长度
1、首先使用ftp工具 进入后台文件管理。

2、找到文件static/js/forum_post.js ,下载下来,打开编辑

3、找到:
if(($('postsubmit').name != 'replysubmit' && !($('postsubmit').name == 'editsubmit' && !isfirstpost) && theform.subject.value == "") || !sortid && !special && trim(message) == "") { showError('抱歉,您尚未输入标题或内容'); return false; } else if(mb_strlen(theform.subject.value) > 80) { showError('您的标题超过 80 个字符的限制'); return false; }
修改为:
if(($('postsubmit').name != 'replysubmit' && !($('postsubmit').name == 'editsubmit' && !isfirstpost) && theform.subject.value == "") || !sortid && !special && trim(message) == "") { showError('抱歉,您尚未输入标题或内容'); return false; } else if(mb_strlen(theform.subject.value) > 120) { showError('您的标题超过 120 个字符的限制'); return false; }
保存文件上传覆盖原文件

4、然后找到文件static/js/forum_post.js ,下载下来,打开编辑

5、然后继续找到:
if(theform.message.value == '' || theform.subject.value == '') {
s = '抱歉,您尚未输入标题或内容';
theform.message.focus();
} else if(mb_strlen(theform.subject.value) > 80) {
s = '您的标题超过 80 个字符的限制';
theform.subject.focus();
}
修改为:
if(theform.message.value == '' && theform.subject.value == '') { s = '抱歉,您尚未输入标题或内容'; theform.message.focus(); } else if(mb_strlen(theform.subject.value) > 120) { s = '您的标题超过 120 个字符的限制'; theform.subject.focus(); }
保存文件上传覆盖原文件

1、首先,进入discuz的后台->站长->数据库->升级

2、由于Discuz! 后台默认情况下禁止 SQL 语句直接执行,只能使用常用 SQL 当中的内容。
如果您想自己随意书写 SQL 升级语句,需要将 config/config_global.php 当中的 $_config[admincp][runquery] 设置修改为 1。
(因为我们这里需要执行SQL语句所以需要改,或者直接在PHPmyadmin 里面执行SQL语句即可)
这里我是修改了config_global.php文件。
3、数据库修改,修改数据库标题字段的长度为120字符:运行下面的sql语句:(注意修改你的表的前缀)ALTER TABLE `pre_forum_post` CHANGE `subject` `subject` VARCHAR(120) NOT NULL;ALTER TABLE `pre_forum_rsscache` CHANGE `subject` `subject` char(120) NOT NULL;ALTER TABLE `pre_forum_thread` CHANGE `subject` `subject` char(120) NOT NULL;
(把次三行代码填入如图所示对话框)

4、点击:提交 ,成功如图所示

1、然后继续使用ftp工具找到,找到文件\template\default\forum\post_editor_extra.htm
下载,编辑

2、找到:(把80 改成 120)
<!--{if $_GET[action] != 'reply'}-->
<span><input type="text" name="subject" id="subject" class="px" value="$postinfo[subject]" {if $_GET[action] == 'newthread'}onblur="if($('tags')){relatekw('-1','-1'{if $_G['group']['allowposttag']},function(){extraCheck(4)}{/if});doane();}"{/if} onkeyup="strLenCalc(this, 'checklen', 80);" style="width: 25em" tabindex="1" /></span>
<!--{else}-->
<span id="subjecthide" class="z">RE: $thread[subject] [<a href="javascript:;" onclick="display('subjecthide');display('subjectbox');$('subject').value='RE: {echo dhtmlspecialchars(str_replace('\'', '\\\'', $thread[subject]))}';display('subjectchk');strLenCalc($('subject'), 'checklen', 80);return false;">{lang modify}</a>]</span>
<span id="subjectbox" style="display:none"><input type="text" name="subject" id="subject" class="px" value="" onkeyup="strLenCalc(this, 'checklen', 80);" style="width: 25em" /></span>
<!--{/if}-->
<span id="subjectchk"{if $_GET[action] == 'reply'} style="display:none"{/if}>{lang comment_message1} <strong id="checklen">80</strong> {lang comment_message2}</span>
<script type="text/javascript">strLenCalc($('subject'), 'checklen', 80)</script>
<!--{/if}-->
修改为:
<!--{if $_GET[action] != 'reply'}--><span><input type="text" name="subject" id="subject" class="px" value="$postinfo[subject]" {if $_GET[action] == 'newthread'}onblur="if($('tags')){relatekw('-1','-1'{if $_G['group']['allowposttag']},function(){extraCheck(4)}{/if});doane();}"{/if}#ff0000">120);" style="width: 25em" tabindex="1" /></span><!--{else}--><span id="subjecthide" class="z">RE: $thread[subject] [<a href="javascript:;"#ff0000">120);return false;">{lang modify}</a>]</span><span id="subjectbox" style="display:none"><input type="text" name="subject" id="subject" class="px" value=""FONT-WEIGHT: bold; COLOR: #0000ff">120);" style="width: 25em" /></span><!--{/if}--> <span id="subjectchk"{if $_GET[action] == 'reply'} style="display:none"{/if}>{lang comment_message1} <strong id="checklen">120</strong> {lang comment_message2}</span><script type="text/javascript">strLenCalc($('subject'), 'checklen', 120)</script><!--{/if}-->
保存文件上传覆盖原文件

3、继续找到文件\template\default\forum\forumdisplay_fastpost.htm
下载,编辑

4、找到:
<input type="text" id="subject" name="subject" class="px" value="" onkeyup="strLenCalc(this, 'checklen', 80);" tabindex="11" style="width: 25em" />
<span>{lang comment_message1} <strong id="checklen">80</strong> {lang comment_message2}</span>
修改为:
<input type="text" id="subject" name="subject" class="px" value="" onkeyup="strLenCalc(this, 'checklen', 120);" tabindex="11" style="width: 25em" />
<span>{lang comment_message1} <strong id="checklen">120</strong> {lang comment_message2}</span>
保存文件上传覆盖原文件

1、继续使用ftp工具 。找到文件/source/function/function_post.php
下载编辑。

2、找到:
if(dstrlen($subject) > 80) {return 'post_subject_toolong';}
修改为:
if(dstrlen($subject) > 120) {return 'post_subject_toolong';}
保存文件上传覆盖原文件

1、找到: source/language/lang_messege.php 下载编辑

2、找到:
'post_subject_toolong' => '抱歉,您的标题超过 80 个字符修改标题长度'
修改:
'post_subject_toolong' => '抱歉,您的标题超过 120个字符修改标题长度'

3、最后进入discuz的后台->工具->更新缓存

4、然后我们看看。现在效果如何:
