<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] </table>
- 最新文章
-
- phpcms v9无法更新url
- phpcms注册会员操作失败
- phpcms怎么修改模板
- phpcms添加内容报500错误的原因及解决方法
- linux服务器下phpcms提示hash数据验证失败的解决方法
- phpcms与phpsso通信失败的解决方法
- phpcms上传图片提示服务器安全认证错误的原因及解决方法
- phpcms v9更新栏目缓存失败的原因及解决方法
- phpcms v9后台登录提示验证码错误
- phpcms可以做什么?
- phpcms v9安装失败
- phpcms会员登录失败
- phpcms前台js获取不到cookie用户信息
- phpcms控制器不存在
- phpcms v9 php7可以运行吗
- phpcms js乱码怎么解决
- phpcms提示服务器安全认证错误
- phpcms php.ini在哪里
- phpcms phpsso验证码错误
- phpcms v9参数传递错误
- 热门文章
- 热门tag
- 随机tag