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= >抱歉您的标题超过个字符修改标题长度
复制代码
好的你再发表帖子标题就可以是个字符数了
HostNamaste是一家成立于2016年3月的印度IDC商家,目前有美国洛杉矶、达拉斯、杰克逊维尔、法国鲁贝、俄罗斯莫斯科、印度孟买、加拿大魁北克机房。其中洛杉矶是Quadranet也就是我们常说的QN机房(也有CC机房,可发工单让客服改机房);达拉斯是ColoCrossing也就是我们常说的CC机房;杰克逊维尔和法国鲁贝是OVH的高防机房。采用主流的OpenVZ和KVM架构,支持ipv6,免...
小白云是一家国人自营的企业IDC,主营国内外VPS,致力于让每一个用户都能轻松、快速、经济地享受高端的服务,成立于2019年,拥有国内大带宽高防御的特点,专注于DDoS/CC等攻击的防护;海外线路精选纯CN2线路,以确保用户体验的首选线路,商家线上多名客服一对一解决处理用户的问题,提供7*24无人全自动化服务。商家承诺绝不超开,以用户体验为中心为用提供服务,一直坚持主打以产品质量用户体验性以及高效...
GreenCloudVPS最近在新加坡DC2节点上了新机器,Dual Xeon Silver 4216 CPU,DDR4内存,10Gbps网络端口,推出了几款大硬盘VPS套餐,基于KVM架构,500GB磁盘起年付30美元。除了大硬盘套餐外,还加推了几款采用NVMe硬盘的常规套餐,最低年付20美元。不过需要提醒的是,机房非直连中国,尤其是电信用户ping值感人,包括新加坡DC1也是如此。大硬盘VPS...