本帖最後由 IT_man 於 2015-2-6 13:24 編輯 * G8 B9 V% W+ d' e& F* J; |
, c; ~$ y6 n" V( z
如何讓樓主帖始終在每頁的最上面
/ G% C; j- k# ?0 i0 l9 b( Q+ C" \, o$ ~* V4 `
1.找到:source\module\forum目錄下forum_viewthread.php檔* z# N9 l* C4 M3 v
. @; X" A$ S7 |: }, \4 ?8 N7 K& M5 W5 W
找到:
2 k4 s7 ~$ s6 {/ K8 @& N- <blockquote>$_G['forum_thread']['replies'] = $temp_reply;
複製代碼 在下面添加代碼:1 k( P# ~, ]5 R7 [% _
- $threaDPId=0;' p# q) Y# Y& ^4 A& w, E
- 7 K0 |! L5 E- \6 m2 Z* E" ?8 Z
- if($_G['page']>1){( k- T t" [5 n5 w6 e
- 3 }3 ?% o3 p% E
- $post=DB::fetch_first("SELECT p.* FROM ".DB::table("forum_post")." p WHERE p.tid='{$_G['tid']}' AND p.first=1 limit 1");
. s! _/ V' H% w2 g
3 \( H+ j- o1 {# y- if($post){" D# y( J1 Y+ X/ A; S
2 c: z. w& d1 a. W7 [- $threaDPId=$post['pid'];7 c& U& C, V& t: O: X' \
, x& P2 ^& Z2 P7 y) n- if(($onlyauthoradd && $post['anonymous'] == 0) || !$onlyauthoradd) {
& F; q3 \# {. g
& ]+ Y& X) x) @1 Q7 k1 w$ J- $postlist[$post['pid']] = $post;
3 p4 P+ F1 a& K t - . ]5 ]1 z% F% i* }: N1 k4 [
- $postusers[$post['authorid']] = array();
3 S/ C7 T/ K# f% S5 F2 N& L3 }
8 d8 |2 m( |) |- a$ y- if($post['first']) {$ h* E9 |7 M* V1 Q
- 6 G" c8 k2 ^3 g0 a* l' [/ z e: h$ o
- $_G['forum_firstpid'] = $post['pid'];- A) K# W" e5 }
- ( _5 K X+ ^, z6 u" c& N
- $metadescription = str_replace(array("\r", "\n"), '', messagecutstr(strip_tags($post['message']), 160));+ B! d& _- g$ m9 G ]3 L8 O" k: ^
- 6 h1 `3 F# i* B4 s. j2 s% s
- }
O, J1 U: q" _: \- n - }
* }$ F0 Y }8 ^
. V! ]. Q: W' ^8 i2 ^( i7 E- }4 Z8 P B8 K: X5 S5 V
# s: V' Y8 |8 d, y" Y: R0 i- }
6 D- m4 |) b0 L5 w5 @% g
複製代碼 OK,緩存都不用更新。重新載入網頁就OK啦...
3 x' V$ z; D3 l- `/ ^. `, o; K6 ]2 S& Z4 _- V
# w& K% J. b- p8 ]
$ K: g9 k! T0 h: K0 f
|
|