修改Discuz论坛程序的标题字数的80字节限制如何修改200字节
一、数据库修改;二、修改JS验证字符数文件;三、修改模板中写死的字符限制数;四、修改函数验证文件;五、修改语言包文件。第一、修改数据库,执行以下代码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;
第二、修改JS验证字符数文件
找到文件static/js/forum_post.js
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) ><font color="Red"> 80</font>) {
showError('您的标题超过<font color="Red"> 80</font> 个字符的限制');
return false;
} sitatic/js/forum.js
else if(mb_strlen(theform.subject.value) ><font color="Red"> 80</font>) {
s = '您的标题超过<font color="Red"> 80 </font>个字符的限制';
theform.subject.focus();
}
第三、修改模板中写死的字符限制数
/template/default/forum/ 下的post_editor_extra.htm
<span><input type="text" name="subject" id="subject" class="px" value="$postinfo" onkeyup="strLenCalc(this, 'checklen', <font color="Red">80</font>);" style="width: 25em" tabindex="1" /></span>
<!--{else}-->
<span id="subjecthide" class="z">RE: $thread [<a href="javascript:;" onclick="display('subjecthide');display('subjectbox');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',<font color="Red"> 80</font>);" style="width: 25em" /></span>
<!--{/if}-->
<span id="subjectchk"{if $_GET == 'reply'} style="display:none"{/if}>{lang comment_message1} <strong id="checklen">80</strong> {lang comment_message2}</span>
<script type="text/javascript">strLenCalc($('subject'), 'checklen', <font color="Red">80</font>)</script>template\default\forum\forumdisplay_fastpost.htm
<input type="text" id="subject" name="subject" class="px" value="" onkeyup="strLenCalc(this, 'checklen', <font color="Red">80</font>);" tabindex="11" style="width: 25em" />
<span>{lang comment_message1} <strong id="checklen"><font color="Red">80</font></strong> {lang comment_message2}</span>
四、修改函数验证文件
source/function/function_post.php
if(dstrlen($subject) > <font color="Red">80</font>) {
return 'post_subject_toolong';
}
五,修改语言包文件。
source/language/lang_messege.php
'post_subject_toolong' => '抱歉,您的标题超过<font color="Red"> 80</font> 个字符修改标题长度',
把所有的80修改为200就可以了。
页:
[1]