迅睿CMS框架是一款PHP8高性能·简单易用的CMS开源开发框架,基于MIT开源许可协议发布,免费且不限制商业使用,是免费开源的产品,以万端互联为设计理念,支持的微信公众号、小程序、APP客户端、移动端网站、PC网站等多终端式管理系统。
联系官方销售客服
1835022288
028-61286886
怎样做类似这种回帖排行榜,把会员在模块或者全站的回复数统计下,然后从高到底排序 列表遍历出来呢?
<?php $sql = urlencode('SELECT COUNT(*) as ct,author,uid FROM `dr_1_news_comment` GROUP by uid ORDER BY `ct` DESC limit 20');?> {sql sql='$sql'} 用户{$t.author}回帖{$t.ct}次 {/sql}
<h3 class="fly-panel-title">回贴排行榜</h3> <dl> <?php $sql = urlencode('SELECT COUNT(*) as ct,author,uid FROM `dr_1_news_comment` GROUP by uid ORDER BY `ct` DESC limit 20');?> {sql sql='$sql'} <dd> <a href="#"> <img src="{dr_avatar($t.uid)}"><cite>{$t.author}</cite><i> $t.ct}次回答</i> </a> </dd> {/sql} </dl>