Файл: soc-set/moduls/forum/index.php
Строк: 191
<?php
require_once('../../core/start.php');
check_auth();
switch ($select) {
default:
head('Форумы');
panel();
?>
<style>
ul {
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 15px;
}
</style>
<?php
if ($_POST['add'] && privilegy('forum')) {
$name = html($_POST['name']);
if (empty($name)) {
echo DIV_ERROR . 'Введите название форума' . CLOSE_DIV;
} else {
DB::$dbs->query("INSERT INTO ".FORUMS." (`name`) VALUES (?)", array($name));
header("Location: ".HOME."/forums/");
}
}
/*$new = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".FORUM_NEW_POST." WHERE `user_id` = ? && `status` = ? ", array($user['user_id'], 1));
if ($new > 0){
echo DIV_LI . '<a href="'.HOME.'/forum/new/"><b>Непрочитанные темы</b></a> ['.$new.']' . CLOSE_DIV;
}*/
echo DIV_BLOCK;
echo '<a href="'.HOME.'/forum/new_posts/">Новые посты</a><br />';
echo '<a href="'.HOME.'/forum/my_posts/">Мои посты</a><br />';
echo '<a href="'.HOME.'/forum/new_themes/">Новые темы</a><br />';
echo '<a href="'.HOME.'/forum/activ_themes/">Активные темы</a><br />';
echo CLOSE_DIV;
$all = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".FORUMS."");
if ($all == 0) {
echo DIV_AUT . 'Форумов нет' . CLOSE_DIV;
} else {
$sql = DB::$dbs->query("SELECT * FROM ".FORUMS."");
while($forum = $sql -> fetch()) {
$themes = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".FORUMS_THEME." WHERE `forum_id` = ? ", array($forum['id']));
$posts = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".FORUMS_POST." WHERE `forum_id` = ? ", array($forum['id']));
echo DIV_BLOCK . '<a href="'.HOME.'/forum/'.$forum['id'].'/">'.$forum['name'].'</a> ['.$themes.'/'.$posts.']';
/* Последняя активная тема */
$theme = DB::$dbs->queryFetch("SELECT * FROM ".FORUMS_THEME." WHERE `forum_id` = ? ORDER BY `activ` DESC LIMIT 1", array($forum['id']));
if (!empty($theme)) {
echo '<ul>';
$posts = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".FORUMS_POST." WHERE `theme_id` = ? ", array($theme['id']));
$post = DB::$dbs->queryFetch("SELECT * FROM ".FORUMS_POST." WHERE `theme_id` = ? ORDER BY `time` DESC LIMIT 1", array($theme['id']));
$page = ceil(($posts / $config['write']['forum_post']));
echo '<li><a href="'.HOME.'/forum/'.$theme['forum_id'].'/'.$theme['forumc_id'].'/'.$theme['id'].'/">'.$theme['name'].'</a> ['.$posts.'] <a href="'.HOME.'/forum/'.$theme['forum_id'].'/'.$theme['forumc_id'].'/'.$theme['id'].'/?p='.$page.'">[>>]</a></li>
<li>'.user_choice($theme['user_id'], 'link').' / '.user_choice($post['user_id'], 'link').'</li>';
echo '</ul>';
} else {
echo '<ul>';
echo '<li>Темы не созданы</li>';
echo '</ul>';
}
echo CLOSE_DIV;
}
}
if (privilegy('forum')) {
echo DIV_AUT;
echo '<form action="#" method="POST">';
echo 'Новый форум:<br /><input type="text" name="name" />';
echo '<input type="submit" name="add" value="+" /></form>';
echo CLOSE_DIV;
}
echo DIV_AUT . '<b>Поиск тем:</b><br />';
echo '<form action="'.HOME.'/forum/search/" method="POST">';
echo '<input type="text" name="q" /><input type="submit" name="search" value="Найти" /><br />';
echo '</fotm>' . CLOSE_DIV;
$array = array('Форум');
nav($array);
break;
case 'ustav':
$forum = DB::$dbs->queryFetch("SELECT * FROM ".FORUMS." WHERE `id` = ? ", array(abs(num($_GET['forum']))));
if (empty($forum)) {
head('Форум не найден');
echo DIV_TITLE . 'Форум не найден' . CLOSE_DIV;
echo DIV_ERROR . 'Ошибка!' . CLOSE_DIV;
} else {
head('Правила раздела: ' . $forum['name']);
panel();
if (isset($_GET['ustav']) && privilegy('forum')) {
if ($_POST['send']) {
$ustav = html($_POST['ustav']);
DB::$dbs->query("UPDATE ".FORUMS." SET `ustav` = ? WHERE `id` = ? ", array($ustav, $forum['id']));
header("Location: ".HOME."/forum/ustav/".$forum['id']."/");
}
echo DIV_AUT;
echo '<form action="#" method="POST">';
echo 'Правила форума:<br /><textarea name="ustav">'.$forum['ustav'].'</textarea><br />';
echo '<input type="submit" name="send" value="Изменить" /></form>';
echo CLOSE_DIV;
}
echo DIV_BLOCK . 'Правила раздела: <b>' . $forum['name'] . '</b>' . CLOSE_DIV
. DIV_BLOCK . (!empty($forum['ustav']) ?
text($forum['ustav'])
:
'Правила не заполнены')
. CLOSE_DIV;
if (privilegy('forum')) {
echo DIV_LI . '<a href="?ustav">Редактировать правила</a>' . CLOSE_DIV;
}
echo DIV_LI . '<b><a href="'.HOME.'/forum/">Вернуться назад</a></b>' . CLOSE_DIV;
}
$array = array('Форум');
nav($array);
break;
case 'forum':
$forum = DB::$dbs->queryFetch("SELECT * FROM ".FORUMS." WHERE `id` = ? ", array(abs(num($_GET['forum']))));
if (empty($forum)) {
head('Форум не найден');
echo DIV_TITLE . 'Форум не найден' . CLOSE_DIV;
echo DIV_ERROR . 'Ошибка!' . CLOSE_DIV;
} else {
head('Форум: ' . $forum['name']);
panel();
if (isset($_GET['ustav']) && privilegy('forum')) {
if ($_POST['send']) {
$ustav = html($_POST['ustav']);
DB::$dbs->query("UPDATE ".FORUMS." SET `ustav` = ? WHERE `id` = ? ", array($ustav, $forum['id']));
header("Location: ".HOME."/forum/".$forum['id']."/?ustav");
}
echo DIV_AUT;
echo '<form action="#" method="POST">';
echo 'Правила форума:<br /><textarea name="ustav">'.$forum['ustav'].'</textarea><br />';
echo '<input type="submit" name="send" value="Изменить" /></form>';
echo CLOSE_DIV;
}
if (isset($_GET['del']) && privilegy('forum')) {
if (!isset($_GET['go'])) {
echo DIV_LI . '<b>Подтвердите удаление:</b> <a href="?del&go">[Удалить]</a> <a href="'.HOME.'/forum/'.$forum['id'].'/">[Нет]</a>' . CLOSE_DIV;
} else {
DB::$dbs->query("DELETE FROM ".FORUMS_CAT." WHERE `forum_id` = ? ", array($forum['id']));
DB::$dbs->query("DELETE FROM ".FORUMS." WHERE `id` = ? ", array($forum['id']));
header("Location: ".HOME."/forums/");
}
}
if (isset($_GET['edit']) && privilegy('forum')) {
if ($_POST['edit']) {
$name = html($_POST['name']);
if (empty($name)) {
echo DIV_ERROR . 'Введите название форума' . CLOSE_DIV;
} else {
DB::$dbs->query("UPDATE ".FORUMS." SET `name` = ? WHERE `id` = ? ", array($name, $forum['id']));
header("Location: ".HOME."/forum/".$forum['id']."/");
}
}
echo DIV_AUT;
echo '<form action="#" method="POST">';
echo 'Редактирование форума:<br /><input type="text" value="'.$forum['name'].'" name="name" />';
echo '<input type="submit" name="edit" value="Изменить" /></form>';
echo CLOSE_DIV;
}
if ($_POST['add'] && privilegy('forum')) {
$name = html($_POST['name']);
if (empty($name)) {
echo DIV_ERROR . 'Введите название подфорума' . CLOSE_DIV;
} else {
DB::$dbs->query("INSERT INTO ".FORUMS_CAT." (`forum_id`, `name`) VALUES (?, ?)", array($forum['id'], $name));
header("Location: ".HOME."/forum/".$forum['id']."/");
}
}
$all = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".FORUMS_CAT." WHERE `forum_id` = ?", array($forum['id']));
if ($all == 0) {
echo DIV_AUT . 'Подфорумов нет' . CLOSE_DIV;
} else {
$n = new Navigator($all,$config['write']['forum_razd'],'forum='.$forum['id'].'&select=forum');
$sql = DB::$dbs->query("SELECT * FROM ".FORUMS_CAT." WHERE `forum_id` = ? LIMIT {$n->start()}, ".$config['write']['forum_razd']." ", array($forum['id']));
while($forumc = $sql -> fetch()) {
$themes = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".FORUMS_THEME." WHERE `forumc_id` = ? ", array($forumc['id']));
$posts = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".FORUMS_POST." WHERE `forumc_id` = ? ", array($forumc['id']));
echo DIV_LI . '<a href="'.HOME.'/forum/'.$forum['id'].'/'.$forumc['id'].'/">'.$forumc['name'].'</a> ['.$themes.'/'.$posts.']' . CLOSE_DIV;
}
echo $n->navi();
}
}
echo DIV_LI . '<b><a href="'.HOME.'/forum/ustav/'.$forum['id'].'/">Правила раздела</a></b>' . CLOSE_DIV;
echo DIV_LI . '<b><a href="'.HOME.'/forum/">Вернуться назад</a></b>' . CLOSE_DIV;
if (privilegy('forum')) {
echo DIV_AUT;
echo '<form action="#" method="POST">';
echo 'Новый подфорум:<br /><input type="text" name="name" />';
echo '<input type="submit" name="add" value="+" /></form>';
echo CLOSE_DIV;
if (!empty($forum)) {
echo DIV_BLOCK;
echo '<b>Действия над форумом '.$forum['name'].':</b><br />';
echo '<a href="?edit">Редактировать</a><br />';
echo '<a href="?del">Удалить</a><br />';
echo '<a href="?ustav">Редактировать правила</a><br />';
echo CLOSE_DIV;
}
}
$array = array('Форум');
nav($array);
break;
case 'themes':
$forum = DB::$dbs->queryFetch("SELECT * FROM ".FORUMS." WHERE `id` = ? ", array(abs(num($_GET['forum']))));
if (empty($forum)) {
head('Форум не найден');
echo DIV_TITLE . 'Форум не найден' . CLOSE_DIV;
echo DIV_ERROR . 'Ошибка!' . CLOSE_DIV;
echo DIV_GO . '<a href="'.HOME.'/">Главная</a> / <a href="'.HOME.'/forum/">Форум</a> / <b>Форум не найден</b>' . CLOSE_DIV;
require_once('../../core/stop.php');
exit();
}
$forumc = DB::$dbs->queryFetch("SELECT * FROM ".FORUMS_CAT." WHERE `id` = ? ", array(abs(num($_GET['forumc']))));
if (empty($forumc)) {
head('Подфорум не найден');
echo DIV_TITLE . 'Подфорум не найден' . CLOSE_DIV;
echo DIV_ERROR . 'Ошибка!' . CLOSE_DIV;
echo DIV_GO . '<a href="'.HOME.'/">Главная</a> / <a href="'.HOME.'/forum/">Форум</a> / <b>Подфорум не найден</b>' . CLOSE_DIV;
require_once('../../core/stop.php');
exit();
}
head('Темы подфорума: ' . $forumc['name']);
panel();
if (isset($_GET['del'])) {
if (!isset($_GET['go'])) {
echo DIV_LI . '<b>Подтвердите удаление:</b> <a href="?del&go">[Удалить]</a> <a href="'.HOME.'/forum/'.$forum['id'].'/">[Нет]</a>' . CLOSE_DIV;
} else {
DB::$dbs->query("DELETE FROM ".FORUMS_CAT." WHERE `id` = ? ", array($forumc['id']));
header("Location: ".HOME."/forum/".$forum['id']."/");
}
}
if (isset($_GET['edit'])) {
if ($_POST['edit']) {
$name = html($_POST['name']);
if (empty($name)) {
echo DIV_ERROR . 'Введите название подфорума' . CLOSE_DIV;
} else {
DB::$dbs->query("UPDATE ".FORUMS_CAT." SET `name` = ? WHERE `id` = ? ", array($name, $forumc['id']));
header("Location: ".HOME."/forum/".$forum['id']."/".$forumc['id']."/");
}
}
echo DIV_AUT;
echo '<form action="#" method="POST">';
echo 'Редактирование подфорума:<br /><input type="text" value="'.$forumc['name'].'" name="name" />';
echo '<input type="submit" name="edit" value="Изменить" /></form>';
echo CLOSE_DIV;
}
$all = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".FORUM_THEME." WHERE `forumc_id` = ?", array($forumc['id']));
if ($all == 0) {
echo DIV_AUT . 'Темы не созданы' . CLOSE_DIV;
} else {
$n = new Navigator($all,$config['write']['forum_theme'],'select=themes&forum='.$forum['id'].'&forumc='.$forumc['id']);
$sql = DB::$dbs->query("SELECT * FROM ".FORUM_THEME." WHERE `forumc_id` = ? ORDER BY `activ` AND `fix` DESC LIMIT {$n->start()}, ".$config['write']['forum_theme']." ", array($forumc['id']));
while($theme = $sql -> fetch()) {
$posts = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".FORUMS_POST." WHERE `theme_id` = ? ", array($theme['id']));
$page = ceil(($posts / $config['write']['forum_post']));
echo DIV_LI . (!empty($theme['fix']) ? '<b>#</b> ' : NULL) . '<a href="'.HOME.'/forum/'.$forum['id'].'/'.$forumc['id'].'/'.$theme['id'].'/">'.$theme['name'].'</a> ['.$posts.'] <a href="'.HOME.'/forum/'.$theme['forum_id'].'/'.$theme['forumc_id'].'/'.$theme['id'].'/?p='.$page.'">[>>]</a>' . CLOSE_DIV;
}
echo $n->navi();
}
echo DIV_LI . '<b><a href="'.HOME.'/forum/'.$forum['id'].'/">Вернуться назад</a></b>' . CLOSE_DIV;
echo DIV_AUT . '<form action="'.HOME.'/forum/'.$forum['id'].'/'.$forumc['id'].'/new_theme/" method="POST"><input type="submit" name="new_theme" value="Новая тема" /></form>' . CLOSE_DIV;
if (privilegy('forum')) {
echo DIV_BLOCK;
echo '<a href="?edit">Редактировать подфорум <b>'.$forumc['name'].'</b></a><br />';
echo '<a href="?del">Удалить подфорум <b>'.$forumc['name'].'</b></a><br />';
echo CLOSE_DIV;
}
$array = array('Форум');
nav($array);
break;
case 'theme':
$forum = DB::$dbs->queryFetch("SELECT * FROM ".FORUMS." WHERE `id` = ? ", array(abs(num($_GET['forum']))));
if (empty($forum)) {
head('Форум не найден');
echo DIV_TITLE . 'Форум не найден' . CLOSE_DIV;
echo DIV_ERROR . 'Ошибка!' . CLOSE_DIV;
echo DIV_GO . '<a href="'.HOME.'/">Главная</a> / <a href="'.HOME.'/forum/">Форум</a> / <b>Форум не найден</b>' . CLOSE_DIV;
require_once('../../core/stop.php');
exit();
}
$forumc = DB::$dbs->queryFetch("SELECT * FROM ".FORUMS_CAT." WHERE `id` = ? ", array(abs(num($_GET['forumc']))));
if (empty($forumc)) {
head('Подфорум не найден');
echo DIV_TITLE . 'Подфорум не найден' . CLOSE_DIV;
echo DIV_ERROR . 'Ошибка!' . CLOSE_DIV;
echo DIV_GO . '<a href="'.HOME.'/">Главная</a> / <a href="'.HOME.'/forum/">Форум</a> / <b>Подфорум не найден</b>' . CLOSE_DIV;
require_once('../../core/stop.php');
exit();
}
$theme = DB::$dbs->queryFetch("SELECT * FROM ".FORUMS_THEME." WHERE `id` = ? ", array(abs(num($_GET['theme']))));
if (empty($theme)) {
head('Тема не найдена');
echo DIV_TITLE . 'Тема не найдена' . CLOSE_DIV;
echo DIV_ERROR . 'Ошибка!' . CLOSE_DIV;
echo DIV_GO . '<a href="'.HOME.'/">Главная</a> / <a href="'.HOME.'/forum/">Форум</a> / <b>Тема не найдена</b>' . CLOSE_DIV;
require_once('../../core/stop.php');
exit();
}
DB::$dbs->query("DELETE FROM ".FORUMS_NEW_POST." WHERE `theme_id` = ? && `user_id` = ? ", array($theme['id'], $user['user_id']));
if ($theme['status'] == 1) {
head('Тема: ' . $theme['name'] . ' закрыта для обсуждения!');
panel();
} else {
head('Тема обсуждения: ' . $theme['name']);
panel();
}
if (isset($_GET['del']) && privilegy('forum_moder')) {
if (!isset($_GET['go'])) {
echo DIV_LI . '<b>Подтвердите удаление:</b> <a href="?del&go">[Удалить]</a> <a href="'.HOME.'/forum/'.$forum['id'].'/">[Нет]</a>' . CLOSE_DIV;
} else {
$sql = DB::$dbs->query("SELECT * FROM ".FORUM_POST." WHERE `theme_id` = ? ", array($theme['id']));
while($post = $sql -> fetch()) {
unlink('../../files/forum/'.$post['file']);
}
DB::$dbs->query("DELETE FROM ".FORUMS_POST." WHERE `theme_id` = ? ", array($theme['id']));
DB::$dbs->query("DELETE FROM ".FORUMS_THEME." WHERE `id` = ? ", array($theme['id']));
header("Location: ".HOME."/forum/".$forum['id']."/".$forumc['id']."/");
}
}
echo DIV_LI . 'Тема: <b>' . $theme['name'] . '</b> ' . ($theme['status'] == 1 ? '| <b>Закрыта!</b>' : NULL) . CLOSE_DIV;
echo DIV_BLOCK . 'Автор: <b>' . userLink($theme['user_id']) . '</b> | Дата создания: <b>' . vrem($theme['time']) . '</b><br />';
if (!empty($theme['vote'])) {
echo '<br /><b>' . $theme['vote'] . '</b><br />';
if (DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".FORUM_VOTE." WHERE `theme_id` = ? && `user_id` = ? ", array($theme['id'], $user['user_id'])) == FALSE && $theme['status'] == 0) {
echo '<form action="'.HOME.'/forum/'.$forum['id'].'/'.$forumc['id'].'/'.$theme['id'].'/vote/" method="POST"><select name="variant">';
for ($i = 1; $i <= 10; ++$i) {
echo (!empty($theme['vote_'.$i]) ? '<option value="'.$i.'"">'.$theme['vote_'.$i].'</option>' : NULL);
}
echo '</select><input type="submit" name="myvote" value="Голосовать" /></form>';
} else {
for ($i = 1; $i <= 10; ++$i) {
$votes = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".FORUM_VOTE." WHERE `theme_id` = ? && `variant` = ? ", array($theme['id'], $i));
echo (!empty($theme['vote_'.$i]) ? '<b>' . $i . '.</b> ' . $theme['vote_'.$i].' ['.$votes.' чел.]<br />' : NULL);
}
}
}
echo CLOSE_DIV;
$all = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".FORUM_POST." WHERE `theme_id` = ?", array($theme['id']));
if (empty($all)) {
echo DIV_BLOCK . 'Сообщений нет' . CLOSE_DIV;
} else {
$n = new Navigator($all,$config['write']['forum_post'],'select=theme&forum='.$forum['id'].'&forumc='.$forumc['id'].'&theme='.$theme['id']);
$sql = DB::$dbs->query("SELECT * FROM ".FORUM_POST." WHERE `theme_id` = ? LIMIT {$n->start()}, ".$config['write']['forum_post']."", array($theme['id']));
while($post = $sql -> fetch()) {
echo DIV_BLOCK;
echo '<b>' . userLink($post['user_id']) . '</b> [' . vrem($post['time']) . '] ' . ($user['user_id'] != $post['user_id'] && $theme['status'] == 0 ? '<a href="'.HOME.'/forum/'.$forum['id'].'/'.$forumc['id'].'/'.$theme['id'].'/new_post/?post='.$post['id'].'">[Отв.]</a> <a href="'.HOME.'/forum/'.$forum['id'].'/'.$forumc['id'].'/'.$theme['id'].'/new_post/?ctpost='.$post['id'].'">[Цит.]</a>' : NULL) . ( (privilegy('forum_moder') || $post['user_id'] == $user['user_id']) && $theme['status'] == 0 ? '<a href="'.HOME.'/forum/'.$forum['id'].'/'.$forumc['id'].'/'.$theme['id'].'/delete/'.$post['id'].'/">[Удал.]</a> <a href="'.HOME.'/forum/'.$forum['id'].'/'.$forumc['id'].'/'.$theme['id'].'/edit/'.$post['id'].'/">[Ред.]</a>' : NULL) . '<br />';
if (!empty($post['ct'])) {
$ct = DB::$dbs->queryFetch("SELECT `msg` FROM ".FORUMS_POST." WHERE `id` = ? ", array($post['ct']));
echo DIV_CT . '<small><b>Цитата:</b></small><br />' . text($ct['msg']) . CLOSE_DIV;
}
echo text($post['msg']);
if (!empty($post['file'])) {
$path = '../../files/forum/'.$post['file'];
$size = get_size(filesize($path));
$path_info = pathinfo($path);
echo '<br /><br />Прикреплен файл: <a href="'.HOME.'/files/forum/'.$post['file'].'"><b>[Скачать]</b></a> ['.$path_info['extension'].'] ['.$size.']<br />';
}
echo CLOSE_DIV;
}
echo $n->navi();
}
echo DIV_LI . '<b><a href="'.HOME.'/forum/'.$forum['id'].'/'.$forumc['id'].'/">Вернуться назад</a></b>' . CLOSE_DIV;
if ($theme['status'] == 0) {
echo DIV_AUT . '<form action="'.HOME.'/forum/'.$forum['id'].'/'.$forumc['id'].'/'.$theme['id'].'/new_post/" method="POST"><input type="submit" name="new_post" value="Ответить в теме" /></form>' . CLOSE_DIV;
}
if ($theme['user_id'] == $user['user_id']) {
echo DIV_BLOCK;
echo '<a href="'.HOME.'/forum/'.$forum['id'].'/'.$forumc['id'].'/'.$theme['id'].'/closed_run/"><b>'.($theme['status'] == 0 ? 'Закрыть тему' : 'Открыть тему').'</b></a><br />';
if ($theme['status'] == 0) {
if (privilegy('forum_moder')) echo '<a href="'.HOME.'/forum/'.$forum['id'].'/'.$forumc['id'].'/'.$theme['id'].'/fix/">'.($theme['fix'] == 0 ? 'Закрепить тему' : 'Открепить тему').'</a><br />';
echo '<a href="'.HOME.'/forum/'.$forum['id'].'/'.$forumc['id'].'/'.$theme['id'].'/edit/">Редактировать тему</a><br />';
if (privilegy('forum_moder')) echo '<a href="?del">Удалить тему</a><br />';
if (privilegy('forum_moder')) echo '<a href="'.HOME.'/forum/'.$forum['id'].'/'.$forumc['id'].'/'.$theme['id'].'/transfer/">Перенести тему</a><br />';
}
echo CLOSE_DIV;
} elseif (privilegy('forum_moder') || $theme['user_id'] == $user['user_id']) {
echo DIV_BLOCK;
echo '<a href="'.HOME.'/forum/'.$forum['id'].'/'.$forumc['id'].'/'.$theme['id'].'/closed_run/"><b>'.($theme['status'] == 0 ? 'Закрыть тему' : 'Открыть тему').'</b></a><br />';
if ($theme['status'] == 0) {
if (privilegy('forum_moder')) echo '<a href="'.HOME.'/forum/'.$forum['id'].'/'.$forumc['id'].'/'.$theme['id'].'/fix/">'.($theme['fix'] == 0 ? 'Закрепить тему' : 'Открепить тему').'</a><br />';
echo '<a href="'.HOME.'/forum/'.$forum['id'].'/'.$forumc['id'].'/'.$theme['id'].'/edit/">Редактировать тему</a><br />';
echo '<a href="'.HOME.'/forum/'.$forum['id'].'/'.$forumc['id'].'/'.$theme['id'].'/transfer/">Перенести тему</a><br />';
if (privilegy('forum_moder')) {
echo '<a href="?del">Удалить тему</a><br />';
}
}
echo CLOSE_DIV;
}
$array = array('Форум');
nav($array);
break;
}
require_once('../../core/stop.php');
?>