因?yàn)橛行┏S玫奶雍桶鎵K每次都要點(diǎn)來點(diǎn)去的去找,所以干脆把收藏功能拿出來用,做個(gè)菜單,隨時(shí)查看和刪除。
查詢代碼:
1.我收藏的版塊
$forum_favorites = DB::fetch_all("SELECT a.*,b.name,b.todayposts,c.icon,c.description as forum_description FROM ".DB::table('home_favorite')." a LEFT JOIN ".DB::table('forum_forum')." b on b.fid=a.id LEFT JOIN ".DB::table('forum_forumfield')." c on c.fid=b.fid WHERE a.`idtype`= 'fid' AND a.`uid`='$_G[uid]' ORDER BY a.`dateline` DESC LIMIT 0,10");//版塊
復(fù)制代碼
2.我收藏的帖子
$thread_favorites = DB::fetch_all("SELECT a.*,b.authorid,b.author,b.views,b.replies,b.tid,c.attachment,c.remote FROM ".DB::table('home_favorite')." a LEFT JOIN ".DB::table('forum_thread')." b on b.tid=a.id LEFT JOIN ".DB::table('forum_threadimage')." c on c.tid=b.tid WHERE a.`idtype`= 'tid' AND a.`uid`='$_G[uid]' ORDER BY a.`dateline` DESC LIMIT 0,10");//帖子
復(fù)制代碼
20170603補(bǔ)充調(diào)用方法
{loop $forum_favorites $value}
$value['字段']
{/loop}
復(fù)制代碼
和
{loop $thread_favorites $value}
$value['字段']
{/loop}
復(fù)制代碼