web建站教程
  1. 首页
  2. vuejs
  3. js
  4. 好玩
  5. seo教程
  6. 前端知识
  7. 百度echarts
  8. 更多
    php入门
    nodejs
    mockjs
    reactjs
    mysql
    wordpress
    织梦cms
    帝国cms
    git教程
    IT知识
    模板大全
    休息站

帝国cms调用会员名及投稿数量排名

285 ℃
     

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]</table>

jquery如何遍历表格求和(td求和)

table如何设置自动换行(默认会出现最小td宽度)

table单元格不换行如何解决

jquery清空td里的内容(修改td属性)

jquery利用click点击事件获取table中tr是否被选中

标签: LOOP标签, table, td求和, total, username

上面是“帝国cms调用会员名及投稿数量排名”的全面内容,想了解更多关于 帝国cms 内容,请继续关注web建站教程。

当前网址:https://ipkd.cn/webs_849.html

声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

当前位置: 网站首页 > 帝国cms
本文共计1235个字,预计阅读时长9分钟
生活小工具,收录了80多款小工具
上一篇: 推荐一个可以查询老黄历的网站,可以根据五行取名!
下一篇: 详细介绍HTTP状态码不同之处的原因(什么原因导致的)
x 打工人ai神器