本帖最後由 IT_man 於 2015-2-6 13:24 編輯 " E: S% u7 i2 D1 X. A' |0 F
% y4 X' o: h5 V3 U' ^6 i. }如何讓樓主帖始終在每頁的最上面 & J x- f6 [2 z0 k" o- D
& e) v: P+ M0 w
1.找到:source\module\forum目錄下forum_viewthread.php檔0 c7 U7 i/ M6 _8 V- }; l
5 o7 v) z& D3 k6 [
1 p/ _/ d* e( f. T" s' W6 I4 K 找到:9 R! B- t) W7 W( C% z4 g* o- n
- <blockquote>$_G['forum_thread']['replies'] = $temp_reply;
複製代碼 在下面添加代碼:
4 g; ?' O! L) F- $threaDPId=0;
2 v6 }# q* h v) K( @ - ! U% v- i7 R2 ~* ]) c% h
- if($_G['page']>1){
7 X3 G, c3 g9 I- D
; I# [# ?8 z* ~/ ^ t0 g- $post=DB::fetch_first("SELECT p.* FROM ".DB::table("forum_post")." p WHERE p.tid='{$_G['tid']}' AND p.first=1 limit 1");3 R/ ]% k8 x% V8 P( G
0 p) B, k) S! @) G; X( F- if($post){
4 n1 P) s( e% G% z% o& }7 D - * B; L6 x& K0 r3 i
- $threaDPId=$post['pid'];
7 Y, N p6 R: |3 h! w6 l
& Y3 ?7 G3 P# i K- if(($onlyauthoradd && $post['anonymous'] == 0) || !$onlyauthoradd) {
+ U* q5 b" e" \# Q4 _ B7 s - - |2 ?, `( }4 u% H g8 H' l
- $postlist[$post['pid']] = $post;4 j8 ^- Z2 X+ ]0 I4 T* }, J
- , w% a: N; R i1 h Y
- $postusers[$post['authorid']] = array();1 D1 ?2 f/ b9 K4 t
- ( R: ^ n* u* c0 j2 R; c
- if($post['first']) {* {: c, H0 z# `. s; ?/ g5 |
- . D% x/ |) W4 ~. g
- $_G['forum_firstpid'] = $post['pid'];
9 I) ?( h+ ?. W+ n( l% z! ~$ D( P( R$ R - " |& ^1 j$ L4 Q, L
- $metadescription = str_replace(array("\r", "\n"), '', messagecutstr(strip_tags($post['message']), 160));. H( {7 Y5 t( n& ^
4 z( t7 Z8 Z3 f q# T, y- }
" S5 z* s E$ k) c9 n% h+ j! ] - }- l% Z9 o4 q1 g p+ k& S
& [% \! ~! \7 P, }3 B. Z- }
; k$ O4 L& W$ w/ D# {
8 L. ^' j5 m. x i: x- B A; j4 a- }
2 q: v# M2 ~; L9 r5 ]
複製代碼 OK,緩存都不用更新。重新載入網頁就OK啦...- X/ h, B5 p: Y# K* j
9 b+ ?/ k6 R% o0 X" b; x: L
% O* p/ H' N }$ p
6 k/ a+ F" u9 s$ c9 I [0 W
|
|