52AV手機A片王|52AV.one

 找回密碼
 立即註冊
查看: 1785|回復: 0

[HTML] discuz x3.2 標題字符從80改成160的方法

[複製鏈接]
發表於 2015-1-21 10:13:49 | 顯示全部樓層 |閱讀模式
tid=392&==========================================================9 J" ]0 o# X8 J- Z  l# b# ]. \, C
一、database修改,標題字數(英文字1Byte,中文2Bytes)為160字符:執行sql command:
5 }+ ^# U1 t! g# W% O$ h(注意改為你的表前缀)

( B* J- e: j" ~; k9 R. wALTER TABLE `pre_forum_post` CHANGE `subject` `subject` VARCHAR(120) NOT NULL;
' X; v8 X5 |6 a4 |2 F1 }ALTER TABLE `pre_forum_rsscache` CHANGE `subject` `subject` char(120) NOT NULL;% n6 F, D9 U5 y6 I7 I
ALTER TABLE `pre_forum_thread` CHANGE `subject` `subject` char(120) NOT NULL;
, p' u% @0 I0 O4 Y% l5 }5 |' \
) n. {- s/ T" L: _5 {! L或用phpdbadmin更改也可以$ a7 w+ Q' k! B' _& s; |; r
==========================================================& U6 s! B1 ^% t5 ~+ f2 m; |# Y0 S
二、修改JS驗證字符數:
) z% |8 v* _' W1、找到 static/js/forum_post.js的74-80行
   / t3 M* k+ n  ]/ C0 y$ G
if(($('postsubmit').name != 'replysubmit' && !($('postsubmit').name == 'editsubmit' && !isfirstpost) && theform.subject.value == "") || !sortid && !special && trim(message) == "") {/ J& q& f7 P0 Y0 U# J& O7 m
                showError('抱歉,您尚未輸入標題或內容);7 W, W5 l8 x/ j( V4 ?' r
                return false;
# l) c7 S8 @1 N1 E2 W/ z        } else if(mb_strlen(theform.subject.value) > 80) {3 T! {/ g- f2 F
                showError('您的標題超過 80 個字符的限制');
9 A% V0 R" F* l/ e0 o                return false;
- G0 \& X& d: k( j7 J        }0 N6 {! x* D- I1 a
, h6 P% |+ i7 X& b+ Y( P( u" n
數字80改為1600 f; t3 \% W* r& \
==========================================================
& U4 O: e) X9 l, e8 S" w2、找到 sitatic/js/forum.js的209到215行:5 n1 b2 [9 ]% _9 G
if(theform.message.value == '' && theform.subject.value == '') {
2 L* v7 U: f& Z7 l/ Q                s = '抱歉,您尚未輸入標題或內容';) O/ o6 I/ t$ x: Z2 _
                theform.message.focus();
: ~3 T/ |0 \) }' d" Q" K- d2 o        } else if(mb_strlen(theform.subject.value) > 80) {
( k3 ^3 i7 |4 w2 \4 O                s = '您的標題超過 80 個字符的限制';
, Q, a6 u& A8 a# K( H; o0 Q: n/ I% q                theform.subject.focus();
* T4 Z( I0 S6 x" L; F# M        }- M; o% _  a1 h
4 z' S- f; F+ ?1 q) g
! B2 J; T) e4 d# F& _5 ~8 R0 Y
數字80改為160
+ h# A! a' |, v+ i==========================================================
- R$ u" m+ Z3 P% m+ M三、修改模板中寫死的字數限制:
* b5 k& |7 M5 D6 a1、找到 template\default\forum\post_editor_extra.htm第25行開始
$ H' @+ }2 E' _! p7 T, e修改前

- Z/ M$ Q  y7 d$ d( C                        <!--{if $_GET[action] != 'reply'}--
/ n, R0 n& |. ^; a6 O8 y. w                                <span><input type="text" name="subject" id="subject" class="px" value="$postinfo[subject]" {if $_GET[action] == 'newthread'}onblur="if($('tags')){relatekw('-1','-1'{if $_G['group']['allowposttag']},function(){extraCheck(4)}{/if});doane();}"{/if}#ff0000">80);" style="width: 25em" tabindex="1" /></span>+ C  O# f( v& ?& i- R4 M
                        <!--{else}--><!--reply-->
1 F* R+ Y3 W0 x% ?8 u& p9 p* ~                                <span id="subjecthide" class="z">RE: $thread[subject] [<a href="javascript:;"#ff0000">80);return false;">{lang modify}</a>]</span>2 y$ y4 w: ?8 o- ]# a4 I% `
                                <span id="subjectbox" style="display:none"><input type="text" name="subject" id="subject" class="px" value=""#ff0000">80);" style="width: 25em" /></span>
4 y8 c1 [  j2 |; k  G                        <!--{/if}-->                        * d; ?0 i4 x8 W. i  c  H( D! z
                        <span id="subjectchk"{if $_GET[action] == 'reply'} style="display:none"{/if}>{lang comment_message1} <strong id="checklen">80</strong> {lang comment_message2}</span>
& \  @' D/ I  J! a. G                        <script type="text/javascript">strLenCalc($('subject'), 'checklen', 80)</script>  o5 ~/ Y( O0 s8 t

$ M, [3 L. i! i$ l5 i將紅色數字改為160: i. M8 W' e' b+ o
==========================================================
, }  K2 a  r* H2.找到 template\default\forum\forumdisplay_fastpost.htm 地31行開始  U8 I* B) R9 [# e0 p2 d# N
修改前
( y+ I- }, t0 N# d+ A) h
                                <input type="text" id="subject" name="subject" class="px" value=""#ff0000">80);" tabindex="11" style="width: 25em" />
' T! E5 [6 G2 B8 ^                                <span>{lang comment_message1} <strong id="checklen">80</strong> {lang comment_message2}</span>
+ W+ q  D; L" A, L6 v! L5 v" i& B8 l' S% W7 {! n' h. x
將紅色數字80改為160,第二個80可改可不改
; C8 `, ]7 s7 k- D! A) ?==========================================================5 S. \! v" b- s
四,修改function驗證提示:
- r' m0 D' Y. C2 _9 b7 ?source/function/function_post.php的361-363行:/ N, X! Q% N- x; |3 ~
修改前0 y. g, X" X" E6 \! W9 N
if(dstrlen($subject) > 80) {
% n6 G+ [) q3 V0 L$ }0 dreturn 'post_subject_toolong';2 E( Z- M7 l, `9 |, j* M
}8 U# Y7 O! I) a+ M' K( N$ t
將數字80改為1609 P$ G$ ?6 k4 I! q% y" L- K: }' d, u; T
==========================================================  l# Q5 `/ X& ]
五、找到訊息提示文字的php檔,打開 source/language/lang_messege.php 找到998行改為:
/ Q1 I  x6 o2 Q: I  'post_subject_toolong' => '抱歉,您的標題超過 160 個字符修改標題長度',
5 L1 P# P7 ]+ ~( |" F1 \  w4 e" u==========================================================$ V! a3 e1 c1 l/ m$ D0 W
上面五個步驟完成記得最後最重要的一個步驟是到後台更新緩存才會生效喔
6 }/ k) q) B4 ]* }
9 T+ a% j- Y6 _+ u# L& U7 ^3 N# B" ^- C8 t" j6 ]' y+ z7 D
, i) G. z) d- }' U3 g
回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則



中文酷站排行榜

本區塊內容依據『電腦網路內容分級處理辦法』為限制級網站,限定年滿18歲以上或達當地國家法定年齡人士方可進入,且願接受本站各項條款,未滿18歲 謝絕進入瀏覽。為防範未滿18歲之未成年網友瀏覽網路上限制級內容的圖文資訊,建議您可進行網路內容分級組織ICRA分級服務的安裝與設定。 (為還給愛護 本站的網友一個純淨的論壇環境,本站設有管理員)

QQ|小黑屋|手機板| 52AV手機A片王

GMT+8, 2025-12-14 03:08 , Processed in 0.073212 second(s), 16 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回復 返回頂部 返回列表