tid=1241& 本帖最後由 IT_man 於 2015-2-6 13:24 編輯
9 @* G$ Q' T8 h6 t* N) @+ x1 E; ]7 E) g0 U$ L
如何讓樓主帖始終在每頁的最上面
/ {: m6 a' r+ I; _2 @0 @+ z+ i5 v9 G) @$ [( A& j* e
1.找到:source\module\forum目錄下forum_viewthread.php檔
! J) G! r( a% J) h
- O/ ], |+ B5 v% \
* D, k! ^# v |; e: }& O 找到:* s* l: C8 J" R. l1 r+ h1 v' @
- <blockquote>$_G['forum_thread']['replies'] = $temp_reply;
複製代碼 在下面添加代碼:
" X# k) ?- }4 T6 L1 o W- $threaDPId=0;# G& w5 Y: a; V" g
- " u/ X: j9 u* l5 h
- if($_G['page']>1){# G5 P( ?, n( p d" ^
/ U+ k. ^8 p/ ?; D% {- $post=DB::fetch_first("SELECT p.* FROM ".DB::table("forum_post")." p WHERE p.tid='{$_G['tid']}' AND p.first=1 limit 1");
2 L' X/ m8 t( A6 O, O - 5 N- M7 |3 z5 w9 n
- if($post){5 |% x" c" A0 x, f
. G" Y, N, j0 P3 C9 u1 Q5 d- $threaDPId=$post['pid'];
i6 {3 ~; Y. Z1 R/ y) u9 j - 3 |) q+ _9 {$ D, b
- if(($onlyauthoradd && $post['anonymous'] == 0) || !$onlyauthoradd) {
% q/ W. ~# D# L6 |' @- ~# y! c
/ B5 ]. W% o- `: r" [- $postlist[$post['pid']] = $post;
, e/ y0 Q) T" j
: H H, M% \, s. J( U4 o8 t- $postusers[$post['authorid']] = array();: `* N, w8 H4 O( m3 l
& u4 R2 s' c$ L8 z% o- if($post['first']) {) F/ ~/ i5 U7 A8 o
- 1 I: t- s6 `" h& L- B/ G- S
- $_G['forum_firstpid'] = $post['pid'];
/ ^9 p/ `# H8 D2 m
/ x2 C9 E5 }0 R- $metadescription = str_replace(array("\r", "\n"), '', messagecutstr(strip_tags($post['message']), 160));& w5 d) N! H+ D7 v3 |
8 B; s$ o1 ] A! X- }8 J0 l' x( }% t% l% m
- }& c+ z% D& b3 y' i+ E; p! K
. [ J1 Z& J# S) o- h1 C$ E4 u- }9 Y5 L/ w& m/ `, ~, h/ r
- 4 j. q: Y% ]; t0 I6 ~. b. t
- }1 U8 d, m7 S2 a! C( [1 o* I% y
複製代碼 OK,緩存都不用更新。重新載入網頁就OK啦...* @5 T7 U: L* e
6 M3 \) B9 X9 A& U7 t7 B
+ I! ?6 H) Z7 d% Z' i2 U
$ n+ J0 v. Z! P& V, d8 U, V |