Файл: forum.php
Строк: 348
<?php
include 'inc/mysql.php';
include 'inc/check.php';
include ("inc/gzip.php");
if(isset($_SESSION['auth']) && $_SESSION['auth']==1){
include 'inc/shapka.php';
echo"<div class='content'>";
switch($_GET[mod]){
default:
$qi = mysql_query("SELECT * FROM `forum` ORDER by `id` ASC");
while($row=mysql_fetch_array($qi))
{
$kolic = mysql_query("SELECT COUNT(`msg`) FROM `forum_msg` WHERE `topik`='$row[id]';");
$kols = mysql_result($kolic, 0);
$u=mysql_query("SELECT * FROM `forum_topik` WHERE `razdel`='$row[id]' ORDER by `id` DESC");
$dat=mysql_fetch_array($u);
$uids=$dat[tema];
$u2=mysql_query("SELECT * FROM `forum_msg` WHERE `topik`='$row[id]' and `tema`='$dat[id]' ORDER by `id` DESC");
$dat2=mysql_fetch_array($u2);
$uids2=$dat2[user];
$req1 = mysql_query("SELECT `id`,`status`,`login`,`sex` FROM `account` WHERE `id` = '$uids2'");
$_user = mysql_fetch_array($req1);
echo'<div class="ssl">';
echo"<a href="forum.php?mod=theme&id=$row[id]">  <img src="pic/forum/$row[img]"> $row[name] ($row[tem]/$kols)</a></div>";
}
if($account['status']=="gm"){
echo'<div class="ssl">';
echo"<a href="forum.php?mod=razdel">  <img src="pic/forum/forum2.png"> Создать раздел форума</a></div>";
}
break;
case 'new_post':
$forum=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum` WHERE `id`='".intval($_GET['id'])."'"));
$topik=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_topik` WHERE `id`='".intval($_GET['topik'])."'"));
$faq = mysql_query("SELECT * FROM `config`");
$base = mysql_fetch_array($faq);
if($account[lvl]<$base[forum_mail]){
echo '<img src='pic/main/!.png'> Писать сообщения на форуме доступно с '.$base[forum_mail].' уровня.</div>';
include 'inc/nogi.php';
exit;
}
if($topik[status]==1){
header('Location: forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].'');
exit;
}
$req = mysql_query("SELECT * FROM `block` WHERE `usr`='$account[id]' and `ban_time`>'$time' and `tip` = '1' ");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto>=1){
While($mag = mysql_fetch_array($req))
{
header('Location: forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].'');
exit;
}}
$msg=htmlspecialchars($_POST[msg]);
if(empty($msg)){
header('Location: forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].'');
exit;
}
include ("inc/antireklama.php");
$time = date("H:i d.m.y");
mysql_query("INSERT INTO `forum_msg` SET `topik` = '$topik[razdel]',`tema`='$topik[id]',`msg` = '$msg',`user` = '$account[id]',`time` = '$time ' ");
header('Location: forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].'');
break;
case 'post':
$forum=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum` WHERE `id`='".intval($_GET['id'])."'"));
$topik=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_topik` WHERE `id`='".intval($_GET['topik'])."'"));
$req = mysql_query("SELECT * FROM `block` WHERE `usr`='$account[id]' and `ban_time`>'$time' and `tip` = '1' ");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto>=1){
While($mag = mysql_fetch_array($req))
{
echo"<center><div class=s><img src='/pic/main/!.png' alt='*'/> На вашего персонажа наложена молчанка, вы не можете писать сообщения на форуме.</div></center>";
}}
echo "<img src="pic/forum/forum.png"><a href="forum.php">Форум</a> / <a href="forum.php?mod=theme&id=$forum[id]">$forum[name]</a> / $topik[tema]";
if($_GET['go']=='cloze' && ($topik['user']=="$account[id]")){
if(isset($_GET['topik'])){
$del = $_GET['topik'];
}
if($del){
mysql_query("UPDATE `forum_topik` SET `status`='1' WHERE `id`='".$del."'");
header('Location: forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].''); exit;
}else{
header('Location: forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].''); exit;
}
}
if($_GET['go']=='yes' && ($topik['user']=="$account[id]")){
if(isset($_GET['topik'])){
$del = $_GET['topik'];
}
if($del){
mysql_query("UPDATE `forum_topik` SET `status`='0' WHERE `id`='".$del."'");
header('Location: forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].''); exit;
}else{
header('Location: forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].''); exit;
}}
if($_GET['go']=='up_minus'){
$req = mysql_query("SELECT * FROM `forum_rating` WHERE `account`='$account[id]' and `ids`='$forum[id]' and `topik`='$topik[id]' ");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto==0){
mysql_query("UPDATE `forum_topik` SET `rating_minus`=`rating_minus` + '0.1' WHERE `id`='$topik[id]'");
mysql_query("INSERT INTO `forum_rating` SET `account` = '$account[id]', `ids` = '$forum[id]', `topik` = '$topik[id]'");
header('Location: forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].''); exit;
}else{
header('Location: forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].''); exit;
}
}
if($_GET['go']=='up_plus'){
$req = mysql_query("SELECT * FROM `forum_rating` WHERE `account`='$account[id]' and `ids`='$forum[id]' and `topik`='$topik[id]' ");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto==0){
mysql_query("UPDATE `forum_topik` SET `rating_plus`=`rating_plus` + '0.1' WHERE `id`='$topik[id]'");
mysql_query("INSERT INTO `forum_rating` SET `account` = '$account[id]', `ids` = '$forum[id]', `topik` = '$topik[id]'");
header('Location: forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].''); exit;
}else{
header('Location: forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].''); exit;
}
}
if($topik[user]==$account[id]){
if($topik[status]==0){
echo " / <a href="forum.php?mod=post&go=cloze&id=$forum[id]&topik=$topik[id]"><font color=red>Закрыть топик</font></a>";
}else{
echo " / <a href="forum.php?mod=post&go=yes&id=$forum[id]&topik=$topik[id]"><font color=red>Открыть топик</font></a>";
}}
echo "<hr>";
echo '<center>(Прочитано: '.$topik[proc].' | Рейтинг: <a href="forum.php?mod=post&go=up_plus&id='.$forum[id].'&topik='.$topik[id].'"><img src="/pic/main/oke.png" alt="*"/></a> <font color=lime>'.$topik[rating_plus].'</font> <a href="forum.php?mod=post&go=up_minus&id='.$forum[id].'&topik='.$topik[id].'"><img src="/pic/main/nou.png" alt="*"/></a> <font color=red>'.$topik[rating_minus].'</font>)</center><hr>';
if ($_GET['say']){
$say=mysql_result(mysql_query("SELECT `login` FROM `account` WHERE `id`='".intval($_GET['say'])."'"),0);
$say = str_replace("$say","$say, ",$say);
}else{
$say='';
}
if($topik[status]==0){
echo '<form name="form" action="forum.php?mod=new_post&id='.$forum[id].'&topik='.$topik[id].'" method="post">'.bbpanel('form', 'msg').'<textarea name="msg" cols="30" rows="3">'.$say.'</textarea>
<br><input type="submit" class="submit" value="Написать">
</form>
<hr>
';
}else{
echo "<img src="pic/main/!.png"> <font color=red><b>Топик закрыт!</b></b></font><hr>";
}
$g=mysql_query("SELECT * FROM `forum_topik` WHERE `razdel`='$forum[id]' AND `id`='$topik[id]' LIMIT 1");
if(mysql_num_rows($g)==1){
$cop=10;
$ca=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_msg` WHERE `topik`='$forum[id]' AND `tema`='$topik[id]' "),0);
$cp=ceil($ca/$cop);
if(isset($_GET['page']) && is_numeric($_GET['page'])){
$page = $_GET['page'];
if($_GET['page']>$cp) $page=$cp;
if($_GET['page']<1)$page=1;
}else{
$page=1;
}
$start=$page*$cop-$cop;
$dlist = 'list1';
$qi = mysql_query("SELECT * FROM `forum_msg` WHERE `topik`='$forum[id]' AND `tema`='$topik[id]' ORDER by `id` DESC LIMIT $start,$cop");
while($row=mysql_fetch_array($qi))
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$req = mysql_query("SELECT * FROM `forum_golos` WHERE `account`='$account[id]' and `ids`='$forum[id]' and `topik`='$topik[id]' ");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto==0){
mysql_query("UPDATE `forum_topik` SET `proc`=`proc` + '1' WHERE `id`='$topik[id]'");
mysql_query("INSERT INTO `forum_golos` SET `account` = '$account[id]', `ids` = '$forum[id]', `topik` = '$topik[id]'");
header('Location: forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].''); exit;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Голоса за топик
$req1 = mysql_query("SELECT `id`,`status`,`login`,`sex` FROM `account` WHERE `id` = '".$row['user']."'");
$_user = mysql_fetch_array($req1);
if($_user['status']=="gm"){
$nik = gradient(''.$_user[login].'','00FF00', '00CC00');
echo '<us><img src="pic/main/'.$_user[sex].'.png" alt="*"/> <a href="forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].'&say='.$row['user'].'">'.$nik.'</a></us> <a href="infa.php?id='.$_user['id'].'"><img src="/pic/main/info.gif" alt="*"/></a> (<img src="/pic/main/timeniz.png" alt="*"/>'.$row[time].')';
}else{
if($_user['status']=="moder"){
$nik = gradient(''.$_user[login].'','0066CC', 'AB82FF');
echo '<us><img src="pic/main/'.$_user[sex].'.png" alt="*"/> <a href="forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].'&say='.$row['user'].'">'.$nik.'</a></us> <a href="infa.php?id='.$_user['id'].'"><img src="/pic/main/info.gif" alt="*"/></a> (<img src="/pic/main/timeniz.png" alt="*"/>'.$row[time].')';
}else{
if($_user['status']=="bot"){
$nik = gradient(''.$_user[login].'','FFCC00', 'FF9933');
echo '<us><img src="pic/main/'.$_user[sex].'.png" alt="*"/> <a href="forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].'&say='.$row['user'].'">'.$nik.'</a></us> <a href="infa.php?id='.$_user['id'].'"><img src="/pic/main/info.gif" alt="*"/></a> (<img src="/pic/main/timeniz.png" alt="*"/>'.$row[time].')';
}else{
echo '
<img src="pic/main/'.$_user[sex].'.png" alt="*"/> <a href="forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].'&say='.$row['user'].'">'.$_user['login'].'</a> <a href="infa.php?id='.$_user['id'].'"><img src="/pic/main/info.gif" alt="*"/></a> (<img src="/pic/main/timeniz.png" alt="*"/>'.$row[time].')';
}}}
if($_GET['go']=='delete' && ($account['status']=="moder" || $account['status']=="gm")){
if(isset($_GET['del'])){
$del = $_GET['del'];
}
if($del){
mysql_query("DELETE FROM `forum_msg` WHERE `id`='".$del."'");
header('Location: forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].''); exit;
}else{
header('Location: forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].''); exit;
}}
if ($account['status']=='moder' OR $account['status']=='gm'){
echo ' <a href="forum.php?mod=post&go=delete&id='.$forum[id].'&topik='.$topik[id].'&del='.$row['id'].'"><img src='pic/main/sec.png'></a>';
}
$koment = strip_tags($row['msg']);
$koment = smiles(tags($koment));
echo '<br>';
echo bb($koment);
echo '<hr>';
}
echo '
<center>
Навигация:
';if($page-1>0){
echo '<a href="forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].'&page='.($page-1).'"><</a> ';
}
if($page-1>0){
echo ' <a href="forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].'&page='.($page-1).'">'.($page-1).'</a> ';
}
echo '<b>'.$page.'</b>';
if($page+1<=$cp){
echo ' <a href="forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].'&page='.($page+1).'">'.($page+1).'</a> ';
}
if($page+1<=$cp){
echo ' <a href="forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].'&page='.($page+1).'">></a> ';
}
echo '</center>';
}
if($_GET['go']=='cloze_elita' && ($account['status']=="moder" || $account['status']=="gm")){
if(isset($_GET['topik'])){
$del = $_GET['topik'];
}
if($del){
mysql_query("UPDATE `forum_topik` SET `status`='1' WHERE `id`='".$del."'");
header('Location: forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].''); exit;
}else{
header('Location: forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].''); exit;
}}
if($_GET['go']=='yes_elita' && ($account['status']=="moder" || $account['status']=="gm")){
if(isset($_GET['topik'])){
$del = $_GET['topik'];
}
if($del){
mysql_query("UPDATE `forum_topik` SET `status`='0' WHERE `id`='".$del."'");
header('Location: forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].''); exit;
}else{
header('Location: forum.php?mod=post&id='.$forum[id].'&topik='.$topik[id].''); exit;
}}
if ($account['status']=='moder' OR $account['status']=='gm'){
if($topik[status]==0){
echo'<div class="ssl">';
echo"<a href="forum.php?mod=post&go=cloze_elita&id=$forum[id]&topik=$topik[id]">  <img src="pic/main/nou.png"> Закрыть топик</a></div>";
}else{
echo'<div class="ssl">';
echo"<a href="forum.php?mod=post&go=yes_elita&id=$forum[id]&topik=$topik[id]">  <img src="pic/main/oke.png"> Открыть топик</a></div>";
}}
break;
case 'theme':
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `id`='".intval($_GET['id'])."'"),0)){
$forum=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum` WHERE `id`='".intval($_GET['id'])."'"));
}else{
header('Location: forum.php?');
exit;
}
echo "<img src="pic/forum/forum.png"><a href="forum.php">Форум</a> / $forum[name]<hr>";
$cop=10;
$ca=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_topik` WHERE `razdel`='$forum[id]' "),0);
$cp=ceil($ca/$cop);
if(isset($_GET['page']) && is_numeric($_GET['page'])){
$page = $_GET['page'];
if($_GET['page']>$cp) $page=$cp;
if($_GET['page']<1)$page=1;
}else{
$page=1;
}
$start=$page*$cop-$cop;
$dlist = 'list1';
$req = mysql_query("SELECT * FROM `forum_topik` WHERE `razdel`='$forum[id]' ORDER by `id` DESC LIMIT $start,$cop ");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto>=1){
While($mag = mysql_fetch_array($req))
{
$w=explode("*",$mag[name]);
$kolic = mysql_query("SELECT COUNT(`msg`) FROM `forum_msg` WHERE `topik`='$mag[razdel]' and `tema`='$mag[id]';");
$kols = mysql_result($kolic, 0);
if($mag[status]==0){
echo"<img src="pic/main/forum_2.png"> <a href="forum.php?mod=post&id=$forum[id]&topik=$mag[id]">$mag[tema]</a> ($kols)";
}else{
echo"<img src="pic/main/forum_3.png"> <a href="forum.php?mod=post&id=$forum[id]&topik=$mag[id]">$mag[tema]</a> ($kols)";
}
if($_GET['go']=='delete' && ($account['status']=="moder" || $account['status']=="gm")){
if(isset($_GET['ids'])){
$del = $_GET['ids'];
}
if($del){
mysql_query("DELETE FROM `forum_msg` WHERE `tema`='".$del."'");
mysql_query("DELETE FROM `forum_topik` WHERE `id`='".$del."'");
mysql_query("DELETE FROM `forum_rating` WHERE `topik`='".$del."'");
mysql_query("DELETE FROM `forum_golos` WHERE `topik`='".$del."'");
mysql_query("UPDATE `forum` SET `tem`=`tem` - '1' WHERE `id`='$forum[id]'");
header('Location: forum.php?mod=theme&id='.$forum[id].''); exit;
}else{
header('Location: forum.php?mod=theme&id='.$forum[id].''); exit;
}}
if ($account['status']=='moder' OR $account['status']=='gm'){
echo ' <a href="forum.php?mod=theme&go=delete&id='.$forum[id].'&ids='.$mag[id].'"><img src='pic/main/sec.png'></a>';
}
echo ' <br>';
}
echo '
<hr>
<center>
Навигация:
';if($page-1>0){
echo ' <a href="forum.php?mod=theme&id='.$forum[id].'&page='.($page-1).'"><</a> ';
}
if($page-1>0){
echo ' <a href="forum.php?mod=theme&id='.$forum[id].'&page='.($page-1).'">'.($page-1).'</a> ';
}
echo '<b>'.$page.'</b>';
if($page+1<=$cp){
echo ' <a href="forum.php?mod=theme&id='.$forum[id].'&page='.($page+1).'">'.($page+1).'</a> ';
}
if($page+1<=$cp){
echo ' <a href="forum.php?mod=theme&id='.$forum[id].'&page='.($page+1).'">></a> ';
}
echo '</center>';
}else{echo "<img src="pic/main/!.png"> В данном разделе пока нет топиков.<br>";}
echo'<div class="ssl">';
echo"<a href="forum.php?mod=topik&id=$forum[id]">  <img src="pic/forum/forum2.png"> Создать топик</a></div>";
break;
case 'topik':
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `id`='".intval($_GET['id'])."'"),0)){
$forum=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum` WHERE `id`='".intval($_GET['id'])."'"));
}else{
header('Location: forum.php?');
exit;
}
echo "<img src="pic/forum/forum.png"><a href="forum.php">Форум</a> / <a href="forum.php?mod=theme&id=$forum[id]">$forum[name]</a><hr>";
if($account['status']=="user" && ($forum['id']=="1")){
echo '<img src='pic/main/!.png'> Cоздавать топики в данном разделе может только администратор.</div>';
include 'inc/nogi.php';
exit;
}
if($account['status']=="moder" && ($forum['id']=="1")){
echo '<img src='pic/main/!.png'> Cоздавать топики в данном разделе может только администратор.</div>';
include 'inc/nogi.php';
exit;
}
$faq = mysql_query("SELECT * FROM `config`");
$base = mysql_fetch_array($faq);
if($account[lvl]<$base[forum]){
echo '<img src='pic/main/!.png'> Cоздавать темы на форуме доступно с '.$base[forum].' уровня.</div>';
include 'inc/nogi.php';
exit;
}
$req = mysql_query("SELECT * FROM `block` WHERE `usr`='$account[id]' and `ban_time`>'$time' and `tip` = '1' ");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto>=1){
While($mag = mysql_fetch_array($req))
{
echo"<center><div class=s><img src='/pic/main/!.png' alt='*'/> <font color=red>На вашего персонажа наложена молчанка, вы не можете создавать топики на форуме.</font></div></center></div>";
include 'inc/nogi.php';
exit;
}}
if (('chat_clear') && isset($_GET['act']) && $_GET['act']=='clear1')
{
echo"<img src="pic/main/!.png"> Введите название топика!<hr>";
}
if (('chat_clear') && isset($_GET['act']) && $_GET['act']=='clear2')
{
echo"<img src="pic/main/!.png"> Название топика может содержать от 3, до 50-ти рус. или латин. символов.<hr>";
}
if (('chat_clear') && isset($_GET['act']) && $_GET['act']=='clear3')
{
echo"<img src="pic/main/!.png"> Введите текст сообщения.<hr>";
}
if (('chat_clear') && isset($_GET['act']) && $_GET['act']=='clear4')
{
echo"<img src="pic/main/!.png"> Длина сообщения должна содержать от 10 до 3,000-ти рус. или латин. символов.<hr>";
}
echo '<form name="form" action="forum.php?mod=topik_yes&id='.$forum[id].'" method="post">';
echo "Название топика:<br><small><font color='#999999'><i>* Название топика может содержать от 3, до 50-ти рус. или латин. символов.</i></font></small><br/>";
echo "<input class="button" name="nazva" maxlength="50" title="Название темы" emptyok="true"/>";
echo "<br/>Текст сообщения:<br><small><font color='#999999'><i>* Длина сообщения должна содержать от 10 до 3,000-ти рус. или латин. символов.</i></font></small><br/>";
echo ''.bbpanel('form', 'msg').'<textarea name="msg" cols="20" rows="3"></textarea><br>
<input class="button" type="submit" value="Создать"/></form>';
break;
case 'topik_yes':
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `id`='".intval($_GET['id'])."'"),0)){
$forum=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum` WHERE `id`='".intval($_GET['id'])."'"));
}else{
header('Location: forum.php?');
exit;
}
$nazva=htmlspecialchars($_POST[nazva]);
$msg=htmlspecialchars($_POST[msg]);
if(mb_strlen($nazva,'utf-8') < 3)
{
header("Location: forum.php?mod=topik&id=$forum[id]&act=clear1");
exit;
}
if(mb_strlen($nazva,'utf-8') > 50)
{
header("Location: forum.php?mod=topik&id=$forum[id]&act=clear2");
exit;
}
if(empty($msg)){
header("Location: forum.php?mod=topik&id=$forum[id]&act=clear3");
exit;
}
if(mb_strlen($msg,'utf-8') > 3000)
{
header("Location: forum.php?mod=topik&id=$forum[id]&act=clear4");
exit;
}
$time = date("H:i d.m.y");
mysql_query("INSERT INTO `forum_topik` SET `razdel` = '$forum[id]',`tema` = '$nazva',`user` = '$account[id]' ");
$u=mysql_query("SELECT * FROM `forum_topik` ORDER by `id` DESC");
$dat=mysql_fetch_array($u);
$uids=$dat[id];
include ("inc/antireklama.php");
mysql_query("INSERT INTO `forum_msg` SET `topik` = '$forum[id]',`tema`='$uids',`msg` = '$msg',`user` = '$account[id]',`time` = '$time ' ");
if($forum['id']=="1"){
mysql_query("INSERT INTO `chat`(`account`,`msg`,`time`,`tyrney`) VALUES('2','<b>Обновлены новости игры!</b>','".time()."','1')");
}
mysql_query("UPDATE `forum` SET `tem`=`tem` + '1' WHERE `id`='$forum[id]'");
header('Location: forum.php?mod=theme&id='.$forum[id].'');
break;
case 'razdel':
if($account['status']=="gm"){
if(empty($_POST[name])){
echo "<form action="forum.php?mod=razdel" method="post">";
echo"Название раздела:<br><input class='input' type="text" size="25" name="name" maxlength="25"/><br/>";
echo"Картинка к разделу:<br><input class='input' type="text" size="25" name="img" maxlength="25"/><br/>";
echo '<input class="button" type="submit" value="Создать" /></form>';
}else{
mysql_query("INSERT INTO `forum` SET `name` = '".mysql_real_escape_string($_POST['name'])."', `img` = '".mysql_real_escape_string($_POST['img'])."'");
header ("Location: forum.php"); exit;
}
}else{
header ("Location: forum.php"); exit;
}
}
echo "</div>";
}else{
header ("Location: index.php"); exit;
}
include 'inc/nogi.php';
?>