帝國cms調(diào)用會員名及投稿數(shù)量排名_帝國Cms教程
教程Tag:暫無Tag,歡迎添加,賺取U幣!
給大家分享一下帝國cms調(diào)用會員及投稿數(shù)量排名,希望對你有所幫助。
1、調(diào)用會員發(fā)布文章數(shù)
1、調(diào)用會員發(fā)布文章數(shù)
2、只調(diào)用會員發(fā)布文章數(shù),增加(序號、會員id)
- <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>
- <table>
- <tr>
- <td>排名號</td>
- <td>會員名</td>
- <td>文章數(shù)</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” 調(diào)用 但會出項(xiàng)一個問題就是 管理員的ID會與前臺會員的ID重復(fù)
即:管理員的ID=1,前臺會員的ID=1(所以管理員的ID=前臺會員的ID),最后統(tǒng)計(jì)出來的文章會是:管理員+前臺會員=總數(shù)
月排行
- where newstime > UNIX_TIMESTAMP()-86400*30 (月:30、周:7)
舉例:月排行
- <table><tr><td>排名號</td><td>會員名</td><td>文章數(shù)</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>
僅供大家參考學(xué)習(xí)哦~
相關(guān)帝國Cms教程:
- 在帝國下載內(nèi)容頁模板里調(diào)用下載扣除點(diǎn)數(shù)方法
- 在帝國模板里隨機(jī)調(diào)用專題的靈動標(biāo)簽寫法
- 帝國WAP模板二級域名偽靜態(tài)規(guī)則
- 帝國模板首頁調(diào)用最新10條附件信息
- 帝國CMS常用變量
- 帝國cms內(nèi)容頁調(diào)用正文附件下載的代碼
- 帝國cms內(nèi)容頁SQl方式調(diào)用當(dāng)前TAG標(biāo)簽
- 帝國cms靈動標(biāo)簽實(shí)現(xiàn)循環(huán)子欄目數(shù)據(jù)
- 帝國cms內(nèi)容頁靈動標(biāo)簽調(diào)用當(dāng)前欄目多篇文章并且排除當(dāng)前文章
- 防止重復(fù)提交js按鈕變灰
- 帝國cms在內(nèi)容頁模板里添加錯誤報(bào)告鏈接
- 帝國cms采集排除重復(fù)鏈接重復(fù)標(biāo)題、內(nèi)容為空的文章
- 相關(guān)鏈接:
- 教程說明:
帝國Cms教程-帝國cms調(diào)用會員名及投稿數(shù)量排名。