帝国cms调用会员名及投稿数量排名
发布时间:2021-01-10 12:30:02 所属栏目:教程 来源:网络整理
导读: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}]trtd?=$bqno?/tdtd?=$bqr[username]?/tdtd?=$bqr[total]?/td/tr[/e:loop]/table 2、只挪用
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> (编辑:湖南网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |