国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS > 帝國Empire > 正文

帝國cms調用會員名及投稿數量排名

2024-07-09 23:01:31
字體:
來源:轉載
供稿:網友

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>
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 韩城市| 尉犁县| 清涧县| 随州市| 南阳市| 肇东市| 祥云县| 恩施市| 尼木县| 鞍山市| 肥西县| 襄樊市| 纳雍县| 肇州县| 上虞市| 绩溪县| 韶山市| 库尔勒市| 黄浦区| 翁牛特旗| 常熟市| 措勤县| 永川市| 长兴县| 通化县| 措勤县| 抚宁县| 上栗县| 巴楚县| 太和县| 柘荣县| 广安市| 北海市| 文昌市| 合川市| 清苑县| 鹤峰县| 谷城县| 兴业县| 略阳县| 潮安县|