Файл: user/bookmark/foto.php
Строк: 67
<?php
require_once '../../sys/inc/start.php';
require_once '../../sys/inc/compress.php';
require_once '../../sys/inc/sess.php';
require_once '../../sys/inc/settings.php';
require_once '../../sys/inc/db_connect.php';
require_once '../../sys/inc/ipua.php';
require_once '../../sys/inc/fnc.php';
require_once '../../sys/inc/user.php';
if (isset($user)) {
$ank['id'] = $user['id'];
}
if (isset($_GET['id'])) {
$ank['id'] = intval($_GET['id']);
}
$ank = get_user($ank['id']);
if ($ank['id'] == 0) {
header("Location: /index.php?" . SID);
exit;
}
if (isset($user) && isset($_GET['delete']) && $user['id'] == $ank['id']) {
mysql_query("DELETE FROM `mark_foto` WHERE `id` = '" . intval($_GET['delete']) . "' AND `id_user` = '$user[id]' LIMIT 1");
msg('Закладка удалена');
header("Location: ?page=" . intval($_GET['page']) . "" . SID);
exit;
}
if (!$ank) {
header("Location: /index.php?" . SID);
exit;
}
$set['title'] = 'Закладки - Фото - ' . $ank['nick']; // заголовок страницы
require_once '../../sys/inc/thead.php';
err();
aut();
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `bookmark_foto` WHERE `id_user` = '$ank[id]'"), 0);
$k_page = k_page($k_post, $set['p_str']);
$page = page($k_page);
$start = $set['p_str'] * $page - $set['p_str'];
echo "<div class = 'menu_razd'>Интересные фото</div>";
if ($k_post == 0) {
echo "<table class = 'foot'><tr><td class = 'null'>";
echo "<img src = '/style/icons/bullet_error.png' /> Нет результатов";
echo "</td></tr></table>";
}
$q = mysql_query("SELECT * FROM `bookmark_foto` WHERE `id_user` = '$ank[id]' ORDER BY id DESC LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_assoc($q)) {
$f = $post['id_foto'];
$foto = mysql_fetch_assoc(mysql_query("SELECT * FROM `gallery_foto` WHERE `id` = '" . $f . "' LIMIT 1"));
$gallery = mysql_fetch_assoc(mysql_query("SELECT * FROM `gallery` WHERE `id`='" . $foto['id_gallery'] . "' LIMIT 1"));
$ank_p = get_user($gallery['id_user']);
echo "<table class = 'foot'><tr><td class = 'icon14'>";
if (IS_WEB) {
echo "<a href='/foto/$ank_p[id]/$gallery[id]/$foto[id]/' title='Перейти к фото'><img style=' padding: 2px; height: 120px; width: 120px; border: 1px solid grey;' src='/foto/foto128/$foto[id].$foto[ras]' /></a><br />";
} else {
echo "<a href='/foto/$ank_p[id]/$gallery[id]/$foto[id]/' title='Перейти к фото'><img style=' padding: 2px; height: 45px; width: 45px; border: 1px solid grey;' src='/foto/foto48/$foto[id].$foto[ras]' /></a><br />";
}
echo "</td><td class = 'null'>";
echo "<img src = '/style/icons/photo.png' /> " . htmlspecialchars($foto['name']) . "<br />";
echo "<img src = '/style/icons/time.png' /> " . vremja($post['time']);
if ($ank['id'] == $user['id']) {
echo "<div id = 'hide' class = 'right'><a href='?delete=$post[id]&page=$page'><img src='/style/icons/cross.png' /></a></div>";
}
echo "</td></tr></table>";
}
if ($k_page > 1) {
str('?', $k_page, $page);
}
echo "<a href = '/user/bookmark/index.php?id=$ank[id]'><div class = 'foot'><img src = '/style/icons/left.png' /> Вернуться</div></a>";
require_once '../../sys/inc/tfoot.php';