Discuz 取各排行榜数据

原文链接:http://www.cnblogs.com/showblog/p/3358038.html
取论坛指定版块帖子或回复(first=1 就是帖子的1楼, 如果=0 就是调用回复,fid=62 是论坛版块号):
SELECT * FROM discuzx.pre_forum_post where first=1 and fid=62 order by tid desc

 

取论坛最新帖子并显示版块名称:
SELECT a.*,b.* FROM discuzx.pre_forum_thread as a left join discuzx.pre_forum_forum as b on a.fid=b.fid order by tid desc

 

按积分排行调用论坛用户头像和名称,也可以将 credits改成regdate,就是最新注册加入的会员:
SELECT * FROM discuzx.pre_common_member order by credits desc

 

取论坛热门版块排行:
SELECT * FROM discuzx.pre_forum_forum order by threads desc

 

取论坛最热门帖子:
SELECT * FROM discuzx.pre_forum_thread order by views desc

 

取论坛最新帖子:
SELECT * FROM discuzx.pre_forum_thread order by tid desc

 

转载于:https://www.cnblogs.com/showblog/p/3358038.html

上一篇:PHP板的慢mysql


下一篇:从PHP和设置权限在phpBB3中创建论坛