本帖最後由 IT_man 於 2015-2-6 13:24 編輯 0 r6 t. c+ w4 M: \. i N' u
- M- e; b9 e9 d如何讓樓主帖始終在每頁的最上面 * l% e; U) J/ m y. U+ a- N- a
: P2 q5 j0 g) t: Q$ Q: x* M
1.找到:source\module\forum目錄下forum_viewthread.php檔* H7 ~$ p* w% U6 m- v# Z
" U/ o4 f- P+ S' R8 S# V& ^
7 \+ C& b& d5 G; i1 F, q 找到:
. M6 s( r( X5 {, T- <blockquote>$_G['forum_thread']['replies'] = $temp_reply;
複製代碼 在下面添加代碼:
/ E g8 {: ]3 V4 @- $threaDPId=0;
& c, k; ^1 A0 u- r
r( p: q/ P7 ^7 M& j- if($_G['page']>1){* R5 H! j1 Q7 S
; m- ]( n- Q- [ ~- $post=DB::fetch_first("SELECT p.* FROM ".DB::table("forum_post")." p WHERE p.tid='{$_G['tid']}' AND p.first=1 limit 1");7 ~$ n# W3 w1 v7 Y y/ ^8 s
6 X2 H" ~9 M4 |' K& G7 q- h0 g- if($post){8 z, M1 a! W0 N
- " x3 }, u; c. ]7 G, H g8 q
- $threaDPId=$post['pid'];
& z- {) c2 ?- g- g+ K4 x$ v
- L% I2 q/ \7 v& {. K4 R- if(($onlyauthoradd && $post['anonymous'] == 0) || !$onlyauthoradd) {2 h' d) o; v% b; e
$ O8 m" ^ t" E( w I0 A- $postlist[$post['pid']] = $post;6 N8 y( W" ?. f" H8 d
- + P; U4 E- t! b! U5 s
- $postusers[$post['authorid']] = array();* w5 ~8 d0 f7 Z- {
- + `: r; Z( B5 O- X1 ?6 K$ N( p
- if($post['first']) {5 `% t. x3 o( m. a0 ? w$ Q
- - `$ D5 b) x& h
- $_G['forum_firstpid'] = $post['pid'];
% [% a- T: T0 L% K
& z [4 K) Z8 {- R0 I8 z& U- $metadescription = str_replace(array("\r", "\n"), '', messagecutstr(strip_tags($post['message']), 160));+ v# s1 \6 x/ Z; H) ~. ]4 H
- 9 O& A! s$ X6 f+ c* j9 ]
- }
* {0 s' e' [3 e/ y) ~" B' F- |0 y - }7 ~, k" q* C! `2 z+ f) U6 i. ~$ Q. M
- 9 D& b2 ]- B. G( B# ]9 Z/ `
- }
/ F7 g" P4 ]% S% L
9 n( @4 H* f$ H$ y7 |/ |$ V- }7 E% n: t( S* i7 Q/ x# c
複製代碼 OK,緩存都不用更新。重新載入網頁就OK啦...
; D8 r1 c b5 a3 \( x1 m! W- y7 K' I- Q4 g
" @+ B# P9 q0 C. Z3 z" W+ R. x: C# S5 B; P( P
|
|