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

標題: discuz x3.2 標題字符從80改成160的方法 [打印本頁]

作者: IT_man    時間: 2015-1-21 10:13
標題: discuz x3.2 標題字符從80改成160的方法
==========================================================
3 `6 K4 |/ _4 k- t  C# ]! L一、database修改,標題字數(英文字1Byte,中文2Bytes)為160字符:執行sql command:
0 z6 i3 h5 b$ V  x% V) S( A+ ~(注意改為你的表前缀)
$ q! [# Q- s. k$ P: |: I
ALTER TABLE `pre_forum_post` CHANGE `subject` `subject` VARCHAR(120) NOT NULL;
2 \5 Q' I" c; g; FALTER TABLE `pre_forum_rsscache` CHANGE `subject` `subject` char(120) NOT NULL;: U; b9 l" M5 Z% O. O- D) c
ALTER TABLE `pre_forum_thread` CHANGE `subject` `subject` char(120) NOT NULL;# Z/ M4 L8 B9 ?5 L
6 d8 o. D2 n3 l2 v2 S
或用phpdbadmin更改也可以) s. u* W, X1 u0 N# }6 ^; G
==========================================================: S* O) a! [: \) ^( m
二、修改JS驗證字符數:$ G9 s( b. M; W/ [( S+ j# P! s+ E
1、找到 static/js/forum_post.js的74-80行
   
4 i- U8 W, B' C- T, h9 T' D1 yif(($('postsubmit').name != 'replysubmit' && !($('postsubmit').name == 'editsubmit' && !isfirstpost) && theform.subject.value == "") || !sortid && !special && trim(message) == "") {
" V& b6 [' n5 i! h: E                showError('抱歉,您尚未輸入標題或內容);
1 s% l" j: r$ w, H                return false;
4 w* K9 V5 V% o' q5 |        } else if(mb_strlen(theform.subject.value) > 80) {
* d& I' w  ~8 w% ]. `( A# F                showError('您的標題超過 80 個字符的限制');* p# y; b0 N, M1 o( {9 A
                return false;! A4 P1 R+ E6 U* l. q; a6 F1 u
        }
- o8 z! m, g4 N. A
# y" z. e3 p) c# k7 Q! u0 x6 ]% `數字80改為160  Y) Z- k/ ?+ ?- {2 E
==========================================================
$ j5 J  v4 g! l3 A, y2、找到 sitatic/js/forum.js的209到215行:$ P  M# Y7 K- ^% N3 X7 m7 G
if(theform.message.value == '' && theform.subject.value == '') {3 ]- }+ I! w; }5 b% v" w+ s
                s = '抱歉,您尚未輸入標題或內容';" T8 y3 u. ]  w+ ]2 P2 n$ N
                theform.message.focus();1 G+ ~# M! i: J  y
        } else if(mb_strlen(theform.subject.value) > 80) {+ L, d' g+ r# b# }1 }: `6 _
                s = '您的標題超過 80 個字符的限制';8 Q4 G* a- c# E0 H& w
                theform.subject.focus();
; C9 S$ i5 W; x" O- n        }
5 ?5 _/ Q' G) z- Z* ]- j3 W2 ~5 U6 n7 [+ r! y

+ U& `: V  Y. r  V" T/ y( @$ e數字80改為1608 _! ?; k- {8 l) j$ v
==========================================================  d# o1 ^. v% c: H; |8 T" V
三、修改模板中寫死的字數限制:5 o) U" f6 S9 \1 b
1、找到 template\default\forum\post_editor_extra.htm第25行開始
9 ?. t# x- T0 _& q+ [1 @8 D修改前

0 H- B) w, T& @( R                        <!--{if $_GET[action] != 'reply'}--
+ P9 V; R0 k+ c4 `; n! T" V                                <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>
% v# _) B$ y7 z2 n8 a* B3 E: j                        <!--{else}--><!--reply-->$ |1 f, K, F1 R0 D. @1 {7 j
                                <span id="subjecthide" class="z">RE: $thread[subject] [<a href="javascript:;"#ff0000">80);return false;">{lang modify}</a>]</span>
  O! U/ n4 p. \8 f                                <span id="subjectbox" style="display:none"><input type="text" name="subject" id="subject" class="px" value=""#ff0000">80);" style="width: 25em" /></span>% M! U9 a; d! m  N" r# m2 B, W3 B
                        <!--{/if}-->                        ) E8 l8 Q! }3 y. w6 [0 R
                        <span id="subjectchk"{if $_GET[action] == 'reply'} style="display:none"{/if}>{lang comment_message1} <strong id="checklen">80</strong> {lang comment_message2}</span>
& h1 ~: |$ n% O) E# x7 g" S                        <script type="text/javascript">strLenCalc($('subject'), 'checklen', 80)</script>
7 q/ C5 E, k2 j+ c1 x1 H+ D
, h+ P! ^- P! R$ X- b2 g5 f將紅色數字改為1608 X; U9 K0 b/ T5 P  s- J' A
==========================================================
& v. B( s+ m3 l; P! T$ |2.找到 template\default\forum\forumdisplay_fastpost.htm 地31行開始
" ^! U' Q$ G9 O7 |" }  U6 B9 q修改前
; ^- f% X+ E& `" h
                                <input type="text" id="subject" name="subject" class="px" value=""#ff0000">80);" tabindex="11" style="width: 25em" />
2 G- Q& a( K# |' U                                <span>{lang comment_message1} <strong id="checklen">80</strong> {lang comment_message2}</span>, K8 w* k1 S) y8 W
9 s: T/ v) I, b( x: s5 B" p* p9 W4 X# ~3 L
將紅色數字80改為160,第二個80可改可不改
2 Z- U4 \' N' _' \# T% M$ }9 w==========================================================
8 g6 q0 z# Z7 t/ p5 o' q四,修改function驗證提示:
) y( B: S( ]/ D* Csource/function/function_post.php的361-363行:9 C' N; Q( K9 M- f0 j2 q$ M$ ?
修改前$ s. e, j/ g# a4 T% n
if(dstrlen($subject) > 80) {
# `; |% q9 I& _  W  C$ A. Vreturn 'post_subject_toolong';2 y" _. o3 ^( E- [2 g# A
}8 M% G' d2 k$ r4 H0 f  f) [7 ]! w- I
將數字80改為160
* u, Z! M" X& }1 ^) e3 v! v4 Z==========================================================+ y! x/ I  o4 H6 ?  E+ e
五、找到訊息提示文字的php檔,打開 source/language/lang_messege.php 找到998行改為:
" O" d6 ~4 e0 _" b& \# A2 z% Z  'post_subject_toolong' => '抱歉,您的標題超過 160 個字符修改標題長度',2 T  u! o. w/ Z- J: l- e5 O
==========================================================
: L6 p# Z& ?' K+ p8 P7 Y( ?上面五個步驟完成記得最後最重要的一個步驟是到後台更新緩存才會生效喔
+ @# {& g; f8 G- w  T$ _( t; c




歡迎光臨 52AV手機A片王|52AV.ONE (https://www.itech.casa/) Powered by Discuz! X3.2