discuz! x2.5论坛标题字数突破80的限制Discuz! X2. 5 forumtitle, word break 80 limit
This post, "Discuz, "when you wrote "upgrade Discuz, X" on X,was revised on the basis of that post
When some users post title if more than the rest of thecharacters were cut especially when some users send someEnglish or other language of the title of the article said thateven more than a character encoding and special forum is theUTF format because a word for a byte so long as the title ofa Chinese characters many users want to modify the characterlimit
Want to get rid of this word limit, from the following five partsto modify
I. database modification
Two modify the number of JS verification characters
Three modify the number of dead characters written in thet emp lat e
Four modify the function validation file
Five modify the language package file
Now, modify the title character restriction to describe themodification method for the example
A database modify, modify the database title, the length of thefield for characters, run the following SQL statement(pay attention to modifying the prefix of your table)ALTER, TABLE, `pre_forum_pos t` , CHANGE, `sub j ec t` , `s ubj ect` ,VARCHAR () , NOT, NULL;
ALTER, TABLE, `pre_forum_rs s cache` , CHANGE, `sub j ec t` ,`sub jec t` , char () , NOT, NULL;
ALTER, TABLE, `pre_forum_thr ead` , CHANGE, `subj e ct` ,
`subject` , char () , NOT, NULL;
Copy code
Two modify the number of JS verification characters to find theline of file static/js/forum_postjs
If (($(postsubmit) name! =replysubmit&&! ($(postsubmit) name==editsubmit&&&&isfirstpost!) =="theformsubjectvalue")| | ! Sortid & & special ; & & trim! (message) = = "{"); showError (sorry, you have not entered the title orcontent) ;
; return; false;
} else, if (mb_strlen (theformsubjectvalue) >) {showError; (your title is more than a character limit) ;
; return; false;
}
Copy code
Modify to
If (($(postsubmit) name! =replysubmit&&! ($(postsubmit) name==editsubmit&&&&isfirstpost!) =="theformsubjectvalue")| | ! Sortid & & special ; & & trim! (message) = = "{"); showError (sorry, you have not entered the title orcontent) ;
; return; false;
} else, if (mb_strlen (theformsubjectvalue) >) {showError; (your title is more than a character limit) ;; return; false;
}
Copy code
Find the file to line code for file sitatic/js/forumjs:If (theformmessagevalue = = && theformsubjectvalue = = {)
s;   = sorry, you have not entered the title or content;theformmes sagefocus; () ;
} else, if (mb_strlen (theformsubjectvalue) >) {s; = your title is more than a character limit;
& nbsp; theformsubjectfocus () ;
& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; }
复制代码
修改为
I f (theformmessagevalue ==& & theformsubj ectvalue= =) {
& nb sp; & nbsp; s =抱歉您尚未输入标题或内容;
& nbsp; & nbsp; theformmessagefocus () ;
& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; } else if (MB_ strlen (theformsubjectvalue) >) {
& nb sp; & nbsp; s =您的标题超过个字符的限制;
& nbsp; & nbsp; theformsubjectfocus () ;
& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; }
复制代码
三修改模板中写死的字符限制数
找到文件templatedefaultforumpost _ editor_ extrahtm的到行& nbsp;
<! {if $_ G [GP _action] . = reply}
< span > < input type= "text" name = "subject" id = "subject"class = "PX" value = "$postinfo [sucapabiwww. 199ge.comlitiesthe long bit mask of driver capabilities.bject] {if $_G [GP_action] ==newthread} onblur=" if ($(tags relatekw)) { ({if$_G [group] [allowposttag] } function () {extracheck () } {/if}) ; Doane () ; } {if} / style = "width:" tabIndex = "/ > < /span >
<! {else}
< span id = "subjecthide" class = "Z" > re: $thread [subject][< a href = "javascript: ;" > {Lang} < / a >Modify] < / span >Id= "< span style=" subjectbox"display: None" > < input type
= "text" name = "subject" id = "subject" class = "PX" value ="" style = "width:" / > < / span >
<! {if} /
< span id= "subjectchk" {if$_G [GP_action] ==reply} style= "display: None" {if} > {Lang / comment _message} < strongid="checklen" > </strong> {Lang comment_message} </span>& nbsp;
复制代码
修改为下面代码
& nbsp;
<! {if $_ G [GP _action] . = reply}
< span > < input type= "text" name = "subject" id = "subject"class="PX"value="$postinfo [subject]" {if$_G [GP_action]==newthread} onb lur="if ($(tags) ) {relatekw ({if$_G[group][allowposttag] } function () {extracheck () } {/ if} ) ; Doane () ; }{if} / style =" width: "tabIndex =" / > < / span >
<! {else}
< span id = "subjecthide" class = "Z" > re: $thread [subject][< a href = "javascript: ;" > {Lang} < / a >Modify] < / span >Id= "< span style=" subjectbox"display: None" > < input type
= "text" name = "subject" id = "subject" class = "PX" value ="" style = "width:" / > < / span >
<! {if} /
< span id= "subjectchk" {if$_G [GP_action] ==reply} style= "display: None" {if} > {Lang / comment _message} < strongid = "checklen" > < / strongprivate const Max _ ide _driveswww.mnmm8. comas long =4 "max number of drives assumingprimary / secondary, master / slave topology > {Lang comment_ message} < / span >
复制代码
找到文件templatedefaultforumforumdi splay _ fastposthtm行< input type = "text" id = "subject" name = "subject" class ="PX" value = "" tabIndex = "" style = "width:" / >
< span > {Lang comment _ message} < strong id = "checklen" >< / strong > {Lang comment _ message} < / span >
复制代码
修改为
<输入类型“文本” id= “主体” name= “主体” c lass= “PX”值= “=” “=”风格的Tab Index宽度 EM” />
<span> {郎comment_message }组ID= “checklen” > </strong> {郎comment_message } < /跨度>
复制代码
四修改函数验证提示
找到文件源/功能/ funct ion_postphp的行
如果dstrlen $ > {
返回post_subject_toolong
}
复制代码
修改为
如果dstrlen $ > {
返回post_subject_toolong
}
复制代码
五找到语言包提示文字打开源/语言/ lang_messegephp并找到行改为
    post_subject_toolong= >抱歉您的标题超过个字符修改标题长度
复制代码
好的你再发表帖子标题就可以是个字符数了
ftlcloud怎么样?ftlcloud(超云)目前正在搞暑假促销,美国圣何塞数据中心的云服务器低至9元/月,系统盘与数据盘分离,支持Windows和Linux,免费防御CC攻击,自带10Gbps的DDoS防御。FTL-超云服务器的主要特色:稳定、安全、弹性、高性能的云端计算服务,快速部署,并且可根据业务需要扩展计算能力,按需付费,节约成本,提高资源的有效利用率。点击进入:ftlcloud官方网站...
今天看到一个网友从原来虚拟主机准备转移至服务器管理自己的业务。这里问到虚拟主机和服务器到底有什么不同,需要用到哪些工具软件。那准备在下班之间稍微摸鱼一下整理我们服务器安装环境和运维管理中常见需要用到的软件工具推荐。第一、系统镜像软件一般来说,我们云服务器或者独立服务器都是有自带镜像的。我们只需要选择镜像安装就可以,比如有 Windows和Linux。但是有些时候我们可能需要自定义镜像的高级玩法,这...
哪里购买香港云服务器便宜?众所周知,国内购买云服务器大多数用户会选择阿里云或腾讯云,但是阿里云香港云服务器不仅平时没有优惠,就连双十一、618、开年采购节这些活动也很少给出优惠。那么,腾讯云虽然海外云有优惠活动,但仅限新用户,购买过腾讯云服务器的用户就不会有优惠了。那么,我们如果想买香港云服务器,怎么样购买香港云服务器便宜和优惠呢?下面,云服务器网(yuntue.com)小编就介绍一下!我们都知道...