1、调用会员发布文章数<table>[e:loop={'SELECT userid, username, count(username) as total from [!db.pre!]ecms_news group by username order by total desc',0,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, username,count(username) as num from [!db.pre!]ecms_news group by username order by num desc',0,24,0}]<tr><td><?=$bqno?></td><td><?=$bqr[username]?></td><td><?=$bqr[num]?></td><td><?=$bqr[userid]?></td></tr>[/e:loop]</table>注释:在sql语句“ SELECT userid, username, 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, username,count(username) as num from [!db.pre!]ecms_news where newstime > UNIX_TIMESTAMP()-86400*7 group by username order by num desc',0,24,0}]<tr><td><?=$bqno?></td><td><?=$bqr[username]?></td><td><?=$bqr[num]?></td><td><?=$bqr[userid]?></td></tr>[/e:loop]


常见问题
相关文章
猜你喜欢
- 帝国CMS批量删除重复文章,仅保留一篇的sql语句 2023-03-14
- 帝国cms随机标签怎么用 2022-12-07
- 帝国cms调用包含指定关键词的文章内容标签 2022-12-07
- 帝国cms灵动标签调用上一章和下一章文章名称 2022-12-07
- 帝国cms一级栏目和二级栏目在当前栏目高亮问题注释 2022-12-07
- 帝国cms模板在列表页调用副表字段 2022-12-07
- 帝国cms列表页及内容页调用显示收藏数量 2022-12-07
- 帝国cms专题调用标题、简介、文章数、时间、点击数 2022-12-07
- 帝国cms调用会员名及投稿数量排名 2022-12-07
- 父栏目和子栏目都能在当前栏目高亮 2022-12-07