代码discuz! x2.5论坛标题字数突破80的限制(Discuz! X2.5 forum title, word break 80 limit)

discuz!x2.5  时间:2021-03-20  阅读:()

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 & &amp 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 & &amp 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; &nbsp = 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并找到行改为

&nbsp &nbsp post_subject_toolong= >抱歉您的标题超过个字符修改标题长度

复制代码

好的你再发表帖子标题就可以是个字符数了  

HostKvm:香港国际/韩国KVM夏季7折,2G内存套餐月付5.95美元起

HostKvm是一家成立于2013年的国外主机服务商,主要提供基于KVM架构的VPS主机,可选数据中心包括日本、新加坡、韩国、美国、中国香港等多个地区机房,均为国内直连或优化线路,延迟较低,适合建站或者远程办公等。目前商家发布了夏季特别促销活动,针对香港国际/韩国机房VPS主机提供7折优惠码,其他机房全场8折,优惠后2GB内存套餐月付5.95美元起。下面分别列出几款主机套餐配置信息。套餐:韩国KR...

atcloud:480G超高防御VPS低至$4/月,美国/新加坡等6机房,512m内存/1核/500g硬盘/不限流量

atcloud主要提供常规cloud(VPS)和storage(大硬盘存储)系列VPS,其数据中心分布在美国(俄勒冈、弗吉尼亚)、加拿大、英国、法国、德国、新加坡,所有VPS默认提供480Gbps的超高DDoS防御+不限流量,杜绝DDoS攻击骚扰,比较适合海外建站等相关业务。ATCLOUD.NET是一家成立于2020年的海外主机商,主要提供KVM架构的VPS产品、LXC容器化产品、权威DNS智能解...

创梦网络-新上雅安电信200G防护值内死扛,无视CC攻击,E5 32核高配/32G内存/1TB SSD/100Mbps独享物理机,原价1299,年未上新促销6折,仅779.4/月,续费同价

创梦网络怎么样,创梦网络公司位于四川省达州市,属于四川本地企业,资质齐全,IDC/ISP均有,从创梦网络这边租的服务器均可以****,属于一手资源,高防机柜、大带宽、高防IP业务,另外创梦网络近期还会上线四川眉山联通、广东优化线路高防机柜,CN2专线相关业务。广东电信大带宽近期可以预约机柜了,成都优化线路,机柜租用、服务器云服务器租用,适合建站做游戏,不须要在套CDN,全国访问快,直连省骨干,大网...

discuz!x2.5为你推荐
就会server支持ipad操作httpcuteftp什么是CuteFTP?如何将网站内容上传(FTP)到网站空间?asp.net网页制作如何用ASP.NET做网站?三友网广州三友集团在韶关分公司么?腾讯公司电话腾讯公司总部电话多少三五互联股票三五互联是干什么的?佛山海虹海虹蒸多长时间美国独立美国独立战争
域名升级访问 日本私人vps 域名服务器的作用 什么是域名解析 金万维动态域名 安云加速器 512m 淘宝双十一2018 xen 免费ddos防火墙 中国特价网 促正网秒杀 阿里校园 linux服务器系统 西部数码主机 连连支付 天鹰抗ddos防火墙 次时代主机 戴尔主机 如何架设服务器 更多