如何讓樓主帖始終在每頁的最上面 樓主帖不翻頁效果
本帖最後由 IT_man 於 2015-2-6 13:24 編輯如何讓樓主帖始終在每頁的最上面
1.找到:source\module\forum目錄下forum_viewthread.php檔
找到:
<blockquote>$_G['forum_thread']['replies'] = $temp_reply;在下面添加代碼:
$threaDPId=0;
if($_G['page']>1){
$post=DB::fetch_first("SELECT p.* FROM ".DB::table("forum_post")." p WHERE p.tid='{$_G['tid']}' AND p.first=1 limit 1");
if($post){
$threaDPId=$post['pid'];
if(($onlyauthoradd && $post['anonymous'] == 0) || !$onlyauthoradd) {
$postlist[$post['pid']] = $post;
$postusers[$post['authorid']] = array();
if($post['first']) {
$_G['forum_firstpid'] = $post['pid'];
$metadescription = str_replace(array("\r", "\n"), '', messagecutstr(strip_tags($post['message']), 160));
}
}
}
}
OK,緩存都不用更新。重新載入網頁就OK啦...
頁:
[1]