<?php 

if(!$_G['uid']) {

    odz_error('not_loggedin', ODZ_ERR_LOGIN);

}



$list = array();

$query = C::t('home_friend')->fetch_all_by_uid($_G['uid']);

foreach($query as $value) {

    $list[] = array(

        'uid' => $value['fuid'],

        'username' => $value['fusername'],

        'avatar' => avatar($value['fuid'], 'small', true)

    );

}



odz_result(array('friends'=>$list));

?>