Файл: foto/inc/user_gallery.php
Строк: 38
<?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;
}
$set['title'] = $ank['nick'] . ' - Фотоальбомы'; // заголовок страницы
require_once '../sys/inc/thead.php';
include 'inc/gallery_act.php';
err();
aut();
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery` 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'];
include 'inc/gallery_form.php';
echo "<div class = 'blok'>$k_post альбомов <b>$ank[nick]</b></div>";
if ($k_post == 0) {
echo "<table class = 'blok'><tr><td class = 'null'>";
echo "<img src = '/style/icons/bullet_error.png' /> Нет фотоальбомов";
echo "</td></tr></table>";
}
$q = mysql_query("SELECT * FROM `gallery` WHERE `id_user` = '$ank[id]' ORDER BY `time` DESC LIMIT $start, $set[p_str]");
echo "<table class = 'blok'><tr><td class = 'icon14'>";
while ($post = mysql_fetch_assoc($q)) {
$foto = mysql_fetch_assoc(mysql_query("SELECT * FROM `gallery_foto` WHERE `id_gallery` = '$post[id]' ORDER BY RAND()"));
if ($foto == null) {
echo "<a href='/foto/$ank[id]/$post[id]/'><img src='/foto/foto48/0.png' alt='Нет фото' />";
echo "</a>";
} else {
echo "<a href='/foto/$ank[id]/$post[id]/'>";
echo "<img src='/foto/foto128/$foto[id].$foto[ras]' title = '" . mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery_foto` WHERE `id_gallery` = '$post[id]'"), 0) . " фото' style = 'padding:1px; margin:2px; height: 60px; width:60px; border: 1px rgb(233, 234, 237) solid; vertical-align:top; background-position: center top;' alt='Фото_$foto[id]' />";
echo "</a>";
}
}
echo "</td></tr></table>n";
if ($k_page > 1) {
str('?', $k_page, $page);
}
require_once '../sys/inc/tfoot.php';
exit;