public function get_ranking()
 {
     $result = User::ranking();
     return Response::json($result);
 }
Example #2
0
$user->id = $id;
if (!$user->read()) {
    die;
}
if ($user->avatar) {
    echo '<div style="float: left;"><img class="avatar" style="margin-right: 5px" src="' . get_avatar_url($user->id, $user->avatar, 80) . '" width="80" height="80" alt="' . $user->username . '"/></div>';
}
echo '<strong>' . _('usuario') . ':</strong>&nbsp;' . $user->username;
$user->print_medals();
if ($current_user->user_id > 0 && $current_user->user_id != $user->id) {
    echo '&nbsp;' . User::friend_teaser($current_user->user_id, $user->id);
}
echo '<br/>';
if ($user->names) {
    echo '<strong>' . _('nombre') . ':</strong>&nbsp;' . $user->names . '<br/>';
}
if ($user->url) {
    echo '<strong>' . _('web') . ':</strong>&nbsp;' . $user->url . '<br/>';
}
echo '<strong>' . _('karma') . ':</strong>&nbsp;' . $user->karma . '<br/>';
echo '<strong>' . _('ranking') . ':</strong>&nbsp;#' . $user->ranking() . '<br/>';
echo '<strong>' . _('desde') . ':</strong>&nbsp;' . get_date($user->date) . '<br/>';
if ($current_user->user_id > 0 && $current_user->user_id != $user->id && ($her_latlng = geo_latlng('user', $user->id)) && ($my_latlng = geo_latlng('user', $current_user->user_id))) {
    $distance = (int) geo_distance($my_latlng, $her_latlng);
    echo '<strong>' . _('distancia') . ':</strong>&nbsp;' . $distance . '&nbsp;kms<br/>';
}
$post = new Post();
if ($post->read_last($user->id)) {
    echo '<br clear="left"><strong>' . _('Ășltima nota') . '</strong>: ';
    $post->print_text();
}