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

复制代码

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

HostNamaste$24 /年,美国独立日VPS优惠/1核1G/30GB/1Gbps不限流量/可选达拉斯和纽约机房/免费Windows系统/

HostNamaste是一家成立于2016年3月的印度IDC商家,目前有美国洛杉矶、达拉斯、杰克逊维尔、法国鲁贝、俄罗斯莫斯科、印度孟买、加拿大魁北克机房。其中洛杉矶是Quadranet也就是我们常说的QN机房(也有CC机房,可发工单让客服改机房);达拉斯是ColoCrossing也就是我们常说的CC机房;杰克逊维尔和法国鲁贝是OVH的高防机房。采用主流的OpenVZ和KVM架构,支持ipv6,免...

小白云 (80元/月),四川德阳 4核2G,山东枣庄 4核2G,美国VPS20元/月起三网CN2

小白云是一家国人自营的企业IDC,主营国内外VPS,致力于让每一个用户都能轻松、快速、经济地享受高端的服务,成立于2019年,拥有国内大带宽高防御的特点,专注于DDoS/CC等攻击的防护;海外线路精选纯CN2线路,以确保用户体验的首选线路,商家线上多名客服一对一解决处理用户的问题,提供7*24无人全自动化服务。商家承诺绝不超开,以用户体验为中心为用提供服务,一直坚持主打以产品质量用户体验性以及高效...

GreenCloudVPS($30/年),500G大硬盘VPS,10Gbps带宽

GreenCloudVPS最近在新加坡DC2节点上了新机器,Dual Xeon Silver 4216 CPU,DDR4内存,10Gbps网络端口,推出了几款大硬盘VPS套餐,基于KVM架构,500GB磁盘起年付30美元。除了大硬盘套餐外,还加推了几款采用NVMe硬盘的常规套餐,最低年付20美元。不过需要提醒的是,机房非直连中国,尤其是电信用户ping值感人,包括新加坡DC1也是如此。大硬盘VPS...

discuz!x2.5为你推荐
servererror电脑连接路由登录提示server error:401 N/A,如何处理?flashfxp下载怎样用FlashFXP从服务器下载到电脑上?flashfxp注册码谁知道 FlashFXP.rar的注册码?颁发的拼音大致的致的拼音瑞东集团中粮集团主要生产什么的?是国企么网络u盘有没有网络U盘 5G的 就像真的U盘一样的?就像下载到真U盘一样的 到自己电脑直接复制就可以拉的啊什么是seo小红妹 seo是什么意思?seo网站优化该怎 随机阅读 seo是什么意思qq挂件如何使QQ气泡和挂件成为永久的?上传软件如何将手机软件传给另外一个手机博客教程怎样做自己的博客??
虚拟主机服务商 jsp虚拟主机 国外vps租用 域名商 westhost 息壤主机 2017年黑色星期五 申请空间 服务器架设 华为网络硬盘 已备案删除域名 cdn加速是什么 中国电信测速网站 深圳域名 免费个人网页 大化网 七牛云存储 register.com qq空间打开很慢 nic 更多