» » » Самые дружные пользователи

Самые дружные пользователи

1. Идём по пути AdminCP -> CMS -> Block -> Add new block ( новый блок )

Product: Phpfox
Module: User
Title: user::mostfriendlyuser
Type: PHP Code
Controller: core.index-member
Placement: Block 1

<?php
$dbase = Phpfox::getLib('database');
            $aRow = $dbase->select(Phpfox::getUserField() . ', ur.total_friend AS ifriends')
                    ->from(Phpfox::getT('user'), 'u')
                    ->join(Phpfox::getT('user_field'),'ur','ur.user_id = u.user_id')
                    ->where('ur.total_friend > 0')
                    ->limit(1)            
                    ->order('ur.total_friend DESC')
                    ->execute('getRow');  
?>
<div class="block">
    <div class="title">Most Friendly User</div>
    <div class="content">
<?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['ifriends']; ?>
    </div>
</div>
<div class="clear"></div>
    </div>
</div>
<?php } unset($aRow); ?>

Другие публикации по теме:

Комментарии