discuz论坛主题帖子列表页面的最后回复人的url改成id形式的伪静态

来源:互联网 发布:苏大网络接入认证系统 编辑:程序博客网 时间:2024/04/28 07:22

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>
0 0