Файл: modules/foto/inc/all_gallery.php
Строк: 34
<?php
/* Мод "Фотоальбомы"
* Версия v0.0.1
* Дата последнего редактирования 08.01.2015
* Двиг DCMS Special
* Модифицировал densnet
* Файл all_gallery.php
* Описание: выводит фотоальбомы
*/
$set['title'] = 'Фотоальбомы';
require_once H . 'sys/inc/thead.php';
title();
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'];
echo "<div style = 'font-size: 18px;font-weight: bold;' class = 'blok_text'>";
if (isset($user)) {
echo "<span style = 'float:right;' id = 'hide'>";
echo "<a href = '" . DIR_FOTO . "$user[id]/' title = 'Мои альбомы'>" . img16('001.png') . "</a> ";
echo "<a href = '" . DIR_FOTO . "$user[id]/?act=create' title = 'Новый альбом'>" . img16('plus.png') . "</a>";
echo "</span>";
}
echo "" . img24('image.png') . " Фотоальбомы";
echo "</div>";
if ($k_post == 0) {
echo "<div class = 'errs'>";
echo img16('error.png') . " Нет результатов";
echo "</div>";
}
$q = mysql_query("SELECT * FROM `gallery` ORDER BY `time` DESC LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_assoc($q)) {
$ank = user::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 "<div class = 'photos'>";
echo "<div class = 'photos_blok'>" . img('foto_mini.png') . " <small>" . mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery_foto` WHERE `id_gallery` = '$post[id]'"), 0) . "</small></div>";
echo "<img src = '" . DIR_FOTO . "foto48/0.png' />";
echo "</div>";
} else {
echo "<div class = 'photos'>";
echo "<div class = 'photos_blok'>" . img('foto_mini.png') . " <small>" . mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery_foto` WHERE `id_gallery` = '$post[id]'"), 0) . "</small></div>";
echo "<img src = '" . DIR_FOTO . "foto48/$foto[id].$foto[ras]' />";
echo "</div>";
}
echo "</td><td class = 'null'>n";
echo "<span style = 'float:right;' id = 'hides'>";
echo "" . date::time($post['time_create']) . "";
echo "</span>";
echo "<a href = '" . DIR_FOTO . "$ank[id]/$post[id]/'>$post[name]</a> (<a href='/info.php?id=$ank[id]'>$ank[nick]</a>)<br />";
if ($post['opis'] == null) {
echo "";
} else {
echo "<small>";
echo text::toOutput($post['opis']);
echo "</small>";
}
echo "</td></tr></table>";
}
if ($k_page > 1) {
str('?', $k_page, $page);
}
require_once H . 'sys/inc/tfoot.php';
exit;