tid=1241& 本帖最後由 IT_man 於 2015-2-6 13:24 編輯 6 p0 Y. `. {8 E
; t( ~& w! O$ g
如何讓樓主帖始終在每頁的最上面
" y& c/ V x# B0 `& O, p0 l, ]' n5 S6 D* o9 O. ]% q4 K
1.找到:source\module\forum目錄下forum_viewthread.php檔
+ B$ m8 `) ]$ ^8 R1 L
3 G# m3 s5 r8 N, e5 a9 u# |; Y) k Z2 B( A: `4 {
找到:
! }/ f% b$ @/ @) D" f1 S- <blockquote>$_G['forum_thread']['replies'] = $temp_reply;
複製代碼 在下面添加代碼:& p$ b5 v! @7 W) Y% l7 c' F* e4 b
- $threaDPId=0;
! r) v/ d9 z2 |; e. X - ( S4 ?2 }% m8 f; a8 X% @; j6 i: T3 p
- if($_G['page']>1){
, m6 e/ X, @1 F" Z: w) b0 ]. B
+ e, V9 A. A X5 z5 g, Y- $post=DB::fetch_first("SELECT p.* FROM ".DB::table("forum_post")." p WHERE p.tid='{$_G['tid']}' AND p.first=1 limit 1");) F$ P' ^ j5 S" B& s# |
- " r6 v0 W0 u/ W) [2 ], w) [1 q
- if($post){7 D. e: u# s1 t: l0 q3 R1 }7 Q
- 8 [; i, N% G1 I- v1 G" p
- $threaDPId=$post['pid'];
, F( `# s( x4 @) g- l
0 M8 @' L* b, k2 V4 c- if(($onlyauthoradd && $post['anonymous'] == 0) || !$onlyauthoradd) {
+ \/ ~' V3 _. |, d+ H- j2 \; i - & b1 ^9 `5 r& C- w G' g( n
- $postlist[$post['pid']] = $post;
) |( x: o' ]9 \9 d6 M
" E# F2 Q( v2 C( ?" c" x- $postusers[$post['authorid']] = array();% p! V) g5 N' r9 {0 `+ h. z( t
- 2 W4 }+ O7 W* M/ Q% m; L/ g* g t
- if($post['first']) {
( h/ I6 s# W- v0 E( ?" h
( P$ @0 ]: t o i' c, h, S& u- $_G['forum_firstpid'] = $post['pid']; [( m+ ~' ~, `
- " P/ D$ v7 i" T# _: c. v
- $metadescription = str_replace(array("\r", "\n"), '', messagecutstr(strip_tags($post['message']), 160));2 T' F3 i5 `- q0 r: i4 p
- 7 x7 E5 R2 `5 y4 d! i: B5 K: S' C
- }) ?8 Y2 w; V6 L/ U; @3 ~0 c; _& n
- }
, {5 J: T8 n F! o8 f% ~) v
. r! R* ~+ V5 i+ c# A/ f8 u: X- }9 F+ a, Q& l! X! ~1 x
" p( z P! c" o8 T- }" r0 a/ e3 G/ }2 S5 ^
複製代碼 OK,緩存都不用更新。重新載入網頁就OK啦...4 Z1 G+ d8 \8 Q
h) V( J# T# t4 W2 U
! ~0 E F) `) a# X; t2 C" I2 _$ z4 Y7 P8 q: V* m7 E3 y
|