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= >抱歉您的标题超过个字符修改标题长度
复制代码
好的你再发表帖子标题就可以是个字符数了
官方网站:https://www.shuhost.com/公司名:LucidaCloud Limited尊敬的新老客户:艰难的2021年即将结束,年终辞旧迎新之际,我们准备了持续优惠、及首月优惠,为中小企业及个人客户降低IT业务成本。我们将持续努力提供给客户更好的品质与服务,在新的一年期待与您有美好的合作。# 下列价钱首月八折优惠码: 20211280OFF (每客户限用1次) * 自助购买可复制...
VirMach,成立于2014年的美国IDC商家,知名的低价便宜VPS销售商,支持支付宝、微信、PayPal等方式付款购买,主打美国、欧洲暑假中心产品,拥有包括洛杉矶、西雅图、圣何塞、凤凰城在内的11个数据中心可以选择,可以自由搭配1Gbps、2Gbps、10Gbps带宽端口,有Voxility DDoS高防IP可以选择(500Gbps以上的防御能力),并且支持在控制面板付费切换机房和更换IP(带...
imidc怎么样?imidc彩虹数据或彩虹网络现在促销旗下日本多IP站群独立服务器,原价159美元的机器现在只需要88美元,而且给13个独立IPv4,30Mbps直连带宽,不限制月流量!IMIDC又名为彩虹数据,rainbow cloud,香港本土运营商,全线产品都是商家自营的,自有IP网络资源等,提供的产品包括VPS主机、独立服务器、站群独立服务器等,数据中心区域包括香港、日本、台湾、美国和南非...