Самые любимые пользователи или Популярные.
Едем на своём любимом 11 по пути AdminCP -> CMS -> Block -> Add new block ( новый блог )
Product: Phpfox
Module: User
Title: user::mostfavuser
Type: PHP Code
Controller: core.index-member
Placement: Block 1
Product: Phpfox
Module: User
Title: user::mostfavuser
Type: PHP Code
Controller: core.index-member
Placement: Block 1
<?php
$dbase = Phpfox::getLib('database'); $aRow = $dbase->select(Phpfox::getUserField() . ', COUNT(fav.user_id) as itotal')
->from(Phpfox::getT('user'), 'u')
->join(Phpfox::getT('favorite'),'fav','fav.item_id = u.user_id')
->group('fav.item_id')
->where('fav.type_id = 'user'')
->limit(1)
->order('itotal DESC')
->execute('getRow');
?>
<?php if (count ( $aRow )){ ?>
<div class="t_center p_bottom_10" >
<?php echo Phpfox::getLib('phpfox.image.helper')->display(array('user' => $aRow,'suffix' => '_200','max_width' => 200,'max_height' => 200)); ?>
<div class="p_top_4 t_center">
<?php echo '<a href="' . Phpfox::getLib('phpfox.url')->makeUrl('profile', $aRow['user_name']) . '">' . $aRow['full_name'] . '</a>'; ?><br/>
<?php echo $aRow['itotal']; ?>
</div>
</div>
<div class="clear"></div>
<?php } unset($aRow); ?>