Файл: modules/forum/view/theme.php
Строк: 568
<?php
/* DCMS S (Special)
* Версия файла 0.0.1
* Дата последнего редактирования 23.11.2015
* Модифицировал densnet
* Автор yadalay
*/
$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);
$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: /modules/forum/files/' . $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')) {
msg('Тема успешно открыта.');
$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 = 'alert alert-danger'>Слишком короткая причина. Указывайте нормальную причину, если не хотите быть забаненым администрацией.</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 . '"');
msg('Жалоба успешно отправлена на рассмотрение администрацией.');
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '.html');
exit;
}
}
echo "<form method = 'post' class = 'card-block' action = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/report.html'>";
echo "<b>Укажите причину:</b><br />";
echo "<textarea name='text' class='form-control' rows='3'></textarea><br />";
echo "<button class='btn btn-success' name='send'>Отправить</button>";
echo "</form>";
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')) {
msg('Комментарий успешно удалён.');
$files = mysql_query('SELECT `name` FROM `forum_post_files` WHERE `id_post` = ' . intval($_GET['delete_post']));
while ($file = mysql_fetch_object($files)) {
unlink('/modules/forum/files/' . $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')) {
msg('Комментарий успешно скрыт.');
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')) {
msg('Комментарий успешно показан вновь.');
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) {
msg('Ваш голос успешно учтён.');
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'))) {
msg('Файл успешно удалён.');
$file = mysql_fetch_object(mysql_query('SELECT `id`, `id_post`, `name` FROM `forum_post_files` WHERE `id` = ' . intval($_GET['del_file'])));
unlink('/modules/forum/files/' . $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 = 'list-group-item list-group-item-info'>В тексте сообщения обнаружен мат: $mat.</div>";
} elseif (mb_strlen($text) < 2) {
echo "<div class = 'list-group-item list-group-item-info'>Комментарий слишком короткий.</div>";
} elseif (mysql_result(mysql_query('SELECT COUNT(*) FROM `forum_posts` WHERE `id_user` = ' . $user['id'] . ' AND `text` = "' . $text . '"'), 0) != 0) {
echo "<div class = 'list-group-item list-group-item-info'>Вы уже писали это в данной теме. Будьте оригинальнее.</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 . '"');
}
msg('Комментарий успешно добавлен.');
$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']);
msg('Вы успешно подписались на эту тему.');
}
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']);
msg('Вы успешно отписались от этой темы.');
}
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 = 'list-group-item list-group-item-info'>$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 = 'card-block'><tr><td class = 'icon14'>";
echo avatar("$person->id", '48');
echo "</td><td class = 'null'>";
echo user($person->id) . " <span style = 'color: #9197a3;' title='" . date::time($theme->time) . "'>" . date::times($theme->time) . "</span><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: 5px;
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::times($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 чел.";
}
if (isset($user) && $my_report == 0 && !user::access('forum_them_edit') && $user['id'] != $theme->id_user && $theme->reason_close == NULL) {
echo "<br /><br /><a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/report.html'><span class='fa fa-flag'></span> Пожаловаться</a> ";
}
if (isset($user) && $user['id'] != $theme->id_user) {
if (isset($user) && $my_report == 0 && !user::access('forum_them_edit') && $user['id'] != $theme->id_user && $theme->reason_close == NULL) {
} else {
echo "<br /><br />";
}
$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 = '/modules/forum/$forum->id/$razdel->id/$theme->id/journal_yes'><span class='fa fa-rss'></span> Подписаться</a>" : "<a href = '/modules/forum/$forum->id/$razdel->id/$theme->id/journal_no' style = 'color: #9777A8;'><img src = '/style/icons/set.png' /> Вы подписаны</a>";
echo " $theme_journal";
}
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='card-block' style='border-bottom: 1px solid #dcdee3;color: #9197a3;'>Посл. раз редактировалось <a href = '/info.php?id=$admin->id'>$admin->nick</a> <small>(" . date::timek($theme->time_edit) . ")</small></div>";
}
echo "<div class='card-block' style='border-bottom: 1px solid #dcdee3;'>";
echo sklon_text($k_post, array('комментарий', 'комментария', 'комментариев')) . "<br />";
echo "Новые: " . ((!isset($_SESSION['sort_' . $user['id']])) ? '<b>Вверху</b> | <a href = "' . DIR_FORUM . '' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '/sort_1">Внизу</a>' : '<a href = "' . DIR_FORUM . '' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '/sort_0">Вверху</a> | <b>Внизу</b>');
echo "</div>";
if ($k_post == 0) {
echo "<div class='card-block' style='border-bottom: 1px solid #dcdee3;'>";
echo "<span class='fa fa-info-circle'></span> Нет результатов";
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 = 'card-block' 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 = 'card-block' 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='card-block' method='post' action='" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/answer=$answer'>";
} else {
echo "<form method='post' class='card-block' 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' class='form-control' rows='3'>$text</textarea>";
if ($user['set_files'] == 1) {
echo "<label class='c-input c-checkbox'><input type='checkbox' name='add_file' value='1' /><span class='c-indicator'></span> Добавить файл</label>";
}
echo "<br /><button name='comment' class='btn btn-success'>Отправить</button>";
echo "</form>";
}
if (isset($_GET['act_posts'])) {
echo "<form class='card-block' 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 style = "color: blue"><span class="fa fa-lock"></span></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 "<div class='card-block' style='border-bottom: 1px solid #dcdee3;'>";
if (isset($_GET['act_posts'])) {
echo "<input type = 'checkbox' name = 'act[]' value = '$post->id' /> ";
}
//echo "<span style = 'float:right;'>#$post_count</span>";
if (isset($user) && ((isset($_GET['edit']) && $post->id != $_GET['edit']) || !isset($_GET['edit']))) {
echo "<span style = 'float:right;'>";
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' data-toggle='tooltip' data-placement='left' title = 'Ответить'><span class='fa fa-pencil'></span></a> ";
echo "<a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/cit=$post->id/answer=$man_id' data-toggle='tooltip' data-placement='left' title = 'Цитировать'><span class='fa fa-quote-right'></span></a> ";
echo "<a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/privat=$man_id' data-toggle='tooltip' data-placement='left' title = 'Приватно'><span class='fa fa-user-secret'></span></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' data-toggle='tooltip' data-placement='left' title = 'Редактировать'><span class='fa fa-pencil-square-o'></span></a> ";
}
if (user::access('forum_post_ed')) {
$razd = ($post->id_user == 0) ? NULL : ' ';
echo $razd;
if ($post->hide == 0) {
echo " <a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/hide=$post->id' data-toggle='tooltip' data-placement='left' title = 'Скрыть'><span class='fa fa-eye-slash'></span></a> ";
} else {
echo " <a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/display=$post->id' data-toggle='tooltip' data-placement='left' title = 'Показать'><span class='fa fa-eye'></span></a> ";
}
echo "<a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/delete_post=$post->id' data-toggle='tooltip' data-placement='left' title = 'Удалить'><span class='fa fa-trash-o'></span></a> ";
}
echo "</span>";
}
echo user($man_id) . " <small style = 'color: #9197a3;'>" . date::timek($post->time) . " $privat</small><br />";
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']));
msg('Вы успешно проголосвали за пост.');
$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']));
msg('Вы успешно проголосвали за пост');
$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; padding-left: 5px'>";
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 href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/page=$page/$post->id/like' data-toggle='tooltip' data-placement='left' title='Мне нравится' style = 'color:#B2B2B2;'>$post->rating <span class='fa fa-heart'></span></a>";
} else {
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 href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/page=$page/$post->id/dislike' data-toggle='tooltip' data-placement='left' title='Мне не нравится' style = 'color:#EA5E5E;'>$post->rating <span class='fa fa-heart'></span></a>";
}
}
echo "</span>";
} else {
echo "<span style = 'float: right; padding-left: 5px; color:#B2B2B2;'>$post->rating <span class='fa fa-heart'></span></span>";
}
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' class='form-control' rows='3'>$edit_post->text</textarea><br />";
echo "<button name = 'edit_post' class = 'btn btn-success'>Сохранить</button> ";
echo "<button name = 'cancel_edit' class = 'btn btn-default'>Отмена</button>";
echo "</form>";
} else {
header('Location: /modules/forum/' . $forum->id . '/' . $razdel->id . '/' . $theme->id . '.html');
exit;
}
} else {
if ($post->hide == 1) {
echo "<small style = 'color: #9197a3;'>Комментарий скрыл " . (($admin->sex == 0) ? 'а' : NULL) . " <a href = '/info.php?id=$admin->id'>$admin->nick</a></small><br />";
if (user::access('forum_post_ed')) {
echo '<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 "<div class = 'card-block'>";
echo "<b>$user_cit->nick : <small style = 'color: #9197a3;'>" . date::times($cit_post->time) . "</small></b><br />";
echo text::toOutput($cit_post->text) . '<br />';
echo "</div>";
}
echo text::toOutput($post->text) . '<br />';
}
}
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') {
$r = "<span class='fa fa-file-image-o'></span>";
} elseif ($ras == '3gp' || $ras == 'mp4' || $ras == 'avi' || $ras == 'mpeg' || $ras == 'flv' || $ras == 'wmv' || $ras == 'mkv') {
$r = "<span class='fa fa-file-video-o'></span>";
} elseif ($ras == 'docx' || $ras == 'doc' || $ras == 'docm' || $ras == 'dotx' || $ras == 'dot' || $ras == 'dotm') {
$r = "<span class='fa fa-file-text-o'></span>";
} elseif ($ras == 'mp1' || $ras == 'mp2' || $ras == 'mp3' || $ras == 'wav' || $ras == 'aif' || $ras == 'ape' || $ras == 'flac' || $ras == 'ogg' || $ras == 'asf' || $ras == 'wma') {
$r = "<span class='fa fa-file-audio-o'></span>";
} elseif ($ras == 'zip' || $ras == 'rar' || $ras == 'tar' || $ras == '7-zip' || $ras == 'gzip' || $ras == 'jar' || $ras == 'jad' || $ras == 'war' || $ras == 'xar') {
$r = "<span class='fa fa-file-archive-o'></span>";
} elseif ($ras == 'txt' || $ras == 'xml') {
$r = "<span class='fa fa-file-text-o'></span>";
} elseif ($ras == 'pdf') {
$r = "<span class='fa fa-file-text-o'></span>";
} elseif ($ras == 'psd') {
$r = "<span class='fa fa-file-image-o'></span>";
} else {
$r = "<span class='fa fa-file-o'></span>";
}
$icon = '/modules/forum/files/' . $file->name;
echo "<div class='card-block' style='border-bottom: 1px solid #dcdee3;'>";
if ($user['id'] == $post->id_user || user::access('forum_post_ed')) {
echo "<span style = 'float:right;'>";
echo "<a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/del_file=$file->id' data-toggle='tooltip' data-placement='left' title='Удалить файл'><span class='fa fa-trash-o'></span></a>";
echo "</span>";
}
echo "<img src='$icon' style = 'width: 40px;height: 40px;padding:3px;' class = 'avatar'/><a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/download_$file->id'>$r " . text::toOutput($file->real_name, 1, 1, 0, 0, 0) . "</a> (" . size_file($file->size) . " ";
echo "<span style = 'color: #88C057;'><span class='fa fa-download'></span> $file->count_downloads чел.</span>)";
echo "</div>";
}
}
}
if ($post->count_edit != 0) {
echo "<small style = 'color: #9197a3;'><span class='fa fa-pencil'></span> Посл. ред. " . date::timek($post->last_edit) . " - $post->who_edit</small><br />";
}
echo "</div>";
}
}
if (isset($_GET['act_posts'])) {
echo "<button name='delete_posts' class='btn btn-success'>Удалить</button> ";
echo "<button name='hide_posts' class='btn btn-success'>Скрыть</button> ";
echo "<button name='display_posts' class='btn btn-success'>Показать</button>";
echo "</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 "<a href='" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/who.html' class='list-group-item'><span class='fa fa-user fa-fw'></span> Сейчас в теме <span class='label label-default label-pill pull-right'>$who</span></a>";
echo "<a href='" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/files.html' class='list-group-item'><span class='fa fa-file fa-fw'></span> Файлы в теме <span class='label label-default label-pill pull-right'>$count_files</span></a>";
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 "<a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/edit_theme.html' class = 'list-group-item'><span class='fa fa-pencil-square-o fa-fw'></span> Редактировать</a>";
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 "<a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/create_vote.html' class = 'list-group-item'><span class='fa fa-pie-chart fa-fw'></span> Создать голосование</a>";
} 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 "<a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/edit_vote.html' class = 'list-group-item'><span class='fa fa-pie-chart fa-fw'></span> Ред. голосование</a>";
}
if (user::access('forum_them_edit')) {
if ($theme->reason_close == NULL && user::access('forum_post_close')) {
echo "<a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/close_theme.html' class = 'list-group-item'><span class='fa fa-lock fa-fw'></span> Закрыть тему</a>";
} elseif ($theme->reason_close != NULL && user::access('forum_post_close')) {
echo "<a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/open_theme.html' class = 'list-group-item'><span class='fa fa-unlock fa-fw'></span> Открыть тему</a>";
}
if (user::access('forum_post_ed')) {
echo "<a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/cleare_theme.html' class = 'list-group-item'><span class='fa fa-trash fa-fw'></span> Очистить тему</a>";
}
}
if (user::access('forum_post_ed') && user::access('forum_them_edit')) {
if (!isset($_GET['act_posts'])) {
echo "<a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id/act_posts' class = 'list-group-item'><span class='fa fa-location-arrow fa-fw'></span> Действия над постами</a>";
} else {
echo "<a href = '" . DIR_FORUM . "$forum->id/$razdel->id/$theme->id.html' class = 'list-group-item'><span class='fa fa-ban fa-fw'></span> Отменить действие</a>";
}
}
}
echo "<div class='card-block'>";
echo "<a href='" . DIR_FORUM . "$forum->id/'><span class='fa fa-arrow-left fa-fw'></span> " . text::toOutput($forum->name, 1, 1, 0, 0, 0) . "</a><br />";
echo "<a href='" . DIR_FORUM . "$forum->id/$razdel->id/'><span class='fa fa-arrow-left fa-fw'></span> " . text::toOutput($razdel->name, 1, 1, 0, 0, 0) . "</a>";
echo "</div>";
}