Файл: WM_dvig/forum.php
Строк: 298
<?php
$verx = 'Форум';
require_once ('system/function.php');
require_once ('system/header.php');
if(!$user['id']) {
header('Location: /');
exit();
}
switch($_GET['act'])
{
default:
echo '<div class="razd" style="text-align:center;font-weight:bold;">'.$verx.'</div>';
echo '<div class="hit" style="border-bottom:1px dashed #e6b464">Темы -> <a href="/forum/my_them">Мои</a> | <a href="/forum/new_them">Новые</a> <br /> Посты -> <a href="/forum/my_post">Мои</a> | <a href="/forum/new_post">Новые</a>';
if($user['level'] == 3) echo '<br /> Доп. функции: <a href="/forum/add_razdel">Добавить раздел</a>';
echo '</div>';
if(empty($user['str'])) $user['str'] = 10;
$max = $user['str'];
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_razdel`"),0);
$k_page = k_page($k_post,$max);
$page = page($k_page);
$start = $max*$page-$max;
$a = mysql_query("SELECT * FROM `forum_razdel` ORDER BY `id` DESC LIMIT $start, $max");
while($b = mysql_fetch_assoc($a))
{
echo '<div class="news"><div class="divnews"><img src="/design/imgdes/cat.png" alt="*"> <a href="/forum/razdel'.$b['id'].'"><b>'.$b['name'].'</b></a> ('.mysql_result(mysql_query('select count(`id`) from `forum_podrazdel` where `razdel` = "'.$b['id'].'"'),0).')';
if($user['level'] == 3) echo '<div class="right"><a href="/forum/delete_razdel'.$b['id'].'"><img src="/design/imgdes/del.png" alt="*"></a></div>';
echo '</div></div>';
}
if($k_post < 1) echo '<div class="hit" style="text-align:center;font-weight:bold;">Разделов пока нет.</div>';
if($k_page > 1) echo str('/forum/?',$k_page,$page);
break;
case 'add_razdel':
if($user['level'] != 3) {
header('Location: /');
exit();
}
echo '<div class="razd" style="text-align:center;font-weight:bold;">Новый раздел</div>
<div class="hit" style="border-bottom:1px dashed #e6b464"><a href="/forum">'.$verx.'</a> -> Новый раздел</div>';
if(isset($_REQUEST['submit'])) {
$name = guard($_POST['name']);
$p = mysql_fetch_array(mysql_query('select * from `forum_razdel` where `name` = "'.$name.'"'));
if(mb_strlen($name) < 5) $err = 'Ошибка ввода текста.';
if($p != 0) $err = 'Такой раздел уже существует.';
if($err) {
echo '<div class="home" style="text-align:center;font-weight:bold;">'.$err.'</div>';
} else {
mysql_query("INSERT INTO `forum_razdel` SET `name` = '".$name."'");
header('location: /forum');
exit();
}
}
echo '<div class="hit"><form method="POST" action="">
<font color="red">*</font>Название раздела: <br /> <input type="text" name="name" maxlength="30" value="'.$name.'" />
<br />
<input type="submit" name="submit" value="Добавить раздел" />
</form></div>';
break;
case 'delete_razdel':
if($user['level'] != 3) {
header('Location: /');
exit();
}
$id = abs(intval($_GET['id']));
$fr = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_razdel` WHERE `id` = '".$id."'"));
if($fr == 0) {
echo '<div class="razd" style="text-align:center;font-weight:bold;">Ошибка</div>
<div class="hit" style="text-align:center;font-weight:bold;">Раздел не найден.</div>';
require_once ('system/footer.php');
exit();
}
echo '<div class="razd" style="text-align:center;font-weight:bold;">Удаление раздела</div>
<div class="hit" style="border-bottom:1px dashed #e6b464"><a href="/forum">'.$verx.'</a> -> Удаление раздела</div>';
if(isset($_REQUEST['da'])) {
mysql_query("DELETE FROM `forum_razdel` where `id` = '".$id."'");
mysql_query("DELETE FROM `forum_podrazdel` where `razdel` = '".$id."'");
mysql_query("DELETE FROM `forum_thema` where `razdel` = '".$id."'");
mysql_query("DELETE FROM `forum_post` where `razdel` = '".$id."'");
header('Location: /forum');
exit();
}
echo '<div class="hit">Удалить данный раздел?
<a href="/forum/delete_razdel'.$id.'?da">Да</a> | <a href="/forum">Нет</a></div>';
break;
case 'razdel':
$id = abs(intval($_GET['id']));
$fr = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_razdel` WHERE `id` = '".$id."'"));
if($fr == 0) {
echo '<div class="razd" style="text-align:center;font-weight:bold;">Ошибка</div>
<div class="hit" style="text-align:center;font-weight:bold;">Раздел не найден.</div>';
require_once ('system/footer.php');
exit();
}
echo '<div class="razd" style="text-align:center;font-weight:bold;">'.$fr['name'].'</div>
<div class="hit" style="border-bottom:1px dashed #e6b464"><a href="/forum">'.$verx.'</a> -> '.$fr['name'];
if($user['level'] == 3) echo '<br /> Доп. функции: <a href="/forum/add_podrazdel'.$id.'">Добавить подраздел</a>';
echo '</div>';
if(empty($user['str'])) $user['str'] = 10;
$max = $user['str'];
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_podrazdel` WHERE `razdel` = '".$id."'"),0);
$k_page = k_page($k_post,$max);
$page = page($k_page);
$start = $max*$page-$max;
$a = mysql_query("SELECT * FROM `forum_podrazdel` WHERE `razdel` = '".$id."' ORDER BY `id` DESC LIMIT $start, $max");
while($b = mysql_fetch_assoc($a))
{
echo '<div class="news"><div class="divnews"><img src="/design/imgdes/cat.png" alt="*"> <a href="/forum/podrazdel'.$b['id'].'"><b>'.$b['name'].'</b></a> ('.mysql_result(mysql_query('select count(`id`) from `forum_thema` where `podrazdel` = "'.$b['id'].'"'),0).')';
if($user['level'] == 3) echo '<div class="right"><a href="/forum/delete_podrazdel'.$b['id'].'"><img src="/design/imgdes/del.png" alt="*"></a></div>';
echo '</div></div>';
}
if($k_post < 1) echo '<div class="hit" style="text-align:center;font-weight:bold;">Подразделов пока нет.</div>';
if($k_page > 1) echo str('/forum/razdel'.$id.'/?',$k_page,$page);
break;
case 'add_podrazdel':
if($user['level'] != 3) {
header('Location: /');
exit();
}
$id = abs(intval($_GET['id']));
$fr = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_razdel` WHERE `id` = '".$id."'"));
if($fr == 0) {
echo '<div class="razd" style="text-align:center;font-weight:bold;">Ошибка</div>
<div class="hit" style="text-align:center;font-weight:bold;">Раздел не найден.</div>';
require_once ('system/footer.php');
exit();
}
echo '<div class="razd" style="text-align:center;font-weight:bold;">Новый подраздел</div>
<div class="hit" style="border-bottom:1px dashed #e6b464"><a href="/forum">'.$verx.'</a> -> Новый подраздел</div>';
if(isset($_REQUEST['submit'])) {
$name = guard($_POST['name']);
$p = mysql_fetch_array(mysql_query('select * from `forum_podrazdel` where `name` = "'.$name.'"'));
if(mb_strlen($name) < 5) $err = 'Ошибка ввода текста.';
if($p != 0) $err = 'Такой подраздел уже существует.';
if($err) {
echo '<div class="home" style="text-align:center;font-weight:bold;">'.$err.'</div>';
} else {
mysql_query("INSERT INTO `forum_podrazdel` SET `name` = '".$name."', `razdel` = '".$id."'");
header('location: /forum/razdel'.$id);
exit();
}
}
echo '<div class="hit"><form method="POST" action="">
<font color="red">*</font>Название подраздела: <br /> <input type="text" name="name" maxlength="30" value="'.$name.'" />
<br />
<input type="submit" name="submit" value="Добавить подраздел" />
</form></div>';
break;
case 'delete_podrazdel':
if($user['level'] != 3) {
header('Location: /');
exit();
}
$id = abs(intval($_GET['id']));
$fp = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_podrazdel` WHERE `id` = '".$id."'"));
if($fp == 0) {
echo '<div class="razd" style="text-align:center;font-weight:bold;">Ошибка</div>
<div class="hit" style="text-align:center;font-weight:bold;">Подраздел не найден.</div>';
require_once ('system/footer.php');
exit();
}
echo '<div class="razd" style="text-align:center;font-weight:bold;">Удаление подраздела</div>
<div class="hit" style="border-bottom:1px dashed #e6b464"><a href="/forum">'.$verx.'</a> -> Удаление подраздела</div>';
if(isset($_REQUEST['da'])) {
mysql_query("DELETE FROM `forum_podrazdel` where `id` = '".$id."'");
mysql_query("DELETE FROM `forum_thema` where `podrazdel` = '".$id."'");
mysql_query("DELETE FROM `forum_post` where `podrazdel` = '".$id."'");
header('Location: /forum/razdel'.$fp['razdel']);
exit();
}
echo '<div class="hit">Удалить данный подраздел?
<a href="/forum/delete_podrazdel'.$id.'?da">Да</a> | <a href="/forum/razdel'.$fp['razdel'].'">Нет</a></div>';
break;
case 'podrazdel':
$id = abs(intval($_GET['id']));
$fp = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_podrazdel` WHERE `id` = '".$id."'"));
if($fp == 0) {
echo '<div class="razd" style="text-align:center;font-weight:bold;">Ошибка</div>
<div class="hit" style="text-align:center;font-weight:bold;">Подраздел не найден.</div>';
require_once ('system/footer.php');
exit();
}
echo '<div class="razd" style="text-align:center;font-weight:bold;">'.$fp['name'].'</div>
<div class="hit" style="border-bottom:1px dashed #e6b464"><a href="/forum">'.$verx.'</a> -> '.$fp['name'].'
<br /> Доп. Функции: <a href="/forum/add_thema'.$id.'">Новая тема</a>
</div>';
if(empty($user['str'])) $user['str'] = 10;
$max = $user['str'];
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_thema` WHERE `podrazdel` = '".$id."'"),0);
$k_page = k_page($k_post,$max);
$page = page($k_page);
$start = $max*$page-$max;
$a = mysql_query("SELECT * FROM `forum_thema` WHERE `podrazdel` = '".$id."' ORDER BY `id` DESC LIMIT $start, $max");
while($b = mysql_fetch_assoc($a))
{
if($b['status'] == 0) $i = 'tem'; else $i = 'close';
echo '<div class="news"><div class="divnews"><img src="/design/imgdes/'.$i.'.png" alt="*"> <a href="/forum/thema'.$b['id'].'"><b>'.$b['name'].'</b></a> ('.mysql_result(mysql_query('select count(`id`) from `forum_post` where `thema` = "'.$b['id'].'"'),0).') -> '.times($b['time']).'
</div></div>';
}
if($k_post < 1) echo '<div class="hit" style="text-align:center;font-weight:bold;">Тем пока нет.</div>';
if($k_page > 1) echo str('/forum/podrazdel'.$id.'/?',$k_page,$page);
break;
case 'add_thema':
$id = abs(intval($_GET['id']));
$fp = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_podrazdel` WHERE `id` = '".$id."'"));
if($fp == 0) {
echo '<div class="razd" style="text-align:center;font-weight:bold;">Ошибка</div>
<div class="hit" style="text-align:center;font-weight:bold;">Подраздел не найден.</div>';
require_once ('system/footer.php');
exit();
}
echo '<div class="razd" style="text-align:center;font-weight:bold;">Новая тема</div>
<div class="hit" style="border-bottom:1px dashed #e6b464"><a href="/forum">'.$verx.'</a> -> Новая тема</div>';
if(isset($_REQUEST['submit'])) {
$name = guard($_POST['name']);
$text = guard($_POST['text']);
$p = mysql_fetch_array(mysql_query('select * from `forum_thema` where `name` = "'.$name.'"'));
if(mb_strlen($name) < 5) $err = 'Ошибка ввода названия темы.';
if(mb_strlen($text) < 5) $err = 'Ошибка ввода текста темы.';
if($p != 0) $err = 'Такая тема уже существует.';
if($err) {
echo '<div class="home" style="text-align:center;font-weight:bold;">'.$err.'</div>';
} else {
mysql_query("INSERT INTO `forum_thema` SET `name` = '".$name."', `razdel` = '".$fp['razdel']."', `podrazdel` = '".$id."', `text` = '".$text."', `status` = '0', `us` = '".$user['id']."', `time` = '".time()."', `up` = '".time()."'");
$sql = mysql_insert_id();
mysql_query("INSERT INTO `forum_post` SET `razdel` = '".$fp['razdel']."', `podrazdel` = '".$id."', `text` = '".$text."', `us` = '".$user['id']."', `time` = '".time()."', `thema` = '".$sql."'");
header('location: /forum/thema'.$sql);
exit();
}
}
echo '<div class="hit"><form action="" method="POST">
Название темы:<br /> <input type="text" name="name" value=""/> <br />
Содержимое темы:<br /><textarea name="text"></textarea> <br />
<input type="submit" name="submit" value="Создать тему" />
</form></div>';
break;
case 'thema':
$id = abs(intval($_GET['id']));
$ft = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_thema` WHERE `id` = '".$id."'"));
$fr = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_razdel` WHERE `id` = '".$ft['razdel']."'"));
$fp = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_podrazdel` WHERE `id` = '".$ft['podrazdel']."'"));
if($ft == 0) {
echo '<div class="razd" style="text-align:center;font-weight:bold;">Ошибка</div>
<div class="hit" style="text-align:center;font-weight:bold;">Тема не найдена.</div>';
require_once ('system/footer.php');
exit();
}
echo '<div class="razd" style="text-align:center;font-weight:bold;">'.$ft['name'].'</div>';
echo '<div class="hit" style="border-bottom:1px dashed #e6b464"><a href="/forum">Форум</a> -> <a href="/forum/thema'.$id.'/?selection=top">Обновить</a> | <a href="/forum/jal'.$id.'">Пожаловаться</a>';
if($ft['status'] == 1) $close = 'Открыть'; else $close = 'Закрыть';
if($user['level'] > 0) echo '<br /> Доп. функции: <a href="/forum/close'.$id.'">'.$close.' тему</a> | <a href="/forum/thema_delete'.$id.'">Удалить тему</a>';
echo '</div>';
if($ft['status'] == 1) echo '<div class="home" style="text-align:center;font-weight:bold;">Тема закрыта для обсуждения.</div>';
if(empty($user['str'])) $user['str'] = 10;
$max = $user['str'];
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_post` WHERE `thema` = '".$id."'"),0);
$k_page = k_page($k_post,$max);
$page = page($k_page);
$start = $max*$page-$max;
$k_post = $start+1;
$a = mysql_query("SELECT * FROM `forum_post` WHERE `thema` = '".$id."' ORDER BY `id` LIMIT $start, $max");
while($b = mysql_fetch_assoc($a))
{
echo '<div class="news"><div class="divnews">'.$k_post++.') '.nick($b['us']).' ['.times($b['time']).']
<br />
'.text($b['text']).'
</div></div>';
}
if($ft['status'] == 0) {
if(isset($_REQUEST['submit'])) {
$text = guard($_POST['text']);
$p = mysql_fetch_array(mysql_query('select * from `forum_post` where `text` = "'.$text.'" and `thema` = "'.$id.'"'));
if(mb_strlen($text) < 5) $err = 'Ошибка ввода сообщения.';
if($p != 0) $err = 'Такой пост уже существует.';
if($err) {
echo '<div class="home" style="text-align:center;font-weight:bold;">'.$err.'</div>';
} else {
mysql_query("UPDATE `forum_thema` SET `up` = '".time()."' WHERE `id` = '".$id."'");
mysql_query("INSERT INTO `forum_post` SET `razdel` = '".$ft['razdel']."', `podrazdel` = '".$ft['podrazdel']."', `text` = '".$text."', `us` = '".$user['id']."', `time` = '".time()."', `thema` = '".$id."'");
header('location: /forum/thema'.$id.'/?selection=top');
exit();
}
}
echo '<div class="hit" style="dashed #e6b464"><form action="" method="POST">
<font size="1"><a href="/smiles"/>Смайлы</a> / <a href="/bb-code"/>BB-коды</a></font>
<br />
<textarea name="text"></textarea>
<br />
<input type="submit" name="submit" value="Написать"/>
</form></div>';
}
if($k_post < 1) echo '<div class="hit" style="text-align:center;font-weight:bold;">Постов пока нет.</div>';
if($k_page > 1) echo str('/forum/thema'.$id.'/?',$k_page,$page);
break;
case 'close':
$id = abs(intval($_GET['id']));
$ft = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_thema` WHERE `id` = '".$id."'"));
if($ft == 0) {
echo '<div class="razd" style="text-align:center;font-weight:bold;">Ошибка</div>
<div class="hit" style="text-align:center;font-weight:bold;">Тема не найдена.</div>';
require_once ('system/footer.php');
exit();
}
if($ft['status'] == 0) {
mysql_query("UPDATE `forum_thema` SET `status` = '1', `up` = '".time()."' WHERE `id` = '".$id."'");
mysql_query("INSERT INTO `forum_post` SET `podrazdel` = '".$ft['podrazdel']."', `text` = 'Тема закрыта для обсуждения .охох.', `us` = '".$user['id']."', `time` = '".time()."', `thema` = '".$id."', `razdel` = '".$ft['razdel']."'");
header('Location: /forum/thema'.$id.'?selection=top');
} else {
mysql_query("UPDATE `forum_thema` SET `status` = '0', `up` = '".time()."' WHERE `id` = '".$id."'");
mysql_query("INSERT INTO `forum_post` SET `podrazdel` = '".$ft['podrazdel']."', `text` = 'Тема открыта для обсуждения .охох.', `us` = '".$user['id']."', `time` = '".time()."', `thema` = '".$id."', `razdel` = '".$ft['razdel']."'");
header('Location: /forum/thema'.$id.'?selection=top');
}
break;
case 'my_them':
echo '<div class="razd" style="text-align:center;font-weight:bold;">Мои темы</div>
<div class="hit" style="border-bottom:1px dashed #e6b464"><a href="/forum">'.$verx.'</a> -> Мои темы</div>';
if(empty($user['str'])) $user['str'] = 10;
$max = $user['str'];
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_thema` WHERE `us` = '".$user['id']."'"),0);
$k_page = k_page($k_post,$max);
$page = page($k_page);
$start = $max*$page-$max;
$a = mysql_query("SELECT * FROM `forum_thema` WHERE `us` = '".$user['id']."' ORDER BY `id` DESC LIMIT $start, $max");
while($b = mysql_fetch_assoc($a))
{
if($b['status'] == 0) $i = 'tem'; else $i = 'close';
echo '<div class="news"><div class="divnews"><img src="/design/imgdes/'.$i.'.png" alt="*"> <a href="/forum/thema'.$b['id'].'"><b>'.$b['name'].'</b></a> ('.mysql_result(mysql_query('select count(`id`) from `forum_post` where `thema` = "'.$b['id'].'"'),0).')
</div></div>';
}
if($k_post < 1) echo '<div class="hit" style="text-align:center;font-weight:bold;">Тем пока нет.</div>';
if($k_page > 1) echo str('/forum/my_them/?',$k_page,$page);
break;
case 'my_post':
echo '<div class="razd" style="text-align:center;font-weight:bold;">Мои посты</div>
<div class="hit" style="border-bottom:1px dashed #e6b464"><a href="/forum">'.$verx.'</a> -> Мои посты</div>';
if(empty($user['str'])) $user['str'] = 10;
$max = $user['str'];
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_post` WHERE `us` = '".$user['id']."'"),0);
$k_page = k_page($k_post,$max);
$page = page($k_page);
$start = $max*$page-$max;
$a = mysql_query("SELECT * FROM `forum_post` WHERE `us` = '".$user['id']."' ORDER BY `time` DESC LIMIT $start, $max");
while($b = mysql_fetch_assoc($a))
{
$ft = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_thema` WHERE `id` = '".$b['thema']."'"));
if($ft['status'] == 0) $i = 'tem'; else $i = 'close';
echo '<div class="news"><div class="divnews">Тема -> <img src="/design/imgdes/'.$i.'.png" alt="*"> <a href="/forum/thema'.$ft['id'].'"><b>'.$ft['name'].'</b></a>
<br />
'.text($b['text']).'
</div></div>';
}
if($k_post < 1) echo '<div class="hit" style="text-align:center;font-weight:bold;">Постов пока нет.</div>';
if($k_page > 1) echo str('/forum/my_post/?',$k_page,$page);
break;
case 'new_them':
echo '<div class="razd" style="text-align:center;font-weight:bold;">Новые темы</div>
<div class="hit" style="border-bottom:1px dashed #e6b464"><a href="/forum">'.$verx.'</a> -> Новые темы</div>';
if(empty($user['str'])) $user['str'] = 10;
$max = $user['str'];
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_thema` WHERE `time` > '".(time()-3600*24)."'"),0);
$k_page = k_page($k_post,$max);
$page = page($k_page);
$start = $max*$page-$max;
$a = mysql_query("SELECT * FROM `forum_thema` WHERE `time` > '".(time()-3600*24)."' ORDER BY `time` DESC LIMIT $start, $max");
while($b = mysql_fetch_assoc($a))
{
if($b['status'] == 0) $i = 'tem'; else $i = 'close';
echo '<div class="news"><div class="divnews"><img src="/design/imgdes/'.$i.'.png" alt="*"> <a href="/forum/thema'.$b['id'].'"><b>'.$b['name'].'</b></a> ('.mysql_result(mysql_query('select count(`id`) from `forum_post` where `thema` = "'.$b['id'].'"'),0).')
</div></div>';
}
if($k_post < 1) echo '<div class="hit" style="text-align:center;font-weight:bold;">Новых тем пока нет.</div>';
if($k_page > 1) echo str('/forum/new_them/?',$k_page,$page);
break;
case 'new_post':
echo '<div class="razd" style="text-align:center;font-weight:bold;">Новые посты</div>
<div class="hit" style="border-bottom:1px dashed #e6b464"><a href="/forum">'.$verx.'</a> -> Новые посты</div>';
if(empty($user['str'])) $user['str'] = 10;
$max = $user['str'];
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_post` WHERE `time` > '".(time()-3600*24)."'"),0);
$k_page = k_page($k_post,$max);
$page = page($k_page);
$start = $max*$page-$max;
$a = mysql_query("SELECT * FROM `forum_post` WHERE `time` > '".(time()-3600*24)."' ORDER BY `id` DESC LIMIT $start, $max");
while($b = mysql_fetch_assoc($a))
{
$ft = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_thema` WHERE `id` = '".$b['thema']."'"));
if($ft['status'] == 0) $i = 'tem'; else $i = 'close';
echo '<div class="news"><div class="divnews">Тема -> <img src="/design/imgdes/'.$i.'.png" alt="*"> <a href="/forum/thema'.$ft['id'].'"><b>'.$ft['name'].'</b></a>
<br />
'.text($b['text']).'
<br />
Автор -> '.nick($b['us']).'
</div></div>';
}
if($k_post < 1) echo '<div class="hit" style="text-align:center;font-weight:bold;">Новых постов пока нет.</div>';
if($k_page > 1) echo str('/forum/new_post/?',$k_page,$page);
break;
case 'thema_delete':
if($user['level'] < 1) {
header('Location: /');
exit();
}
$id = abs(intval($_GET['id']));
$ft = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_thema` WHERE `id` = '".$id."'"));
if($ft == 0) {
echo '<div class="razd" style="text-align:center;font-weight:bold;">Ошибка</div>
<div class="hit" style="text-align:center;font-weight:bold;">Тема не найдена.</div>';
require_once ('system/footer.php');
exit();
}
echo '<div class="razd" style="text-align:center;font-weight:bold;">Удаление темы</div>
<div class="hit" style="border-bottom:1px dashed #e6b464"><a href="/forum">'.$verx.'</a> -> Удаление темы</div>';
if(isset($_REQUEST['da'])) {
mysql_query("DELETE FROM `forum_thema` where `id` = '".$id."'");
header('Location: /forum');
exit();
}
echo '<div class="hit">Удалить данную тему?
<a href="/forum/thema_delete'.$id.'?da">Да</a> | <a href="/forum/thema'.$id.'">Нет</a></div>';
break;
}
require_once ('system/footer.php');
?>