Файл: foto/inc/user_gallery_show.php
Строк: 54
<?
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'].' - Фотоальбом'; // заголовок страницы
include_once '../sys/inc/thead.php';
title();
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'];
//echo "<table class='post'>n";
if ($k_post==0)
{
echo "<div class='frends'>Нет фотографий</div>n";
}
$q=mysql_query("SELECT * FROM `gallery_foto` WHERE `id_gallery` = '$gallery[id]' ORDER BY `id` DESC LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_assoc($q))
{
if($num==1){
echo '<div class="frends">';
$num=0;
}else{
echo '<div class="frends2">';
$num=1;}
if ($set['set_show_icon']==1){
echo "<img src='/foto/foto48/$post[id].$post[ras]' alt='Фото_$post[id]' /><br />";
}
echo "<img src='/images/foto.png'> <a href='/foto/$ank[id]/$gallery[id]/$post[id]/'><b>Подробней</b></a><br />n";
echo "<img src='/images/rating14.png'> Рейтинг: <span class="ank_d">$post[rating]</span><br />n";
echo "<img src='/images/comm.png'> <a href='/foto/$ank[id]/$gallery[id]/komm/$post[id]/'>Комметарии (".mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery_komm` WHERE `id_foto` = '$post[id]'"),0).")</a><br />n";
echo "</div>n";
}
if ($k_page>1)str('?',$k_page,$page); // Вывод страниц
include 'inc/gallery_show_form.php';
echo "<div class="foot">n";
echo "«<a href='/foto/$ank[id]/'>К фотоальбомам</a><br />n";
echo "</div>n";
include_once '../sys/inc/tfoot.php';
exit;
?>