Discuz7.0 utf-8 标题80字符限制解决方案

完美解决discuz7.0 utf-8版帖子标题只有26个字以上却报告超过80字符警告的问题!

以前曾有人发过类似帖子,但没有做到完美解决,现在发布出来,以解决大家疑难!
以下是修改步骤:
以下修改都是相对论坛根目录的路径,也就是你上传到服务器的路径
include文件夹里面的js文件夹里面的post.js
查找

} else if(mb_strlen(theform.subject.value) > 80) {

将80改为255
下面一行的

s = '您的标题超过 80 个字符的限制。';

将80 改为85
修改后的样子

} else if(mb_strlen(theform.subject.value) > 255) {
                s = '您的标题超过 85 个字符的限制。';

—————————————
include文件夹js文件夹里面的viewthread.js
查找

} else if(mb_strlen(theform.subject.value) > 80) {
dalert('您的标题超过 80 个字符的限制。');

参照上一个文件,改为下面的样子即可

        } else if(mb_strlen(theform.subject.value) > 255) {
                dalert('您的标题超过 85 个字符的限制。');

——————————-

include文件夹里面的post.func.php
查找

if(strlen($subject) > 80) {

将80改为255
成为

if(strlen($subject) > 255) {

modcp文件夹里面的editpost.inc.php
查找

if(strlen($subjectnew) > 80) {

将80 改为255,也就是

if(strlen($subjectnew) > 255) {

templates文件夹下的default文件夹里面的messages.lang.php
查找

'post_subject_toolong' => '对不起,您的标题超过 80 个字符,请返回修改标题长度。',

将80改为85,也就是

'post_subject_toolong' => '对不起,您的标题超过 85 个字符,请返回修改标题长度。',

templates文件夹下的default文件夹里面的wap.lang.php
查找

'post_subject_toolong' => '标题超过80字节',

将80改为85,也就是

'post_subject_toolong' => '标题超过85字节',

——————————
修改完后,以管理员身份进入论坛后台,找工具,数据库—-“升级”
输入:

ALTER TABLE `cdb_threads` CHANGE `subject` `subject` VARCHAR(255) NOT NULL;
ALTER TABLE `cdb_posts` CHANGE `subject` `subject` VARCHAR(255) NOT NULL;

成功后,再更新一下缓存,即可,然后自己发一个标题字数为85个字的帖子试验一下,就可以了!
注意:
255就已经是最大数字了,不要再大过255,
如果认为,标题不需要85个汉字,可以将其中的80改为你自己想要设定的数字,而以上修改中出现的255,就相应的改为你限定的数字再乘3即可,如
你想要40个汉字,那么,凡是在修改中出现85的地方,改成40,凡是在修改中出现255的地方,改成120,就可以了。

演示网站:http://www.gedua.com/bbs

演示帖子
本论坛标题最大八十五汉字演示帖本论坛标题最大八十五汉字演示帖本论坛标题最大八十五汉字演示帖本论坛标题最大八十五汉字演示帖本论坛标题最大八十五汉字演示帖一二三四五六七八九十

http://www.gedua.com/bbs/viewthread.php?tid=1243&extra=

文件下载:
80字符限制修改for7.0gedua.com.rar

原文:

http://www.discuz.net/viewthread.php?tid=1162568

This entry was posted in 网站应用 and tagged , . Bookmark the permalink.

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word