1、调用会员发布文章数
<table>[e:loop={'SELECT userID,username,count(username) as total from [!db.pre!]eCMS_news group by username order by total desc',24,0}]<tr><td><?=$bqno?></td><td><?=$bqr[username]?></td><td><?=$bqr[total]?></td></tr>[/e:loop]</table>
2、只调用会员发布文章数,增加(序号、会员ID)
<table><tr><td>排名号</td><td>会员名</td><td>文章数</td><td>会员ID</td></tr>[e:loop={'select userID,count(username) as num from [!db.pre!]eCMS_news group by username order by num desc',0}]<tr><td><?=$bqno?></td><td><?=$bqr[username]?></td><td><?=$bqr[num]?></td><td><?=$bqr[userID]?></td></tr>[/e:loop]</table>
注释:在SQL语句“ SELECT userID,count(username) as total from [!db.pre!]eCMS_news group by username order by total desc ”
中的“(username)”和“group by username”中的 “username”也能用 “userID” 调用 但会出项一个问题就是 管理员的ID会与前台会员的ID重复
即:管理员的ID=1,前台会员的ID=1(所以管理员的ID=前台会员的ID),最后统计出来的文章会是:管理员+前台会员=总数
月排行
where newstime > UNIX_TIMESTAMP()-86400*30 (月:30、周:7)
举例:月排行
<table><tr><td>排名号</td><td>会员名</td><td>文章数</td><td>会员ID</td></tr>[e:loop={'select userID,count(username) as num from [!db.pre!]eCMS_news where newstime > UNIX_TIMESTAMP()-86400*7 group by username order by num desc',0}]<tr><td><?=$bqno?></td><td><?=$bqr[username]?></td><td><?=$bqr[num]?></td><td><?=$bqr[userID]?></td></tr>[/e:loop]</table>总结
以上是内存溢出为你收集整理的帝国cms调用会员名及投稿数量排名全部内容,希望文章能够帮你解决帝国cms调用会员名及投稿数量排名所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)