discuz論壇主題帖子列表頁面的最後回覆人的url改成id形式的偽靜態
阿新 • • 發佈:2019-02-02
1.修改\source\class\table\table_forum_thread.php的fetch_all_search方法,因為要把名字改成id,但是我看了下,查出的資料裡面並沒有最後的回覆使用者的id只有最後回覆使用者的密碼,所以需要改下資料庫查詢語句
$data = DB::fetch_all("SELECT * FROM ".DB::table($this->get_table_name($tableid))." $forceindex".$this->search_condition($conditions)." $ordersql ".DB::limit($start , $limit));
------||-------
------||-------
------\/-------
if (DB::table($this->get_table_name($tableid))=='ivf_forum_thread') {
$data = DB::fetch_all("SELECT ivf_forum_thread.*,b.uid AS `lastposter_id` FROM ".DB::table($this->get_table_name($tableid))." $forceindex"."LEFT JOIN ivf_ucenter_members AS b ON (`lastposter`=`username`)" .$this->search_condition($conditions)." $ordersql ".DB::limit($start, $limit));
}else{
$data = DB::fetch_all("SELECT * FROM ".DB::table($this->get_table_name($tableid))." $forceindex".$this->search_condition($conditions)." $ordersql ".DB::limit($start, $limit));
}
2,直接該預設模版位置的模版不行,不知道是什麼原因,這個頁面使用的模版是下面路徑的模版,而不是預設位置的D:\192.168.1.117\bbs_ivf\public_html\template\eyoung_skin_csmb\forum\forumdisplay_list.htm
<td class="by">
<cite><!--{if $thread['lastposter']}--><a href="{if $thread[digest] != -2}home.php?mod=space&uid=$thread[lastposterenc]{else}forum.php?mod=viewthread&tid=$thread[tid]&page={echo max(1, $thread[pages]);}{/if}" c="1">$thread[lastposter]</a><!--{else}-->$_G[setting][anonymoustext]<!--{/if}--></cite>
<em><a href="{if $thread[digest] != -2 && !$thread[ordertype]}forum.php?mod=redirect&tid=$thread[tid]&goto=lastpost$highlight#lastpost{else}forum.php?mod=viewthread&tid=$thread[tid]{if !$thread[ordertype]}&page={echo max(1, $thread[pages]);}{/if}{/if}">$thread[lastpost]</a></em>
</td>
------||-------
------||-------
------\/-------
<td class="by">
<cite><!--{if $thread['lastposter']}--><a href="{if $thread[digest] != -2}home.php?mod=space&uid=$thread[lastposter_id]{else}forum.php?mod=viewthread&tid=$thread[tid]&page={echo max(1, $thread[pages]);}{/if}" c="1">$thread[lastposter]</a><!--{else}-->$_G[setting][anonymoustext]<!--{/if}--></cite>
<em><a rel="nofollow" href="{if $thread[digest] != -2 && !$thread[ordertype]}forum.php?mod=redirect&tid=$thread[tid]&goto=lastpost$highlight#lastpost{else}forum.php?mod=viewthread&tid=$thread[tid]{if !$thread[ordertype]}&page={echo max(1, $thread[pages]);}{/if}{/if}">$thread[lastpost]</a></em>
</td>