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

复制代码

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

RAKsmart新年钜惠:E3服务器秒杀$30/月起,新上韩国服务器,香港/日本/美国站群服务器,VPS月付$1.99起,GPU服务器,高防服务器_vps香港

RAKsmart发布了新年钜惠活动,即日起到2月28日,商家每天推出限量服务器秒杀,美国服务器每月30美元起,新上了韩国服务器、GPU服务器、香港/日本/美国常规+站群服务器、1-10Gbps不限流量大带宽服务器等大量库存;VPS主机全场提供7折优惠码,同时针对部分特惠套餐无码直购每月仅1.99美元,支持使用PayPal或者支付宝等方式付款,有中英文网页及客服支持。爆款秒杀10台/天可选精品网/大...

PIGYun中秋特惠:香港/韩国VPS月付14元起

PIGYun发布了九月份及中秋节特惠活动,提供8折优惠码,本月商家主推中国香港和韩国机房,优惠后最低韩国每月14元/中国香港每月19元起。这是一家成立于2019年的国人商家,提供中国香港、韩国和美国等地区机房VPS主机,基于KVM架构,采用SSD硬盘,CN2+BGP线路(美国为CUVIP-AS9929、GIA等)。下面列出两款主机配置信息。机房:中国香港CPU:1core内存:1GB硬盘:10GB...

半月湾($59.99/年),升级带宽至200M起步 三网CN2 GIA线路

在前面的文章中就有介绍到半月湾Half Moon Bay Cloud服务商有提供洛杉矶DC5数据中心云服务器,这个堪比我们可能熟悉的某服务商,如果我们有用过的话会发现这个服务商的价格比较贵,而且一直缺货。这里,于是半月湾服务商看到机会来了,于是有新增同机房的CN2 GIA优化线路。在之前的文章中介绍到Half Moon Bay Cloud DC5机房且进行过测评。这次的变化是从原来基础的年付49....

discuz!x2.5为你推荐
队列route开启javascript启用javascript是甚么意思重庆电信断网电信光纤一直掉线,打电话问说是机房出了问题 要排查,已经一个星期了还没弄好,大概需要多久才能弄好?特朗普吐槽iPhone为什么iphone x卖的这么好开心001开心001与开心网怎么不一样,哪个是真的?爱买网超爱买网的特点中国保健养猪网猪场基本保健包括哪些方面?佛山海虹怎么分辨青口/海虹是活还是死?oa办公软件价格一般中小企业用的OA办公系统需要多少钱?什么是通配符什么是介母
免费域名空间申请 免费试用vps 域名备案只选云聚达 美国独立服务器 国外永久服务器 新世界电讯 patcha 线路工具 小米数据库 howfile 服务器合租 ftp免费空间 优酷黄金会员账号共享 web服务器搭建 ebay注册 百度云空间 服务器防火墙 supercache winds 美国vpn服务器 更多