代码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= >抱歉您的标题超过个字符修改标题长度

复制代码

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

云步云72.5元/月起云服务器,香港安畅/葵湾/将军澳/沙田/大浦CN2机房,2核2G5M

云步云怎么样?云步云是创建于2021年的品牌,主要从事出售香港vps、美国VPS、日本VPS、香港独立服务器、香港站群服务器等,机房有香港、美国、日本东京等机房,目前在售VPS线路有CN2+BGP、CN2 GIA,香港的线路也是CN2直连大陆,该公司旗下产品均采用KVM虚拟化架构。目前,云步云提供香港安畅、沙田、大浦、葵湾、将军澳、新世界等CN2机房云服务器,2核2G5M仅72.5元/月起。点击进...

virmach:3.23美元用6个月,10G硬盘/VirMach1核6个月Virmach

virmach这是第二波出这种一次性周期的VPS了,只需要缴费1一次即可,用完即抛,也不允许你在后面续费。本次促销的是美国西海岸的圣何塞和美国东海岸的水牛城,周期为6个月,过后VPS会被自动且是强制性取消。需要临时玩玩的,又不想多花钱的用户,可以考虑下!官方网站:https://www.virmach.comTemporary Length Service Specials圣何塞VPS-一次性6个...

弘速云(28元/月)香港葵湾2核2G10M云服务器

弘速云怎么样?弘速云是创建于2021年的品牌,运营该品牌的公司HOSU LIMITED(中文名称弘速科技有限公司)公司成立于2021年国内公司注册于2019年。HOSU LIMITED主要从事出售香港vps、美国VPS、香港独立服务器、香港站群服务器等,目前在售VPS线路有CN2+BGP、CN2 GIA,该公司旗下产品均采用KVM虚拟化架构。可联系商家代安装iso系统,目前推出全场vps新开7折,...

discuz!x2.5为你推荐
戴尔智能数据管理iprouteip route 0.0.0.0 0.0.0.0 s0/0/0 中s0/0/0 指的是本地的还是??googlepr谷歌 PR值是什么意思filezillaserverFileZilla Server 搭建的FTP服务器企业电子邮局企业邮箱怎么使用?企业信息查询系统查企业信息哪个的软件好?ipad代理想买个ipad,3000至4000元左右有什么好的中国保健养猪网猪场基本保健包括哪些方面?400电话查询400电话。如何查询真伪,费用?美国独立美国独立战争的概况
vps侦探 花生壳免费域名申请 互联网域名管理办法 plesk 外贸主机 浙江独立 免费全能空间 bgp双线 中国电信测网速 免费活动 网络空间租赁 免费测手机号 服务器论坛 防cc攻击 websitepanel alertpay 连连支付 screen 免费php空间申请 更多