Файл: modules/forum/view/theme.php
Строк: 527
<?php
/* Мод "Форум"
* Версия v0.0.1
* Дата последнего редактирования 15.01.2015
* Двиг DCMS Special
* Модифицировал densnet
* Автор yadalay
* Файл theme.php
* Описание: тема
*/
$forum = mysql_fetch_object(mysql_query('SELECT * FROM `forum` WHERE `id` = ' . intval($_GET['forum'])));
$razdel = mysql_fetch_object(mysql_query('SELECT * FROM `forum_razdels` WHERE `id_forum` = ' . $forum->id . ' AND `id` = ' . intval($_GET['razdel'])));
$theme = mysql_fetch_object(mysql_query('SELECT * 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();
$my_report = (isset($user)) ? mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_reports` WHERE `id_theme` = ' . $theme->id . ' AND `id_user` = ' . $user['id']), 0) : 0;
$k_post = mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_posts` WHERE `id_theme` = ' . $theme->id), 0);
if (mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_votes` WHERE `id_theme` = ' . $theme->id), 0) != 0) {
$vote = mysql_fetch_object(mysql_query('SELECT * FROM `forum_votes` WHERE `id_theme` = ' . $theme->id));
$vars = mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_votes_var` WHERE `id_theme` = ' . $theme->id), 0);
} else {
$vars = NULL;
}
if (isset($_GET['sort_0'])) {
unset($_SESSION['sort_' . $user['id']]);
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '.html');
exit;
} elseif (isset($_GET['sort_1'])) {
$_SESSION['sort_' . $user['id']] = 1;
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '.html');
exit;
} elseif (isset($_GET['download'])) {
$file = mysql_fetch_object(mysql_query('SELECT `id`, `id_post`, `name`, `count_downloads` FROM `forum_post_files` WHERE `id` = ' . intval($_GET['download'])));
$this_post = mysql_fetch_object(mysql_query('SELECT `hide`, `privat` FROM `forum_posts` WHERE `id` = ' . $file->id_post));
if ($this_post->privat == 0 || ($this_post->privat == $user['id'] || $this_post->id_user == $user['id']) || ($this_post->hide != 0 && user::access('forum_post_ed'))) {
mysql_query('UPDATE `forum_post_files` SET `count_downloads` = ' . ($file->count_downloads + 1) . ' WHERE `id` = ' . $file->id);
header('Location: /sys/forum/' . $file->name);
} else {
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '.html');
}
exit;
} elseif (isset($user) && isset($_GET['cleare_theme']) && user::access('forum_them_edit')) {
require_once 'action/clear_theme.php'; // Очистка темы.
} elseif (isset($user) && isset($_GET['edit_theme'])) {
require_once 'action/edit_theme.php'; // Редактирование темы.
} elseif (isset($user) && isset($_GET['close_theme']) && $theme->reason_close == NULL && user::access('forum_them_edit')) {
require_once 'action/close_theme.php'; // Закрытие темы.
} elseif (isset($user) && isset($_GET['open_theme']) && $theme->reason_close != NULL && user::access('forum_them_edit')) {
$_SESSION['success'] = '<div class = "msgs">Тема успешно открыта.</div>';
$msg_sys = 'Проблема решена. [url=/info.php?id=' . $user['id'] . ']' . $user['nick'] . '[/url] открыл тему.';
mysql_query('INSERT INTO `forum_posts` SET `id_theme` = ' . $theme->id . ', `id_user` = "0", `id_admin` = "0", `text` = "' . mysql_real_escape_string($msg_sys) . '", `time` = ' . $time);
mysql_query('UPDATE `forum_themes` SET `reason_close` = "" WHERE `id` = ' . $theme->id);
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '.html');
exit;
} elseif (isset($user) && isset($_GET['create_vote']) && ($theme->reason_close == NULL || ($theme->reason_close != NULL && user::access('forum_post_close'))) && $user['id'] == $theme->id_user) {
require_once 'action/create_vote.php'; // Создание голосования.
} elseif (isset($user) && isset($_GET['edit_vote']) && $theme->reason_close == NULL && $user['id'] == $theme->id_user) {
require_once 'action/edit_vote.php'; // Редактирование голосования.
} elseif (isset($user) && isset($_GET['report'])) {
#Жалоба на тему
if ($my_report != 0 || user::access('forum_them_edit') || $user['id'] == $theme->id_user || $theme->reason_close != NULL) {
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '.html');
exit;
} else {
if (isset($_POST['send'])) {
$text = mysql_real_escape_string(trim($_POST['text']));
if (mb_strlen($text) < 5) {
echo "<div class = 'errs'>Слишком короткая причина. Указывайте нормальную причину, если не хотите быть забаненым администрацией.</div>";
} else {
$persons = mysql_query('SELECT `id`, `group_access` FROM `user` WHERE `group_access` > "2"');
while ($person = mysql_fetch_object($persons)) {
$access = mysql_result(mysql_query('SELECT COUNT(*) FROM `user_group_access` WHERE `id_group` = ' . $person->group_access . ' AND `id_access` = "forum_them_edit"'), 0);
if ($access != 0) {
$msg = 'Пользователь [url=/info.php?id=' . $user['id'] . ']' . $user['nick'] . '[/url] подал жалобу на тему [url=/modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '.html]' . $theme->name . '[/url].
Причина указана тут - [url=/modules/forum/reports.html]ссылка[/url]';
mysql_query('INSERT INTO `mail` SET `id_user` = "0", `id_kont` = ' . $person->id . ', `msg` = "' . mysql_real_escape_string($msg) . '", `time` = ' . $time);
}
}
mysql_query('INSERT INTO `forum_reports` SET `id_theme` = ' . $theme->id . ', `id_user` = ' . $user['id'] . ', `text` = "' . $text . '"');
$_SESSION['success'] = '<div class = "msgs">Жалоба успешно отправлена на рассмотрение администрацией.</div>';
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '.html');
exit;
}
}
echo "<form method = 'post' class = 'razd' action = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/report.html'>";
echo "<b>Укажите причину:</b><br />";
echo "<textarea name = 'text' style = 'width: 60%; height: 50px'></textarea><br />";
echo "<button name = 'send' class = 'button sign-ins'>Отправить";
echo "</button></form>";
echo "<div class = 'razd'><a href = '/modules/forum/$forum->id/$razdel->id/$theme->id.html' class = 'add'>" . img16('left.png') . " Вернуться в тему</a></div>";
require_once H . 'sys/inc/tfoot.php';
exit;
}
}
$my_voice = (isset($vote) && isset($user)) ? mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_vote_voices` WHERE `id_user` = ' . $user['id'] . ' AND `id_vote` = ' . $vote->id), 0) : NULL;
if (isset($user)) {
$last_post = mysql_result(mysql_query('SELECT MAX(`id`) FROM `forum_posts` WHERE `id_theme` = ' . $theme->id), 0);
if (isset($_GET['delete_post']) && user::access('forum_post_ed')) {
$_SESSION['success'] = '<div class = "msgs">Комментарий успешно удалён.</div>';
$files = mysql_query('SELECT `name` FROM `forum_post_files` WHERE `id_post` = ' . intval($_GET['delete_post']));
while ($file = mysql_fetch_object($files)) {
unlink('/sys/forum/' . $file->name);
}
mysql_query('DELETE FROM `forum_post_rating` WHERE `id_post` = ' . intval($_GET['delete_post']));
mysql_query('DELETE FROM `forum_posts` WHERE `id` = ' . intval($_GET['delete_post']));
if ($k_post == 0) {
mysql_query('UPDATE `forum_themes` SET `time_post` = ' . $theme->time . ' WHERE `id` = ' . $theme->id);
}
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '.html');
exit;
} elseif (isset($_GET['hide']) && user::access('forum_post_ed')) {
$_SESSION['success'] = '<div class = "msgs">Комментарий успешно скрыт.</div>';
mysql_query('UPDATE `forum_posts` SET `id_admin` = ' . $user['id'] . ', `hide` = "1" WHERE `id` = ' . intval($_GET['hide']));
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '.html');
exit;
} elseif (isset($_GET['display']) && user::access('forum_post_ed')) {
$_SESSION['success'] = '<div class = "msgs">Комментарий успешно показан вновь.</div>';
mysql_query('UPDATE `forum_posts` SET `id_admin` = "0", `hide` = "0" WHERE `id` = ' . intval($_GET['display']));
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '.html');
exit;
} elseif (isset($_GET['vote']) && $my_voice == 0) {
$_SESSION['success'] = '<div class = "msgs">Ваш голос успешно учтён.</div>';
mysql_query('INSERT INTO `forum_vote_voices` SET `id_vote` = ' . $vote->id . ', `id_variant` = ' . intval($_GET['vote']) . ', `id_user` = ' . $user['id']);
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '.html');
exit;
} elseif (isset($_GET['del_file']) && (mysql_fetch_object(mysql_query('SELECT `id_user` FROM `forum_post_files` WHERE `id` = ' . intval($_GET['del_file'])))->id_user == $user['id'] || user::access('forum_post_ed'))) {
$_SESSION['success'] = '<div class = "msgs">Файл успешно удалён.</div>';
$file = mysql_fetch_object(mysql_query('SELECT `id`, `id_post`, `name` FROM `forum_post_files` WHERE `id` = ' . intval($_GET['del_file'])));
unlink('/sys/forum/' . $file->name);
$id_post = $file->id_post;
unset($_SESSION['sort_' . $user['id']]);
$count = mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_posts` WHERE `id_theme` = ' . $theme->id . ' AND `id` < ' . ($id_post + 1)), 0);
$count_posts = mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_posts` WHERE `id_theme` = ' . $theme->id), 0);
$this_pages = k_page($count, $set['p_str']);
$pages = ($this_pages > 0) ? '/page=' . $this_pages : '.html';
mysql_query('DELETE FROM `forum_post_files` WHERE `id` = ' . $file->id);
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . $pages . '#' . $id_post);
exit;
}
if (isset($_POST['comment']) && ($theme->reason_close == NULL || ($theme->reason_close != NULL && user::access('forum_post_close')))) {
$text = mysql_real_escape_string($_POST['text']);
$mat = text::antimat($text);
if ($mat) {
echo "<div class = 'errs'>В тексте сообщения обнаружен мат: $mat.</div>";
} elseif (mb_strlen($text) < 2) {
echo "<div class = 'errs'>Комментарий слишком короткий.</div>";
} elseif (mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_posts` WHERE `id_user` = ' . $user['id'] . ' AND `text` = "' . $text . '"'), 0) != 0) {
echo "<div class = 'errs'>Вы уже писали это в данной теме. Будьте оригинальнее.</div>";
} else {
if (isset($_GET['cit']) && is_numeric($_GET['cit'])) {
$cit = intval($_GET['cit']);
$privat = 0;
} elseif (isset($_GET['privat']) && is_numeric($_GET['privat'])) {
$privat = intval($_GET['privat']);
$cit = 0;
} else {
$cit = 0;
$privat = 0;
}
mysql_query('UPDATE `forum_themes` SET `time_post` = ' . $time . ' WHERE `id` = ' . $theme->id);
mysql_query('INSERT INTO `forum_posts` SET `id_theme` = ' . $theme->id . ', `id_user` = ' . $user['id'] . ', `id_admin` = "0", `text` = "' . $text . '", `cit` = ' . $cit . ', `privat` = ' . $privat . ', `time` = "' . $time . '", `hide` = "0"');
$post_id = mysql_insert_id();
$count = mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_posts` WHERE `id_theme` = ' . $theme->id . ' AND `id` < ' . ($post_id + 1)), 0);
$count_posts = mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_posts` WHERE `id_theme` = ' . $theme->id), 0);
$this_pages = k_page($count, $set['p_str']);
$pages = ($this_pages > 0) ? '/page=' . $this_pages : '.html';
$j_f = 'Пользователь [url=/info.php?id=' . $user['id'] . ']' . $user['nick'] . '[/url] написал в теме "[url=/modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . $pages . '#' . $post_id . ']' . $theme->name . '[/url]", за которой Вы следите.
Комментарий: [b]' . $text . '[/b]';
$forum_js = mysql_query('SELECT `id_user` FROM `forum_journal` WHERE `id_theme` = ' . $theme->id);
while ($forum_j = mysql_fetch_object($forum_js)) {
if (mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_posts` WHERE `id` = ' . $post_id . ' AND `id_user` = ' . $user['id']), 0) == 0 && ((isset($_GET['answer']) && $_GET['answer'] != $forum_j->id_user) || !isset($_GET['answer']))) {
mysql_query('INSERT INTO `f_journal` SET `id_user` = ' . $forum_j->id_user . ', `type` = "themes", `text` = "' . mysql_real_escape_string($j_f) . '", `time` = "' . $time . '"');
}
}
if (!isset($_GET['cit']) && !isset($_GET['privat']) && isset($_GET['answer'])) {
$j = 'Пользователь [url=/info.php?id=' . $user['id'] . ']' . $user['nick'] . '[/url] ответил Вам в теме "[url=/modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . $pages . '#' . $post_id . ']' . $theme->name . '[/url]".
Ответ: [b]' . $text . '[/b]';
$type = 'answers';
} elseif (isset($_GET['cit']) && isset($_GET['answer'])) {
$j = 'Пользователь [url=/info.php?id=' . $user['id'] . ']' . $user['nick'] . '[/url] процитировал Ваш комментарий в теме [url=/modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . $pages . '#' . $post_id . ']' . $theme->name . '[/url].
Цитата: [b]' . $text . '[/b]';
$type = 'quotes';
} elseif (isset($_GET['privat'])) {
$j = 'Пользователь [url=/info.php?id=' . $user['id'] . ']' . $user['nick'] . '[/url] оставил Вам приватное сообщение в теме [url=/modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . $pages . '#' . $post_id . ']' . $theme->name . '[/url].
Сообщение: [b]' . $text . '[/b]';
$type = 'privat';
}
if (isset($user) && $user['id'] != $theme->id_user && !isset($_GET['answer']) && !isset($_GET['cit']) && !isset($_GET['privat'])) {
$j_t = 'Пользователь [url=/info.php?id=' . $user['id'] . ']' . $user['nick'] . '[/url] написал комментарий в Вашей теме "[url=/modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . $pages . '#' . $post_id . ']' . $theme->name . '[/url]".
Комментарий: [b]' . $text . '[/b]';
mysql_query('INSERT INTO `f_journal` SET `id_user` = ' . $theme->id_user . ', `type` = "my_themes", `text` = "' . mysql_real_escape_string($j_t) . '", `time` = "' . $time . '"');
}
if (isset($_GET['answer'])) {
mysql_query('INSERT INTO `f_journal` SET `id_user` = ' . intval($_GET['answer']) . ', `type` = "' . mysql_real_escape_string($type) . '", `text` = "' . mysql_real_escape_string($j) . '", `time` = "' . $time . '"');
} elseif (isset($_GET['privat'])) {
mysql_query('INSERT INTO `f_journal` SET `id_user` = ' . intval($_GET['privat']) . ', `type` = "' . mysql_real_escape_string($type) . '", `text` = "' . mysql_real_escape_string($j) . '", `time` = "' . $time . '"');
}
$_SESSION['success'] = '<div class = "msgs">Комментарий успешно добавлен.</div>';
$post = mysql_fetch_object(mysql_query('SELECT `id` FROM `forum_posts` WHERE `id` = ' . $post_id));
if (isset($_POST['add_file']) && $post) {
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '/' . $post->id . '/add_file');
} else {
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '.html');
}
exit;
}
} elseif (isset($user) && isset($_POST['edit_post'])) {
$edit_post = mysql_real_escape_string(trim($_POST['post']));
$post_edit = mysql_fetch_object(mysql_query('SELECT `count_edit` FROM `forum_posts` WHERE `id` = ' . intval($_POST['id_post'])));
mysql_query('UPDATE `forum_posts` SET `text` = "' . $edit_post . '", `last_edit` = ' . $time . ', `who_edit` = "' . $user['nick'] . '", `count_edit` = ' . ($post_edit->count_edit + 1) . ' WHERE `id` = ' . intval($_POST['id_post']));
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '.html#' . intval($_POST['id_post']));
exit;
} elseif (isset($_POST['cancel_edit'])) {
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '.html');
exit;
} elseif (isset($user) && isset($_GET['act_posts']) && (isset($_POST['delete_posts']) || isset($_POST['hide_posts']) || isset($_POST['display_posts']))) {
include_once 'action/actions_posts.php'; // Действия над постами.
}
}
if (isset($user) && isset($vote) && mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_votes_var` WHERE `variant` = "" AND `id_vote` = ' . $vote->id), 0) != 0) {
mysql_query('DELETE FROM `forum_votes_var` WHERE `id_vote` = ' . $vote->id);
mysql_query('DELETE FROM `forum_votes` WHERE `id` = ' . $vote->id);
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '.html');
exit;
}
if (isset($user) && isset($_GET['journal_yes'])) {
if (mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_journal` WHERE `id_theme` = ' . $theme->id . ' AND `id_user` = ' . $user['id']), 0) == 0) {
mysql_query('INSERT INTO `forum_journal` SET `id_theme` = ' . $theme->id . ', `id_user` = ' . $user['id']);
$_SESSION['success'] = '<div class = "msgs">Вы успешно подписались на эту тему.</div>';
}
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '.html');
exit;
} elseif (isset($user) && isset($_GET['journal_no'])) {
if (mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_journal` WHERE `id_theme` = ' . $theme->id . ' AND `id_user` = ' . $user['id']), 0) != 0) {
mysql_query('DELETE FROM `forum_journal` WHERE `id_theme` = ' . $theme->id . ' AND `id_user` = ' . $user['id']);
$_SESSION['success'] = '<div class = "msgs">Вы успешно отписались от этой темы.</div>';
}
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '.html');
exit;
}
if (isset($_SESSION['success'])) {
echo $_SESSION['success'];
unset($_SESSION['success']);
}
if ($theme->reason_close != NULL) {
echo "<div class = 'errs'>$theme->reason_close</div>";
}
$person = mysql_fetch_object(mysql_query('SELECT `id`, `nick`, `sex` FROM `user` WHERE `id` = ' . $theme->id_user));
$k_page = k_page($k_post, $set['p_str']);
$page = page($k_page);
$start = $set['p_str'] * $page - $set['p_str'];
echo "<table class = 'razd'><tr><td class = 'icon14'>";
echo avatar("$person->id", '48');
echo "</td><td class = 'null'>";
echo user($person->id) . " (" . date::time($theme->time) . ")<br />";
echo text::toOutput($theme->description);
if (isset($vote)) {
echo '<br /><br />';
?>
<style>
.votes {
background: url('/modules/forum/icons/votes/poll.gif') repeat-x;
border: 1px solid black;
height: 13px;
margin: 2px 1px 2px 0px;
-moz-border-radius: 4px; /*Mozilla-FireFox*/
-webkit-border-radius: 4px; /* Safari and Chrome*/
-khtml-border-radius: 4px; /* Linux browsers */
border-radius: 4px;
}
.votes img{
vertical-align: 1px;
margin: 0px;
padding: 0px;
-moz-border-radius:4px; /*Mozilla-FireFox*/
-webkit-border-radius: 4px; /* Safari and Chrome*/
-khtml-border-radius: 4px; /* Linux browsers */
border-radius: 4px;
}
</style>
<?php
$all_votes = mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_vote_voices` WHERE `id_vote` = ' . $vote->id), 0);
$i = 0;
echo "<b>" . text::toOutput($vote->name) . "</b>";
echo '<br />';
$vars = mysql_query('SELECT `id`, `variant` FROM `forum_votes_var` WHERE `id_vote` = ' . $vote->id . ' ORDER BY `id` ASC');
while ($var = mysql_fetch_object($vars)) {
$i++;
$vote_var = mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_vote_voices` WHERE `id_vote` = ' . $vote->id . ' AND `id_variant` = ' . $var->id), 0);
$procent = ($all_votes == 0) ? 0 : $vote_var / $all_votes * 100;
$procent = sprintf("%u", $procent);
echo text::toOutput($var->variant) . ' (' . $procent . '%) - ' . $vote_var . ' чел.';
if (isset($user) && $my_voice == 0) {
echo "<a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/vote=$var->id'>";
}
echo "<div class = 'votes'>";
echo "<img src = '" . DIR_FORUM . "icons/votes/poll$i.gif' alt = '$i' style = 'height: 13px; width: $procent%; " . (($procent > 0) ? 'border-right: 1px solid black;' : NULL) . " ' />";
echo "</div>";
if (isset($user) && $my_voice == 0) {
echo '</a>';
}
}
echo "Начало голосования: " . date::time($vote->time) . "<br />";
if ($vote->time_end > time()) {
echo 'Завершение голосования: ' . date::time($vote->time_end) . '<br />';
} elseif ($vote->time_end < time() && $vote->time_end != 0) {
echo 'Голосование завершено.<br />';
}
echo "Проголосовало: $all_votes чел.";
}
echo "<br /><br />";
if (isset($user) && $my_report == 0 && !user::access('forum_them_edit') && $user['id'] != $theme->id_user && $theme->reason_close == NULL) {
echo "<a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/report.html' class = 'add'>Пожаловаться</a> ";
}
if (isset($user) && $user['id'] != $theme->id_user) {
$journal = mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_journal` WHERE `id_theme` = "' . $theme->id . '" AND `id_user` = ' . $user['id']), 0);
$theme_journal = ($journal == 0) ? '<a href = "' . DIR_FORUM . '' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '/journal_yes">Подписаться</a>' : '<a href = "' . DIR_FORUM . '/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '/journal_no">Отписаться</a>';
echo "<span class = 'add'>$theme_journal</span>";
}
echo "</td></tr></table>";
if ($theme->time_edit != 0 && $theme->id_admin != 0) {
$admin = mysql_fetch_object(mysql_query('SELECT `id`, `nick` FROM `user` WHERE `id` = ' . $theme->id_admin));
echo "<div class = 'razd'>Последний раз редактировалось <a href = '/info.php?id=$admin->id'>$admin->nick</a> (" . date::time($theme->time_edit) . ")</div>";
}
echo "<div class = 'razd'>";
echo "<span style = 'float:right;'>";
echo "<a class = 'add'>" . img16('komm.png') . " $k_post</a>";
echo "</span>";
echo "" . ((!isset($_SESSION['sort_' . $user['id']])) ? '<span class = "activ">Вверху</span> <a href = "' . DIR_FORUM . '' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '/sort_1"><span class = "noactiv">Внизу</span></a>' : '<a href = "' . DIR_FORUM . '' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '/sort_0"><span class = "noactiv">Вверху</span></a> <span class = "activ">Внизу</span>');
echo "</div>";
if ($k_post == 0) {
echo "<div class = 'errs'>";
echo img16('error.png') . " Нет результатов";
echo "</div>";
}
if (isset($user) && ($theme->reason_close == NULL || ($theme->reason_close != NULL && user::access('forum_post_close')))) {
$cit = 0;
$privat = 0;
$text = '';
if (isset($_GET['cit'])) {
$cit = intval($_GET['cit']);
$answer = intval($_GET['answer']);
$text = mysql_fetch_object(mysql_query('SELECT `id`, `nick` FROM `user` WHERE `id` = ' . $answer))->nick . ', ';
echo "<form method = 'post' class = 'razd' action = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/cit=$cit/answer=$answer'>";
} elseif (isset($_GET['privat'])) {
$privat = intval($_GET['privat']);
$text = mysql_fetch_object(mysql_query('SELECT `id`, `nick` FROM `user` WHERE `id` = ' . $privat))->nick . ', ';
echo "<form method = 'post' class = 'razd' action = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/privat=$privat'>";
} elseif (isset($_GET['answer'])) {
$answer = intval($_GET['answer']);
$text = mysql_fetch_object(mysql_query('SELECT `id`, `nick` FROM `user` WHERE `id` = ' . $answer))->nick . ', ';
echo "<form class = 'razd' method = 'post' action = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/answer=$answer'>";
} else {
echo "<form method = 'post' class = 'razd' action = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id.html'>";
}
$cit = mysql_fetch_object(mysql_query('SELECT `text` FROM `forum_posts` WHERE `id` = ' . $cit));
if (isset($_GET['cit']) && isset($_GET['answer'])) {
echo "<div class = 'cit'>Цитирование сообщения: " . text::toOutput($cit->text) . "</div>";
}
echo "<textarea name = 'text' style = 'width: 62%; height: 50px'>$text</textarea><br />";
if ($user['set_files'] == 1) {
echo "<label><input type = 'checkbox' name = 'add_file' value = '1' /> Добавить файл</label><br />";
}
echo "<button name = 'comment' class = 'button sign-ins'>Отправить</button>";
echo "</form>";
}
if (isset($_GET['act_posts'])) {
echo "<form class = 'razd' action = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/act_posts' method = 'post' style = 'padding: 0px'>";
}
$post_count = $start;
$sort = (!isset($_SESSION['sort_' . $user['id']])) ? 'DESC' : 'ASC';
$limit = (isset($_GET['act_posts'])) ? NULL : ' LIMIT ' . $start . ', ' . $set['p_str'];
$posts = mysql_query('SELECT * FROM `forum_posts` WHERE `id_theme` = ' . $theme->id . ' ORDER BY `id` ' . $sort . $limit);
while ($post = mysql_fetch_object($posts)) {
$man = ($post->id_user != 0) ? mysql_fetch_object(mysql_query('SELECT `id`, `nick`, `sex` FROM `user` WHERE `id` = ' . $post->id_user)) : array();
$man_id = ($post->id_user != 0) ? $man->id : 0;
$man_pol = ($post->id_user != 0) ? $man->sex : 0;
$man_nick = ($post->id_user != 0) ? $man->nick : 'Система';
$privat = ($post->privat == $user['id'] || ($post->id_user == $user['id'] && $post->privat != 0)) ? '<span class = "privat">' : NULL;
$privat1 = ($post->privat == $user['id'] || ($post->id_user == $user['id'] && $post->privat != 0)) ? '</span>' : NULL;
$admin = ($post->hide == 1) ? mysql_fetch_object(mysql_query('SELECT `id`, `nick`, `sex` FROM `user` WHERE `id` = ' . $post->id_admin)) : NULL;
if ($post->privat == 0 || ($post->privat == $user['id'] || $post->id_user == $user['id']) || $user['group_access'] > 14) {
$post_count++;
echo '<a id = "' . $post->id . '"></a>';
echo "<table class = 'razd'><tr><td class = 'null'>";
if (isset($_GET['act_posts'])) {
echo "<input type = 'checkbox' name = 'act[]' value = '$post->id' />";
}
if ($user['id'] != $post->id_user && $post->id_user != 0) {
$_post = (isset($_GET['post'])) ? mysql_fetch_object(mysql_query('SELECT `id`, `rating`, `text` FROM `forum_posts` WHERE `id` = ' . intval($_GET['post']))) : NULL;
if (isset($user) && isset($_GET['like']) && mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_post_rating` WHERE `id_user` = ' . $user['id'] . ' AND `id_post` = ' . intval($_GET['post']) . ' AND `type` = "0"'), 0) == 0) {
$plus = (mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_post_rating` WHERE `id_user` = ' . $user['id'] . ' AND `id_post` = ' . intval($_GET['post']) . ' AND `type` = "1"'), 0) != 0) ? 2 : 1;
if (mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_post_rating` WHERE `id_user` = ' . $user['id'] . ' AND `id_post` = ' . intval($_GET['post'])), 0) != 0) {
mysql_query('UPDATE `forum_post_rating` SET `type` = "0" WHERE `id_post` = ' . intval($_GET['post']) . ' AND `id_theme` = ' . $theme->id . ' AND `id_user` = ' . $user['id']);
} else {
mysql_query('INSERT INTO `forum_post_rating` SET `id_theme` = ' . $theme->id . ', `id_user` = ' . $user['id'] . ', `type` = "0", `id_post` = ' . intval($_GET['post']));
}
mysql_query('UPDATE `forum_posts` SET `rating` = ' . ($_post->rating + $plus) . ' WHERE `id` = ' . intval($_GET['post']));
$_SESSION['success'] = '<div class = "msgs">Вы успешно проголосвали за пост.</div>';
$page = (is_numeric($_GET['page'])) ? intval($_GET['page']) : mysql_real_escape_string(trim($_GET['page']));
if ($page != 'end' && !is_numeric($page)) {
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '.html');
} else {
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '/page=' . $page . '#' . intval($_GET['post']));
}
exit;
} elseif (isset($user) && isset($_GET['dislike']) && mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_post_rating` WHERE `id_user` = ' . $user['id'] . ' AND `id_post` = ' . intval($_GET['post']) . ' AND `type` = "1"'), 0) == 0) {
$minus = (mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_post_rating` WHERE `id_user` = ' . $user['id'] . ' AND `id_post` = ' . intval($_GET['post']) . ' AND `type` = "0"'), 0) != 0) ? 2 : 1;
if (mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_post_rating` WHERE `id_user` = ' . $user['id'] . ' AND `id_post` = ' . intval($_GET['post'])), 0) != 0) {
mysql_query('UPDATE `forum_post_rating` SET `type` = "1" WHERE `id_post` = ' . intval($_GET['post']) . ' AND `id_theme` = ' . $theme->id . ' AND `id_user` = ' . $user['id']);
} else {
mysql_query('INSERT INTO `forum_post_rating` SET `id_theme` = ' . $theme->id . ', `id_user` = ' . $user['id'] . ', `type` = "1", `id_post` = ' . intval($_GET['post']));
}
if (($_post->rating - $minus) < -5) {
$persons = mysql_query('SELECT `id`, `group_access` FROM `user` WHERE `group_access` > "2"');
while ($person = mysql_fetch_object($persons)) {
$access = mysql_result(mysql_query('SELECT COUNT(*) FROM `user_group_access` WHERE `id_group` = ' . $person->group_access . ' AND `id_access` = "forum_post_ed"'), 0);
if ($access != 0) {
$msg = 'Комментарий в теме [url=/modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '/page=' . $page . '#' . $_post->id . ']' . $theme->name . '[/url] набрал много отрицательных отзывов. Есть подозрение, что он нарушает правила форума.
[b]Сам комментарий:[/b]
' . text::toOutput($_post->text);
mysql_query('INSERT INTO `mail` SET `id_user` = "0", `id_kont` = ' . $person->id . ', `msg` = "' . mysql_real_escape_string($msg) . '", `time` = ' . $time);
}
}
}
mysql_query('UPDATE `forum_posts` SET `rating` = ' . ($_post->rating - $minus) . ' WHERE `id` = ' . intval($_GET['post']));
$_SESSION['success'] = '<div class = "msgs">Вы успешно проголосвали за пост.</div>';
$page = (is_numeric($_GET['page'])) ? intval($_GET['page']) : mysql_real_escape_string(trim($_GET['page']));
if ($page != 'end' && !is_numeric($page)) {
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '.html');
} else {
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '/page=' . $page . '#' . intval($_GET['post']));
}
exit;
}
echo "<span style = 'float: right;'>";
if (isset($user) && mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_post_rating` WHERE `id_user` = ' . $user['id'] . ' AND `id_post` = ' . $post->id . ' AND `type` = "0"'), 0) == 0) {
echo "<a class = 'add' href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/page=$page/$post->id/like'>" . img16('r_up.png') . "</a>";
}
echo "<a class = 'add'><font color = 'yellow'>" . img16('like.png') . " $post->rating</font></a>";
if (isset($user) && mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_post_rating` WHERE `id_user` = ' . $user['id'] . ' AND `id_post` = ' . $post->id . ' AND `type` = "1"'), 0) == 0) {
echo "<a class = 'add' href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/page=$page/$post->id/dislike'>" . img16('r_down.png') . "</a>";
}
echo "</span>";
} else {
echo "<span style = 'float: right;' class = 'add'><font color = 'yellow'>" . img16('like.png') . " $post->rating</font></span>";
}
echo "$post_count) ";
echo user($man_id) . " (" . date::time($post->time) . ")<br />";
if (isset($_GET['edit']) && $_GET['edit'] == $post->id) {
$edit_post = mysql_fetch_object(mysql_query('SELECT `id`, `id_user`, `text` FROM `forum_posts` WHERE `id` = ' . intval($_GET['edit'])));
if (isset($user) && (user::access('forum_post_ed') || ($theme->reason_close == NULL && $user['id'] == $edit_post->id_user && $last_post == $edit_post->id))) {
echo "<form action = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id.html' method = 'post'>";
echo "<input type = 'hidden' name = 'id_post' value = '" . intval($_GET['edit']) . "' />";
echo "<textarea name = 'post' style = 'width: 62%; height: 50px'>$edit_post->text</textarea><br />";
echo "<button name = 'edit_post' class = 'button sign-ins'>Сохранить</button>";
echo "<button name = 'cancel_edit' class = 'button sign-ins'>Отмена";
echo "</button></form>";
} else {
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '.html');
exit;
}
} else {
if ($post->hide == 1) {
if (user::access('forum_post_ed')) {
echo '<br /><s>' . text::toOutput($post->text) . '</s><br />';
}
} else {
if (mysql_result(mysql_query('SELECT MAX(`rating`) FROM `forum_posts` WHERE `rating` > "5" AND `id_theme` = ' . $theme->id), 0) == $post->rating) {
echo "<span style = 'float: right; padding-left: 10px; color: #ffff00;'>Лучший ответ</span>";
}
if ($post->cit != 0 && mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_posts` WHERE `id` = ' . $post->cit), 0) != 0) {
$cit_post = mysql_fetch_object(mysql_query('SELECT `id_user`, `text`, `time` FROM `forum_posts` WHERE `id` = ' . $post->cit));
$user_cit = mysql_fetch_object(mysql_query('SELECT `id`, `nick` FROM `user` WHERE `id` = ' . $cit_post->id_user));
echo "<span class = 'cit'>";
echo "<b>$user_cit->nick (" . date::time($cit_post->time) . "):</b><br />";
echo text::toOutput($cit_post->text) . '<br />';
echo "</span>";
}
echo $privat;
echo text::toOutput($post->text) . '<br />';
echo $privat1;
}
}
if ($post->hide == 0 || ($post->hide == 1 && user::access('forum_post_ed'))) {
$files = mysql_query('SELECT * FROM `forum_post_files` WHERE `id_post` = ' . $post->id);
if (mysql_num_rows($files) != 0) {
echo '<br /><b>Прикреплённые файлы:</b><br />';
while ($file = mysql_fetch_object($files)) {
$ras = strtolower(preg_replace('#^.*.#', NULL, $file->name));
if ($ras == 'jpg' || $ras == 'jpeg' || $ras == 'gif' || $ras == 'png' || $ras == 'bmp' || $ras == 'ico') {
$icon = '/sys/forum/' . $file->name;
} elseif ($ras == '3gp' || $ras == 'mp4' || $ras == 'avi' || $ras == 'mpeg' || $ras == 'flv' || $ras == 'wmv' || $ras == 'mkv') {
$icon = '/modules/forum/icons/files/video.png';
} elseif ($ras == 'docx' || $ras == 'doc' || $ras == 'docm' || $ras == 'dotx' || $ras == 'dot' || $ras == 'dotm') {
$icon = '/modules/forum/icons/files/word.png';
} elseif ($ras == 'mp1' || $ras == 'mp2' || $ras == 'mp3' || $ras == 'wav' || $ras == 'aif' || $ras == 'ape' || $ras == 'flac' || $ras == 'ogg' || $ras == 'asf' || $ras == 'wma') {
$icon = '/modules/forum/icons/files/music.png';
} elseif ($ras == 'zip' || $ras == 'rar' || $ras == 'tar' || $ras == '7-zip' || $ras == 'gzip' || $ras == 'jar' || $ras == 'jad' || $ras == 'war' || $ras == 'xar') {
$icon = '/modules/forum/icons/files/archive.png';
} elseif ($ras == 'txt' || $ras == 'xml') {
$icon = '/modules/forum/icons/files/txt.png';
} elseif ($ras == 'pdf') {
$icon = '/modules/forum/icons/files/pdf.png';
} elseif ($ras == 'psd') {
$icon = '/modules/forum/icons/files/psd.png';
} else {
$icon = '/modules/forum/icons/files/file.png';
}
echo "<table class = 'razd' cellspacing = '0' cellpadding = '0' border = '0'><tr>";
echo "<td class = 'null' style = 'width: 50px; border-right: none'><img src = '$icon' alt = '' style = 'width: 50px; height: 50px;' /> </td>";
echo "<td class = 'null' style = 'border-left: none'>";
echo "<a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/download_$file->id'>";
echo text::toOutput($file->real_name, 1, 1, 0, 0, 0);
echo "</a> (" . size_file($file->size) . ")<br />";
echo "Скачали: $file->count_downloads чел.";
if ($user['id'] == $post->id_user || user::access('forum_post_ed')) {
echo "<br />[ <a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/del_file=$file->id'>Удалить файл</a> ]";
}
echo "</td></tr></table>";
}
echo '<br />';
}
}
#Действия пользователя к посту
if (isset($user) && ((isset($_GET['edit']) && $post->id != $_GET['edit']) || !isset($_GET['edit']))) {
if ($user['id'] != $post->id_user && $post->id_user != 0 && $post->hide == 0 && ($theme->reason_close == NULL || ($theme->reason_close != NULL && user::access('forum_post_close')))) {
echo "<a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/answer=$man_id' title = 'Ответить'>" . img16('pen.png') . "</a>
<a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/cit=$post->id/answer=$man_id' title = 'Цитировать'>" . img16('cit.png') . "</a>
<a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/privat=$man_id' title = 'Приватно'>" . img16('uho.png') . "</a>";
}
if ($post->id_user != 0 && (user::access('forum_post_ed') || ($theme->reason_close == NULL && $user['id'] == $post->id_user && $last_post == $post->id))) {
$razd = (user::access('forum_post_ed') && $post->hide == 0 && $post->id_user != $user['id']) ? ' ' : NULL;
echo $razd . "<a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/edit_$post->id#$post->id' title = 'Редактировать'>" . img16('set.png') . "</a> ";
}
if (user::access('forum_post_ed')) {
$razd = ($post->id_user == 0) ? NULL : ' ';
echo $razd;
echo "<a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/delete_post=$post->id' title = 'Удалить'>" . img16('musor.png') . "</a> ";
if ($post->hide == 0) {
echo "<a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/hide=$post->id' title = 'Скрыть'>" . img16('hide.png') . "</a> ";
} else {
echo "<a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/display=$post->id' title = 'Показать'>" . img16('hides.png') . "</a> ";
}
}
}
if ($post->count_edit != 0) {
echo "<br /><br /><a class = 'add'>($post->count_edit) Посл. ред. " . date::time($post->last_edit) . " - $post->who_edit</a>";
if ($post->hide == 1) {
echo "<br />";
}
}
if ($post->hide == 1) {
if ($post->count_edit == 0) {
echo "<br /><br />";
} else {
echo "<br />";
}
echo "<a class = 'add'>Комментарий скрыл " . (($admin->sex == 0) ? 'а' : NULL) . " <a href = '/info.php?id=$admin->id'>$admin->nick</a></a>";
}
echo "</td></tr></table>";
}
}
if (isset($_GET['act_posts'])) {
echo "<button name = 'delete_posts' class = 'button sign-ins'>Удалить</button>";
echo "<button name = 'hide_posts' class = 'button sign-ins'>Скрыть</button>";
echo "<button name = 'display_posts' class = 'button sign-ins'>Показать";
echo "</button></form>";
}
if ($k_page > 1) {
str('/modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '/', $k_page, $page);
}
$who = 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);
$count_files = mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_post_files` WHERE `id_theme` = ' . $theme->id), 0);
#Файлы и люди темы
echo "<div class = 'razd'>";
echo img16('001.png') . " <a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/who.html'>Сейчас в теме</a> <a class = 'add'>$who</a><br /><br />";
echo img16('files.png') . " <a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/files.html'>Файлы в теме</a> <a class = 'add'>$count_files</a>";
echo "</div>";
if ((user::access('forum_them_edit') || $user['id'] == $theme->id_user) && ($theme->reason_close == NULL || ($theme->reason_close != NULL && user::access('forum_post_close')))) {
#Редактирование темы
echo "<div class = 'razd'>";
echo img16('set.png') . " <a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/edit_theme.html'>Редактировать тему</a>";
echo "</div>";
if (mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_votes` WHERE `id_theme` = ' . $theme->id), 0) == 0 && ($theme->reason_close == NULL || ($theme->reason_close != NULL && user::access('forum_post_close'))) && $user['id'] == $theme->id_user) {
#Создание голосования
echo "<div class = 'razd'>";
echo img16('votes.png') . " <a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/create_vote.html'>Прикрепить голосование</a>";
echo "</div>";
} elseif (mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_votes` WHERE `id_theme` = ' . $theme->id), 0) != 0 && ($theme->reason_close == NULL || ($theme->reason_close != NULL && user::access('forum_post_close'))) && $user['id'] == $theme->id_user) {
#Редактирование голосования
echo "<div class = 'razd'>";
echo img16('votes.png') . " <a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/edit_vote.html'>Редактировать голосование</a>";
echo "</div>";
}
if (user::access('forum_them_edit')) {
echo "<div class = 'razd'>";
if ($theme->reason_close == NULL && user::access('forum_post_close')) {
#Закрываем тему
echo img16('theme_close.png') . " <a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/close_theme.html'>Закрыть тему</a><br /><br />";
} elseif ($theme->reason_close != NULL && user::access('forum_post_close')) {
#Открываем тему
echo img16('theme.png') . " <a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/open_theme.html'>Открыть тему</a><br /><br />";
}
if (user::access('forum_post_ed')) {
#Чистим тему
echo img16('clean.png') . " <a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/cleare_theme.html'>Очистить тему</a>";
}
echo "</div>";
}
if (user::access('forum_post_ed') && user::access('forum_them_edit')) {
#Действия над постами
echo "<div class = 'razd'>";
if (!isset($_GET['act_posts'])) {
echo img16('posts.png') . " <a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/act_posts'>Действия над постами</a>";
} else {
echo img16('posts.png') . " <a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id.html'>Отменить действие</a>";
}
echo "</div>";
}
}
}