Файл: modules/forum/view/who.php
Строк: 24
<?php
/* Мод "Форум"
* Версия v0.0.1
* Дата последнего редактирования 15.01.2015
* Двиг DCMS Special
* Модифицировал densnet
* Автор yadalay
* Файл who.php
* Описание: показывает... кто в теме
*/
$forum = mysql_fetch_object(mysql_query('SELECT `id`, `access`, `name` FROM `forum` WHERE `id` = ' . intval($_GET['forum'])));
$razdel = mysql_fetch_object(mysql_query('SELECT `id`, `id_forum`, `name` FROM `forum_razdels` WHERE `id_forum` = ' . $forum->id . ' AND `id` = ' . intval($_GET['razdel'])));
$theme = mysql_fetch_object(mysql_query('SELECT `id`, `id_razdel`, `name` FROM `forum_themes` WHERE `id_razdel` = ' . $razdel->id . ' AND `id` = ' . intval($_GET['theme'])));
if (!$theme || !$razdel || !$forum || ($forum->access == 1 && $user['group_access'] < 8) || ($forum->access == 2 && $user['group_access'] < 3)) {
header('Location: ' . DIR_FORUM);
exit;
} else {
$set['title'] = 'Сейчас в теме - ' . text::toOutput($theme->name, 1, 1, 0, 0, 0);
require_once H . 'sys/inc/thead.php';
title();
aut();
$k_post = mysql_result(mysql_query('SELECT COUNT(*) FROM `user` WHERE `date_last` > "' . (time() - 600) . '" AND `forum_url` LIKE "/modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '%"'), 0);
$k_page = k_page($k_post, $set['p_str']);
$page = page($k_page);
$start = $set['p_str'] * $page - $set['p_str'];
if ($k_post == 0) {
echo "<div class = 'errs'>";
echo img16('error.png') . " Нет результатов";
echo "</div>";
}
$persons = mysql_query('SELECT `id`, `sex`, `nick` FROM `user` WHERE `date_last` > "' . (time() - 600) . '" AND `forum_url` LIKE "/modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '%" ORDER BY `date_last` LIMIT ' . $start . ', ' . $set['p_str']);
while ($person = mysql_fetch_object($persons)) {
echo "<table class = 'razd'><tr><td class = 'icon14'>";
echo avatar("$person->id", '30');
echo "</td><td class = 'null'>";
echo user($person->id);
echo "</td></tr></table>";
}
echo "<div class = 'razd'><a class = 'add' href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id.html'>" . img16('left.png') . " " . text::toOutput($theme->name, 1, 1, 0, 0, 0) . "</a></div>";
if ($k_page > 1) {
str('/modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '/who/', $k_page, $page);
}
}