欧美日韩精品在线,国内精品久久久久久久久,一级毛片恃级毛片直播,清纯唯美亚洲综合欧美色

帝國cms調(diào)用會員名及投稿數(shù)量排名_帝國Cms教程

編輯Tag賺U幣
教程Tag:暫無Tag,歡迎添加,賺取U幣!
 給大家分享一下帝國cms調(diào)用會員及投稿數(shù)量排名,希望對你有所幫助。
1、調(diào)用會員發(fā)布文章數(shù)
  1. <table> 
  2. [e:loop={'SELECT userid, username, count(username) as total from [!db.pre!]ecms_news group by username order by total desc',0,24,0}] 
  3. <tr> 
  4. <td><?=$bqno?></td> 
  5. <td><?=$bqr[username]?></td> 
  6. <td><?=$bqr[total]?></td> 
  7. </tr> 
  8. [/e:loop] 
  9. </table> 
2、只調(diào)用會員發(fā)布文章數(shù),增加(序號、會員id)
  1. <table> 
  2. <tr> 
  3. <td>排名號</td> 
  4. <td>會員名</td> 
  5. <td>文章數(shù)</td> 
  6. <td>會員ID</td> 
  7. </tr> 
  8. [e:loop={'select userid, username,count(username) as num from [!db.pre!]ecms_news group by username order by num desc',0,24,0}] 
  9. <tr> 
  10. <td><?=$bqno?></td> 
  11. <td><?=$bqr[username]?></td> 
  12. <td><?=$bqr[num]?></td> 
  13. <td><?=$bqr[userid]?></td> 
  14. </tr> 
  15. [/e:loop] 
  16. </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ù)

月排行

  1. where newstime > UNIX_TIMESTAMP()-86400*30 (月:30、周:7) 

舉例:月排行

  1. <table><tr><td>排名號</td><td>會員名</td><td>文章數(shù)</td><td>會員ID</td></tr> 
  2. [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}] 
  3. <tr><td><?=$bqno?></td><td><?=$bqr[username]?></td><td><?=$bqr[num]?></td><td><?=$bqr[userid]?></td></tr> 
  4. [/e:loop] 
  5. </table> 

僅供大家參考學(xué)習(xí)哦~

查看更多 帝國cms教程  帝國cms模板

來源:模板無憂//所屬分類:帝國Cms教程/更新時(shí)間:2020-04-20
相關(guān)帝國Cms教程