Помогите с кодом

Главные вкладки

Аватар пользователя nikolasiii nikolasiii 22 октября 2010 в 12:03
/**
 * Get friends online
 */

function hc_api_display_block_0($limit = 5) {
    $friends = getFriendsOnline($limit);
    if (is_array($friends)) {
      foreach ($friends as $friend) {
        $account = user_load(array('uid' => $friend->uid));
        $output .= theme('hc_api', $account);
      }
    }
  return $output;
}

/**
 * Implementation of hook_theme().
 */

function hc_api_theme($existing, $type, $theme, $path) {
  return array(
    'hc_api_friends_online' => array(
      'arguments' => array(
        'account'   => NULL,
      ),
    ),
  );
}

/**
 * Themeable function
 */

function theme_hc_api($account) {
  $output  = '<div>'."\n";
  $output .= theme('user_picture', $account);
  $output .= ' <div class="name">'. theme('username', $account) .'</div>'."\n";
  $output .= '</div>'."\n";
  return $output;
}

в общем то пытаюсь сделать блок Друзья онлайн, запрос как достать айди друзей онлайн пашет, ваще весь код пашет до строки $output .= theme('hc_api', $account) в hc_api_display_block_0 , получается я не могу прикрутить хук темизации, в чем я неправ? реализация hc_api_theme и theme_hc_api разве не достаточно?

Комментарии