帝國cms調用會員名及投稿數量排名建站知識
導讀:1建站知識帝國CMS模板網下面的帝國CMS教程欄目為您提供了帝國cms調用會員名及投稿數量排名seo網站優化軟件seo網站優化。
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(useo網站優化sername) as total from [!db.pre!]ecms_news group by username order by total desc ”
中的“(username)”和“group by username”中的 “username”也能用 “us網站seo優化課程erid” 調用 但會出項一個問題就是 管理員的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&g網站建設哪家好t;<td><?=$bqr[num]?></td><td><?=$bqr[userid]?></td></tr> [/e:loop] </table>相關seo網站優化軟件seo網站優化。聲明: 本文由我的SEOUC技術文章主頁發布于:2023-05-22 ,文章帝國cms調用會員名及投稿數量排名建站知識主要講述帝國,會員名,帝國cms調用會員名及投稿數量排名建網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.com/article/web_4390.html