Файл: vsime.com/gifts/inc/act_index.php
Строк: 47
<?
if (isset($_GET['id'])) {
@$ank = profile(intval($_GET['id']));
if (!$ank['id']) {
$title .= ' - Ошибка!';
ex_head();
$error[] = 'Пользователь не найден.';
show_errors();
ex_foot();
}
} else {
if_user('is_reg');
$ank = $user;
}
$title .= ' '.$ank['nick']; // тип заголовок
ex_head();
if (mysqli_result("SELECT COUNT(*) FROM `gifts` WHERE `id_user` = '$user[id]' AND `read` = '0'") && $ank['id']==$user['id']) {
mysqli_query($dbi, "UPDATE `gifts` SET `read` = '1' WHERE `id_user` = '$user[id]' AND `read` = '0'");
}
$count_results = mysqli_result("SELECT COUNT(*) FROM `gifts` WHERE `id_user` = '$ank[id]'");
if (!$count_results) {
echo "<div class='list_empty'>n";
echo "Список пуст";
echo "</div>n";
}
$count_pages = count_pages($count_results);
$page = page();
$start = start_pages();
$query = mysqli_query($dbi, "SELECT * FROM `gifts` WHERE `id_user` = '$ank[id]' ORDER BY `time` DESC LIMIT $start, $config[rop]");
while($post = mysqli_fetch_array($query))
{
$ank2 = profile($post['id_kont']);
$gift = mysqli_fetch_array(mysqli_query($dbi, "SELECT * FROM `gift` WHERE `id` = '$post[id_gift]'"));
echo "<div class='list'>n";
echo "<div class='left'>n";
echo "<img src='/i/gifts/$gift[image]' height='".($config['web']==false?30:50)."' height='".($config['web']==false?30:50)."'>n";
echo "</div>";
echo "<div class='overfl_hid'>n";
echo "<a href='?act=gift&id=$post[id]'>".($post['type']==1 || $post['type']==2 && (isset($user) && $ank['id']==$user['id'] || isset($user) && $user['id']==$ank2['id'] || isset($moderate_gifts)) || $post['type']==3 && (isset($user) && $user['id']==$ank2['id'] || isset($moderate_gifts))?$ank2['nick']:'Неизвестный')."</b></a> <span class='right'>".vremja($post['time'])."</span>n";
echo "</div>n";
echo "<div class='clear'></div>n";
echo "</div>";
}
pages_show("?id=$ank[id]&"); // Вывод страниц
echo "<div class='grand_h'>n";
echo "<img src='/i/site/give_gift.png'> <a href='?act=send&id=$ank[id]'>Подарить подарок</a>n";
echo "</div>";
echo "<div class='foot'>n";
echo image_back()." <a href='$config[profile_page]?id=$ank[id]'>Назад</a>n";
echo "</div>";
ex_foot();
?>