本帖最後由 IT_man 於 2015-2-6 13:24 編輯 1 g3 s: w- J) r9 Z I
& D) g+ d& s5 R5 ~; {& S# \
如何讓樓主帖始終在每頁的最上面 5 F/ f8 W* C, P% @' Z+ i
$ p( }3 ` }) D6 j: } 1.找到:source\module\forum目錄下forum_viewthread.php檔; t: M( [6 [) u0 D
; T; f$ J) c* L! J/ ~7 B9 k
$ ]: m* O' i2 y5 o' Q 找到:5 W9 x6 |% M8 A" ?' o& G6 b& L+ D
- <blockquote>$_G['forum_thread']['replies'] = $temp_reply;
複製代碼 在下面添加代碼:: y- F9 Z6 W/ E7 ]$ R, D
- $threaDPId=0;
+ q% d+ V! A4 ~9 C5 o
$ |: E6 O% Z \5 I6 ~- if($_G['page']>1){
* V* {& C) ?& t) C9 A4 B- e! F
' i. m( J; _* K& J2 ~- $post=DB::fetch_first("SELECT p.* FROM ".DB::table("forum_post")." p WHERE p.tid='{$_G['tid']}' AND p.first=1 limit 1");
4 |, ^- `: v3 N( V# l) u
! G- A3 p' A) m2 F- A- if($post){
6 g4 m- g8 t1 c" g7 g$ ?" ?6 v
3 z; U! \. Q0 P( v- $threaDPId=$post['pid'];0 l+ J! y( x( Y/ K+ k9 F! w
- * E/ W+ x [6 f, \9 G2 K" P
- if(($onlyauthoradd && $post['anonymous'] == 0) || !$onlyauthoradd) {
# i' [; R7 y2 o4 e0 [
" A, f* ]3 e/ `6 B. G: }" j. J. i- $postlist[$post['pid']] = $post;/ n1 E) H; u, D; N$ G+ Y
- # @. h& Z4 Q3 o( i' b( R
- $postusers[$post['authorid']] = array();
8 w$ H* t" E4 w _9 W
! e) Y* H# C/ H; k7 O- e; I- if($post['first']) {
% A5 y& ~; L* A1 W8 h
! N6 ]+ O6 X9 i5 s- {- $_G['forum_firstpid'] = $post['pid'];
1 b0 G0 _+ n: R* s6 k - 3 X5 O4 ^' U/ l, F' J4 [# f! y
- $metadescription = str_replace(array("\r", "\n"), '', messagecutstr(strip_tags($post['message']), 160));
! K/ w* O! B( F& @7 d
* E# u' G2 C6 t6 e- }' \8 D. R& L* ~
- }
" q1 }9 b3 ^3 y5 w; Y3 C - 3 B1 R2 Y& b# {, X9 _+ {
- }
+ T" B5 a' J' e ~4 p - 1 M' h9 C( n0 ~ k% ^+ s
- }- ]! r; l* o# h
複製代碼 OK,緩存都不用更新。重新載入網頁就OK啦...
2 ]' g6 Y% O. U" X. G0 M3 u9 @- `: r$ K; i
# @' B+ Q. D1 e, n0 ]% |; Y. `( L4 ]( @: K. g
|
|