Файл: vsime.com/friends/inc/act_user.php
Строк: 72
<?
if (isset($_GET['id'])) {
@$ank = profile(intval($_GET['id']));
if (@$ank['id'] == 0) {
$title .= ' - Ошибка!';
ex_head();
$error[] = 'Пользователь не найден.';
show_errors();
ex_foot();
}
} else {
if_user('is_reg');
$ank = $user;
}
if (isset($_GET['sort']) && $_GET['sort'] == 2) {
$sort = 2;
$qsort = " AND `date_last` > '".($time-600)."' ORDER BY `date_last` DESC";
} elseif (isset($_GET['sort']) && $_GET['sort'] == 3) {
$sort = 3;
$qsort = " ORDER BY `nick` ASC";
} else {
$sort = 1;
$qsort = " ORDER BY `date_last` DESC";
}
$array_res = array();
$query_res = mysqli_query($dbi, "SELECT * FROM `friends` WHERE (`id_user` = '$ank[id]' OR `id_ank` = '$ank[id]') AND `ok` = '1'");
while ($post_res = mysqli_fetch_array($query_res)) {
if ($ank['id'] != $post_res['id_user'])$ank_res = profile($post_res['id_user']); else $ank_res = profile($post_res['id_ank']);
$array_res[] = $ank_res['id'];
}
$count_friends = count($array_res);
$where = implode("' OR `id` = '", $array_res);
$title .= ' '.$ank['nick'];
ex_head();
echo "<div class='grand_h'>n";
echo "<table>n";
echo "<td>".($sort!=1?"<a href='?act=user&id=$ank[id]&sort=1'>":NULL)."<span class='block_l'>Все</span>".($sort!=1?"</a>":NULL)."</td><td>".($sort!=2?"<a href='?act=user&id=$ank[id]&sort=2'>":NULL)."<span class='block_l'>Онлайн</span>".($sort!=2?"</a>":NULL)."</td><td>".($sort!=3?"<a href='?act=user&id=$ank[id]&sort=3'>":NULL)."<span class='block_l'>Абв</span>".($sort!=3?"</a>":NULL)."</td>n";
echo "</table>n";
echo "</div>n";
if (!$count_friends) {
echo "<div class='list_empty'>n";
echo "Нет друзейn";
echo "</div>n";
} else {
$count_results = mysqli_result("SELECT COUNT(*) FROM `user` WHERE (`id` = '$where')$qsort");
$count_pages = count_pages($count_results);
$page = page();
$start = start_pages();
if (!$count_results) {
echo "<div class='list_empty'>n";
echo "Нет друзей онлайнn";
echo "</div>n";
}
$query = mysqli_query($dbi, "SELECT * FROM `user` WHERE (`id` = '$where')$qsort LIMIT $start, $config[rop]");
while ($post = mysqli_fetch_array($query)) {
echo "<div class='list'>n";
echo "<div class='left'>n";
show_avatar($post['id'], 'small');
echo "</div>n";
echo "<div class='overfl_hid'>n";
echo profile_icon($post['id']).profile_nick($post['id'], 1).profile_medal($post['id']);
if ($ank['id'] == $user['id'])echo "<span class='right'><a href='?act=delete&id=$post[id]&page=$page'>$config[code_delete]</a></span>n";
echo "<br />n";
echo "</div>n";
echo "<div class='clear'></div>n";
echo "</div>n";
}
pages_show("?act=user&id=$ank[id]&sort=$sort&");
}
echo "<div class='foot'>n";
echo image_back()." <a href='$config[profile_page]?id=$ank[id]'>Страничка $ank[nick]</a>n";
echo "</div>n";
ex_foot();
?>