tid=1241& 本帖最後由 IT_man 於 2015-2-6 13:24 編輯
+ | l2 s' }8 K# K' s' r6 T3 S) F. x. |& } [) f; p
如何讓樓主帖始終在每頁的最上面 / F3 m- \' b& m K( I5 X
8 d$ X. ?( V" t% [
1.找到:source\module\forum目錄下forum_viewthread.php檔% R& Q9 M! I3 j! |4 r' i
% H2 b0 w' {* _8 ^. s
- h/ Q& A: R% w 找到:2 L' G5 ?* H- A: F$ e
- <blockquote>$_G['forum_thread']['replies'] = $temp_reply;
複製代碼 在下面添加代碼:
c: w/ H: ~: `) i- $threaDPId=0;
6 H z% {" J x! D! i& {" x - & s4 O9 G) M; X, I. C
- if($_G['page']>1){
8 O0 L7 I7 u6 V! W, A: X4 S - " F( H0 G+ t( b0 A5 l( b
- $post=DB::fetch_first("SELECT p.* FROM ".DB::table("forum_post")." p WHERE p.tid='{$_G['tid']}' AND p.first=1 limit 1");
* v4 ~, J% Z9 g. } - 9 X2 j4 ^3 M, e: s
- if($post){9 L( Z" S# u7 {" ]# R
- r# X R8 ?) @. @ M8 H+ v: u- $threaDPId=$post['pid'];1 A4 V- d5 g$ \' r, h
- 2 w, H6 [- [# L( [, Y7 n
- if(($onlyauthoradd && $post['anonymous'] == 0) || !$onlyauthoradd) {
/ A( w2 f6 x; q B* H - $ a. m! ]5 I9 u7 o+ J2 E
- $postlist[$post['pid']] = $post;
; u8 b/ J1 B& {* S* P a; `( k - 5 x r4 @0 _' {( k: L, y- o9 m
- $postusers[$post['authorid']] = array();
[' k0 \6 q/ ^. F- B* b o4 N
* m1 ~% \" m1 f7 ^- if($post['first']) {7 Y4 @# P% r `$ i! }, ]2 I
- j1 j1 P8 U& t; K9 f
- $_G['forum_firstpid'] = $post['pid'];
7 x% z* r3 q, n0 H, L6 a7 a4 T
8 b0 H3 K. c; M3 y. s2 j3 z- $metadescription = str_replace(array("\r", "\n"), '', messagecutstr(strip_tags($post['message']), 160));5 _: }. m4 q% l4 s- c( c4 u# o* ^
4 P* n# ~) z) K' i3 a1 h- }
! B7 y8 A( M! a7 e1 w+ F - }
" D: M3 E( M# w/ w - 7 z0 \) K' I1 _2 ]
- }- ^+ q- x9 K9 `8 {1 O0 M
- , G: Y w2 j. ]4 n- u
- }' u$ V# I1 ^& P
複製代碼 OK,緩存都不用更新。重新載入網頁就OK啦...
0 R4 Y9 L& ^! r0 ?
9 C( f9 ^# {( z, S. O, z( H) p# h6 g$ ?
' ~5 K! t: A, S, U$ I
|