Файл: foto/inc/user_gallery_show.php
Строк: 43
<?php
if (!isset($user) && !isset($_GET['id_user'])) {
header("Location: /foto/?" . SID);
exit;
}
if (isset($user)) {
$ank['id'] = $user['id'];
}
if (isset($_GET['id_user'])) {
$ank['id'] = intval($_GET['id_user']);
}
$ank = get_user($ank['id']);
if (!$ank) {
header("Location: /foto/?" . SID);
exit;
}
$gallery['id'] = intval($_GET['id_gallery']);
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery` WHERE `id` = '$gallery[id]' AND `id_user` = '$ank[id]' LIMIT 1"), 0) == 0) {
header("Location: /foto/$ank[id]/?" . SID);
exit;
}
$gallery = mysql_fetch_assoc(mysql_query("SELECT * FROM `gallery` WHERE `id` = '$gallery[id]' AND `id_user` = '$ank[id]' LIMIT 1"));
$set['title'] = $ank['nick'] . ' - ' . $gallery['name'] . ' - Фотоальбом'; // заголовок страницы
require_once '../sys/inc/thead.php';
include 'inc/gallery_show_act.php';
err();
aut();
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery_foto` WHERE `id_gallery` = '$gallery[id]'"), 0);
$k_page = k_page($k_post, $set['p_str']);
$page = page($k_page);
$start = $set['p_str'] * $page - $set['p_str'];
include 'inc/gallery_show_form.php';
if ($k_post == 0) {
echo "<table class = 'razd'><tr><td class = 'null'>";
echo "<img src = '/style/icons/bullet_error.png' /> Нет фотографий";
echo "</td></tr></table>";
}
$q = mysql_query("SELECT * FROM `gallery_foto` WHERE `id_gallery` = '$gallery[id]' ORDER BY `id` DESC LIMIT $start, $set[p_str]");
echo "<div class = 'razd'>Альбом <b>$gallery[name]</b><br />$k_post фото</div>";
echo "<table class = 'razd'><tr><td class = 'icon14'>";
while ($post = mysql_fetch_assoc($q)) {
echo "<a href='/foto/$ank[id]/$gallery[id]/$post[id]/'><img src='/foto/foto128/$post[id].$post[ras]' style = 'padding:1px; margin:2px; height: 60px; width:60px; border: 1px rgb(233, 234, 237) solid; vertical-align:top; background-position: center top;' alt='Фото_$post[id]' /></a>";
}
echo "</td></tr></table>n";
if ($k_page > 1) {
str('?', $k_page, $page);
}
echo "<div class="razd">n";
echo "<img src = '/style/icons/left.png' /> <a href='/foto/$ank[id]/'>К фотоальбомам</a>";
echo "</div>n";
require_once '../sys/inc/tfoot.php';
exit;