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

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

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

[複製鏈接]
發表於 2015-1-21 10:13:49 | 顯示全部樓層 |閱讀模式
tid=392&==========================================================2 Z: `2 ?+ V$ t  z) }3 M
一、database修改,標題字數(英文字1Byte,中文2Bytes)為160字符:執行sql command:7 N+ I+ q# A7 ~; ~( F
(注意改為你的表前缀)
8 X% a0 C& S* {, Q- j# q
ALTER TABLE `pre_forum_post` CHANGE `subject` `subject` VARCHAR(120) NOT NULL;
; f) g" I* ^5 j0 s4 xALTER TABLE `pre_forum_rsscache` CHANGE `subject` `subject` char(120) NOT NULL;
4 h1 q6 q4 a* KALTER TABLE `pre_forum_thread` CHANGE `subject` `subject` char(120) NOT NULL;
2 f/ ?  g* c7 V$ p0 \
1 Y; |& }% U5 Z5 l: t: |' h# V$ d或用phpdbadmin更改也可以
2 W# K: @% b. U. S) _3 H* @  q==========================================================
) R& Y; A9 J5 A; r3 r5 l# F9 }二、修改JS驗證字符數:( c; J% n) r3 I) J( B5 ^& O
1、找到 static/js/forum_post.js的74-80行
   
$ E1 {1 \8 m" I3 q: ^if(($('postsubmit').name != 'replysubmit' && !($('postsubmit').name == 'editsubmit' && !isfirstpost) && theform.subject.value == "") || !sortid && !special && trim(message) == "") {
1 |, G8 l) w; S$ S# B+ R$ X) p) G9 v                showError('抱歉,您尚未輸入標題或內容);
! H2 o9 O$ y: |. {                return false;9 t/ B2 X( `9 j, n& Y( V
        } else if(mb_strlen(theform.subject.value) > 80) {) o9 o. B. X* P2 \$ w- e: V
                showError('您的標題超過 80 個字符的限制');, Z4 x/ C, p- P0 w. P% G$ s' \: g: R
                return false;
! D  a& w# S2 _) V4 w2 W        }4 a9 I4 |/ e) f, I

/ a; Y2 q/ D. i# S" [! c數字80改為1605 X  q3 L0 d/ b' A! g
==========================================================
, k  j( H$ P* z% a- R" @$ H2、找到 sitatic/js/forum.js的209到215行:: M6 a  F2 w, P9 t7 Z7 q) r5 `  c
if(theform.message.value == '' && theform.subject.value == '') {
- |5 t6 }% z, K& W% d* p. x                s = '抱歉,您尚未輸入標題或內容';; |- P6 C# C- w; s, p6 d: R
                theform.message.focus();1 `! Z5 O: m4 a  D( f2 X
        } else if(mb_strlen(theform.subject.value) > 80) {
# g' W, w% `9 x9 d  }                s = '您的標題超過 80 個字符的限制';
) \, y9 ^# B  A4 t5 Y4 @                theform.subject.focus();
8 z7 ~' `* x+ Z        }$ w5 ^5 Y  T% ?" D  w+ q
. N7 R6 R/ n# b) h5 B; ^4 p
. U* A% A9 l0 g
數字80改為160* H, f+ {( ^1 l# r0 ~, @5 b
==========================================================( p/ k! k9 X# \
三、修改模板中寫死的字數限制:) x' J; x( D; N1 S. p: m# R9 K
1、找到 template\default\forum\post_editor_extra.htm第25行開始
6 j- _1 o0 m7 C6 y& |$ u6 ^9 U修改前

: g7 M, a* U+ ]% s                        <!--{if $_GET[action] != 'reply'}--
2 t& _2 r% V: g9 ?                                <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>( W* s; o6 p+ F' B
                        <!--{else}--><!--reply-->
, l, I( X/ ~1 n: O: z  {4 d                                <span id="subjecthide" class="z">RE: $thread[subject] [<a href="javascript:;"#ff0000">80);return false;">{lang modify}</a>]</span>+ q$ J+ b' J: K/ `: ^; y7 p
                                <span id="subjectbox" style="display:none"><input type="text" name="subject" id="subject" class="px" value=""#ff0000">80);" style="width: 25em" /></span>1 D, L# v& _& r. d' p1 R5 x- N* W
                        <!--{/if}-->                          i6 M: ^+ {3 E' r
                        <span id="subjectchk"{if $_GET[action] == 'reply'} style="display:none"{/if}>{lang comment_message1} <strong id="checklen">80</strong> {lang comment_message2}</span>
3 Z" ]# x) S3 h7 o) j                        <script type="text/javascript">strLenCalc($('subject'), 'checklen', 80)</script>
( m& L  m: A2 m7 S; \* C' Z, o8 t2 |% K) y( `8 i3 m; l9 H/ l( ~& ^
將紅色數字改為160% N( w, [1 s- z5 Y4 x- z# |
==========================================================2 z6 t. G6 _5 G% C- \, X
2.找到 template\default\forum\forumdisplay_fastpost.htm 地31行開始
3 k% V% m. L% E7 G( m修改前
% A7 N5 k& h+ E2 O8 ?* u+ o
                                <input type="text" id="subject" name="subject" class="px" value=""#ff0000">80);" tabindex="11" style="width: 25em" />) o& S  M# n; V) u
                                <span>{lang comment_message1} <strong id="checklen">80</strong> {lang comment_message2}</span>/ z$ ]& m6 ]: @9 w

+ }  S( |; Y/ j$ m將紅色數字80改為160,第二個80可改可不改) z' F; t: s2 B# i; a4 ?/ S6 i+ V. v
==========================================================0 H2 G+ [0 H6 @- ?- g
四,修改function驗證提示:
( P* V/ T/ D2 \1 s, jsource/function/function_post.php的361-363行:' ~6 S  A4 I# l* p/ N0 z
修改前) N" T3 A. ~  s3 {5 V
if(dstrlen($subject) > 80) {2 d$ t! [" E% G+ s9 Q
return 'post_subject_toolong';
/ N7 P& [9 a5 ?, F  ]# O4 z  e+ i}- I. e7 u; m( v/ ^# u
將數字80改為160
  {4 f2 t: v' E5 v- Q3 \% }4 A. U==========================================================
* J; a( `" J$ X: I五、找到訊息提示文字的php檔,打開 source/language/lang_messege.php 找到998行改為:% ?6 W1 c+ W$ t
  'post_subject_toolong' => '抱歉,您的標題超過 160 個字符修改標題長度',
% [/ R) q+ C( b, f( B==========================================================
+ h& i1 |6 C4 Z9 w8 \5 e上面五個步驟完成記得最後最重要的一個步驟是到後台更新緩存才會生效喔1 Z  A0 A5 x; r! j: i
' Q+ U$ R7 u/ w: d# H' \0 E( e* a) J" B

' d  {# }5 P% h
8 ~- e8 \  D; l# D, j1 h5 i
回復

使用道具 舉報

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

本版積分規則



中文酷站排行榜

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

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

GMT+8, 2026-3-24 17:42 , Processed in 0.098281 second(s), 16 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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