Файл: foto/inc/all_gallery.php
Строк: 31
<?php
$set['title'] = 'Фотоальбомы'; // заголовок страницы
require_once '../sys/inc/thead.php';
err();
aut();
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery`"), 0);
$k_page = k_page($k_post, $set['p_str']);
$page = page($k_page);
$start = $set['p_str'] * $page - $set['p_str'];
if (isset($user)) {
echo "<div class="foot">n";
echo "<img src = '/style/icons/photo.png' /> <a href='/foto/$user[id]/'>Мои альбомы</a> | ";
echo "<a href='/foto/$user[id]/?act=create'><font color = 'green'>Создать альбом</font></a>";
echo "</div>n";
}
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 `gallery` ORDER BY `time` DESC LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_assoc($q)) {
$ank = get_user($post['id_user']);
echo "<table class = 'razd'><tr><td class = 'icon14'>";
$foto = mysql_fetch_assoc(mysql_query("SELECT * FROM `gallery_foto` WHERE `id_gallery` = '$post[id]' ORDER BY RAND()"));
if ($foto == null) {
echo "<img src='/foto/foto48/0.png' alt='Нет фото' />";
} else {
echo "<img src='/foto/foto48/$foto[id].$foto[ras]' alt='Фото_$foto[id]' />";
}
echo "</td><td class='null'>n";
echo "<a href='/foto/$ank[id]/$post[id]/'>$post[name]</a> (" . mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery_foto` WHERE `id_gallery` = '$post[id]'"), 0) . " фото)<br />";
if ($post['opis'] == null) {
echo "";
} else {
echo "<small>";
echo text::toOutput($post['opis']) . "<br />n";
echo "</small>";
}
echo "<div id = 'hides'>";
echo "<img src = '/style/icons/time.png' /> " . vremja($post['time_create']) . " ";
echo "(<a href='/info.php?id=$ank[id]'>$ank[nick]</a>)";
echo "</div></td></tr></table>";
}
if ($k_page > 1) {
str('?', $k_page, $page);
}
require_once '../sys/inc/tfoot.php';
exit;