我正在尝试向顶级用户展示活动点数,我只能使用此代码获得顶级用户
<?php
$dbase = Phpfox::getLib('database');
$aRow = $dbase->select(Phpfox::getUserField() . ', ur.activity_points AS score')
->from(Phpfox::getT('user'), 'u')
->join(Phpfox::getT('user_activity'),'ur','ur.user_id = u.user_id')
->where('ur.activity_points > 0')
->limit(10)
->order('ur.activity_points DESC')
->execute('getRow');
?>
<?php if (count ( $aRow )){ ?>
<div class="block" id="js_sortable_friend_mini"><div class="title ">Top Active Users</div>
<div class="clear" style="height: 5px;"></div>
<ul id="topuserpoints">
<div class="name_userpoints">
<?php echo '<a href="' . Phpfox::getLib('phpfox.url')->makeUrl('profile', $aRow['user_name']) . '">' . $aRow['full_name'] . '</a>'; ?>
</div>
<div class="score_userpoints">
<?php echo $aRow['score']; ?>
</div></ul>
</div>
<div class="clear"></div>
<?php } unset($aRow); ?>
此代码仅提供顶级用户。但我想要前 5 名。请帮忙