Просмотр файла NuclearCMS_v.1.0.0/forum/include/moder.php

Размер файла: 43.5Kb
<?php
list($msec,$sec)=explode(chr(32),microtime());
$headtime=$sec+$msec;
INCLUDE_ONCE("connect.php");
include_once("config.php");
include_once("users.php");
include_once("functions.php");
if($status == "moderator" or $status == "admin")
 {

	switch($_GET['mode'])
	{
	case 'mtopic':
	$id_theme = intval($_GET['id']);
	$t_i = mysql_query("SELECT * FROM `themes` WHERE `id`=".$id_theme);
	if(mysql_num_rows($t_i) < 1)
	{
		if($version == "wml")
			{
				header('Content-type: text/vnd.wap.wml; charset=utf-8');
				header("Cache-Control: no-cache");
				echo(doctype("Ошибка").'
Тема удалена!  <br />
---   <br />
<a href="./?p=0&amp;v=wml&amp;sid='.$sid.'">Форумы</a>
</p></card></wml>');
			} elseif($version == "xhtml")
				{
					header("Content-type: text/html; charset=utf-8");
					header("Last-Modified:".gmdate("D, d M Y H:i:s")." GMT");
   header("Cache-Control: no-cache, must-relative");
					echo('<html>
<head>
<title>Ошибка</title>
</head>
<body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
<table align="center" border="0" cellspacing="1" cellpadding="5" width="350">
<tr><td align="center" bgcolor="'.$style['title'].'">
<font color="#FFFFFF"><b>Ошибка</b></font>
</td></tr>
<tr><td bgcolor="'.$style['bottom'].'"></td></tr>
<tr><td bgcolor="'.$style['text'].'">Тема удалена</td></tr>
<tr><td bgcolor="'.$style['bottom'].'">
<a href="'.htmlspecialchars($_SERVER['HTTP_REFERER']).'">Назад</a>
</td></tr></table>
</body></html>');
				}
	} else
	{
	$id_post = topic2post($id_theme);
	$SQL = mysql_query("SELECT * FROM `posts` WHERE `id`=".$id_post);
	$line = mysql_fetch_array($SQL);
	$t_info = mysql_fetch_array($t_i);
	if($version == "wml")
	{
 		header("Content-type: text/vnd.wap.wml; charset=utf-8");
 		header("Cache-Control: no-cache");
echo(doctype("Модераторская").'Логин ['.$line['name'].'] <br />
User-Agent: ['.strtok($line['useragent'], "/").'] <br />
IP: ['.$line['ip'].'] <br />
---<br />
<a href="./?p=25&amp;mode=del&amp;sid='.$sid.'&amp;tid='.$id_theme.'&amp;v=wml&amp;fid='.$t_info['id_forum'].'">Удалить тему</a><br />');
	if($t_info['pos'] == 1)
	{
		echo('<a href="./?p=25&amp;mode=bolt&amp;b=1&amp;sid='.$sid.'&amp;tid='.$id_theme.'&amp;v=wml&amp;fid='.$t_info['id_forum'].'">Закрепить тему</a><br />');
	} else
	{
		echo('<a href="./?p=25&amp;mode=bolt&amp;b=0&amp;sid='.$sid.'&amp;tid='.$id_theme.'&amp;v=wml&amp;fid='.$t_info['id_forum'].'">Открепить тему</a><br />');
	}
echo('---<br />
Блокировать на : <br />
<select name="time">
<option value="3600">1 час.</option>
<option value="21600">6 час.</option>
<option value="86400">1 день</option>
<option value="604800">1 неделя</option>
<option value="2592000">1 месяц</option>
<option value="ip3600">ip 1 час.</option>
<option value="ip21600">ip 6 час.</option>
<option value="ip86400">ip 1 день</option>
<option value="ip604800">ip 1 неделя</option>
<option value="ip2592000">ip 1 месяц</option>
<option value="ua3600">ua 1 час.</option>
<option value="ua21600">ua 6 час.</option>
<option value="ua86400">ua 1 день</option>
<option value="ua604800">ua 1 неделя</option>
<option value="ua2592000">ua 1 месяц</option>
</select><br />
Причина: <br />
<input type="text" name="mess" /><br />
<anchor>[Блокировать]
<go href="./?p=25&amp;v=wml&amp;sid='.$sid.'&amp;mode=ban" method="post">
<postfield name="time" value="$(time)" />
<postfield name="mess" value="$(mess)" />
<postfield name="who" value="'.$line['name'].'" />
<postfield name="ip" value="'.$line['ip'].'" />
<postfield name="ua" value="'.$line['useragent'].'" />
<postfield name="fid" value="'.$t_info['id_forum'].'" />

</go></anchor><br /><br />
- - - <br />
Переименовать: <br />
<input type="text" name="rename" value="'.$t_info['tname'].'" /> <br />
<anchor>[Переименовать]
<go href="./?p=25&amp;v=wml&amp;sid='.$sid.'&amp;mode=rename" method="post">
<postfield name="rename" value="$(rename)" />
<postfield name="tid" value="'.$id_theme.'" />
<postfield name="fid" value="'.$t_info['id_forum'].'" />
</go></anchor><br />
- - - <br />
Переместить: <br />
<select name="nf">');
$fidsS = mysql_query("SELECT id, name FROM `forums`");
while($fids = mysql_fetch_array($fidsS))
	{
		echo('<option value="'.$fids['id'].'">'.$fids['name'].'</option>');
 	}
 echo('</select><br />
 <anchor>[Переместить]
 <go href="./?p=25&amp;v=wml&amp;sid='.$sid.'&amp;mode=nf" method="post">
 <postfield name="nf" value="$(nf)" />
<postfield name="tid" value="'.$id_theme.'" />
<postfield name="fid" value="'.$t_info['id_forum'].'" />

</go></anchor><br />
- - - <br />
<a href="./?p=25&amp;mode=adel&amp;v=wml&amp;sid='.$sid.'&amp;id='.username2id($line['name']).'&amp;fid='.$t_info['id_forum'].'">Удалить все от ника за последний час</a><br />
<a href="./?p=25&amp;mode=adelall&amp;v=wml&amp;sid='.$sid.'&amp;id='.username2id($line['name']).'&amp;fid='.$t_info['id_forum'].'">Удалить все от ника</a><br />
<a href="./?p=2&amp;v=wml&amp;sid='.$sid.'&amp;f='.$t_info['id_forum'].'">Назад</a><br />

</p></card></wml>');
					} elseif($version == "xhtml")
					{
						header("Content-type: text/html; charset=utf-8");
						header("Last-Modified:".gmdate("D, d M Y H:i:s")." GMT");
   header("Cache-Control: no-cache, must-relative");
						echo('<html>
<head>
<title>Модерка</title>
</head>
<body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
<table align="center" border="0" cellspacing="1" cellpadding="5" width="350">
<tr><td align="center" bgcolor="'.$style['title'].'" colspan="2">
<font color="#FFFFFF"><b>Модерка</b></font>
</td></tr>
<tr><td bgcolor="'.$style['bottom'].'" colspan="2">
<a href="./?p=25&amp;mode=del&amp;sid='.$sid.'&amp;tid='.$id_theme.'&amp;v=xhtml&amp;fid='.$t_info['id_forum'].'" style="background-color: #FF0000; color: #FFFFFF; text-decoration: underline">Удалить тему</a><br />');
	if($t_info['pos'] == 1)
	{
		echo('<a href="./?p=25&amp;mode=bolt&amp;b=1&amp;sid='.$sid.'&amp;tid='.$id_theme.'&amp;v=xhtml&amp;fid='.$t_info['id_forum'].'">Закрепить тему</a><br />');
	} else
	{
		echo('<a href="./?p=25&amp;mode=bolt&amp;b=0&amp;sid='.$sid.'&amp;tid='.$id_theme.'&amp;v=xhtml&amp;fid='.$t_info['id_forum'].'">Открепить тему</a><br />');
	}
echo('
</td></tr>
<tr bgcolor="'.$style['text'].'"><td>
Логин:</td><td> ['.$line['name'].']</td></tr>
<tr bgcolor="'.$style['text'].'"><td>
User-Agent:</td><td>['.strtok($line['useragent'], "/").'] </td></tr>
<tr bgcolor="'.$style['text'].'"><td>
IP:</td><td> ['.$line['ip'].']</td></tr>
<tr bgcolor="'.$style['text'].'"><td>
<form action="./?p=25&amp;v=xhtml&amp;sid='.$sid.'&amp;mode=ban" method="post">
Блокировать на:</td><td>
<select name="time">
<option value="3600">1 час.</option>
<option value="21600">6 час.</option>
<option value="86400">1 день</option>
<option value="604800">1 неделя</option>
<option value="2592000">1 месяц</option>
<option value="ip3600">ip 1 час.</option>
<option value="ip21600">ip 6 час.</option>
<option value="ip86400">ip 1 день</option>
<option value="ip604800">ip 1 неделя</option>
<option value="ip2592000">ip 1 месяц</option>
<option value="ua3600">ua 1 час.</option>
<option value="ua21600">ua 6 час.</option>
<option value="ua86400">ua 1 день</option>
<option value="ua604800">ua 1 неделя</option>
<option value="ua2592000">ua 1 месяц</option>
</select></td></tr>
<tr bgcolor="'.$style['text'].'"><td>
Причина: </td><td>
<input type="text" name="mess" /></td></tr>
<tr bgcolor="'.$style['text'].'"><td align="center" colspan="2">
<input type="submit" value="Блокировать" /><br />
<input type="hidden" name="ua" value="'.$line['useragent'].'" />
<input type="hidden" name="who" value="'.$line['name'].'" />
<input type="hidden" name="ip" value="'.$line['ip'].'" />
<input type="hidden" name="fid" value="'.$t_info['id_forum'].'" />
</form></td></tr>
<tr bgcolor="'.$style['text'].'"><td>
<form action="./?p=25&amp;v=xhtml&amp;sid='.$sid.'&amp;mode=rename" method="post">
Переименовать:</td><td>
<input type="text" name="rename" value="'.$t_info['tname'].'" /><br />
<input type="hidden" name="fid" value="'.$t_info['id_forum'].'" />
<input type="hidden" name="tid" value="'.$id_theme.'" /></td></tr>
<tr bgcolor="'.$style['text'].'"><td colspan="2" align="center">
<input type="submit" value="Переименовать" />
</form></td></tr>
<tr bgcolor="'.$style['text'].'"><td>
Переместить:</td><td>
<form action="./?p=25&amp;v=xhtml&amp;sid='.$sid.'&amp;mode=nf" method="post">
<select name="nf">');
$fidsS = mysql_query("SELECT id, name FROM `forums`");
while($fids = mysql_fetch_array($fidsS))
	{
		echo('<option value="'.$fids['id'].'">'.$fids['name'].'</option>');
 	}
 echo('</select><br />
 <input type="hidden" name="fid" value="'.$t_info['id_forum'].'" />
 <input type="hidden" name="tid" value="'.$id_theme.'" />
 </td></tr>
 <tr bgcolor="'.$style['text'].'"><td align="center" colspan="2">
 <input type="submit" value="Переместить" />
 </form></td></tr>
<tr bgcolor="'.$style['bottom'].'"><td colspan="2">
<a href="./?p=25&amp;mode=adel&amp;v=xhtml&amp;sid='.$sid.'&amp;id='.username2id($line['name']).'&amp;fid='.$t_info['id_forum'].'">Удалить все от ника за последний час</a><br />
<a href="./?p=25&amp;mode=adelall&amp;v=xhtml&amp;sid='.$sid.'&amp;id='.username2id($line['name']).'&amp;fid='.$t_info['id_forum'].'">Удалить все от ника</a><br />
<a href="./?p=2&amp;v=xhtml&amp;sid='.$sid.'&amp;f='.$t_info['id_forum'].'">Назад</a><br />
</td></tr></table>
</body></html>');
			  }
		}
break;

case 'mtopicm':
if( in_array($status, array('admin')) )
			{	
			$id_theme = intval($_GET['id']);
	$t_i = mysql_query("SELECT * FROM `mthemes` WHERE `id`=".$id_theme);
	if(mysql_num_rows($t_i) < 1)
	{
		if($version == "wml")
			{
				header('Content-type: text/vnd.wap.wml; charset=utf-8');
				header("Cache-Control: no-cache");
				echo(doctype("Ошибка").'
Тема удалена!  <br />
---   <br />
<a href="./?p=1&amp;v=wml&amp;sid='.$sid.'">Форумы</a>
</p></card></wml>');
			} elseif($version == "xhtml")
				{
					header("Content-type: text/html; charset=utf-8");
					header("Last-Modified:".gmdate("D, d M Y H:i:s")." GMT");
   header("Cache-Control: no-cache, must-relative");
					echo('<html>
<head>
<title>Ошибка</title>
</head>
<body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
<table align="center" border="0" cellspacing="1" cellpadding="5" width="350">
<tr><td align="center" bgcolor="'.$style['title'].'">
<font color="#FFFFFF"><b>Ошибка</b></font>
</td></tr>
<tr><td bgcolor="'.$style['bottom'].'"></td></tr>
<tr><td bgcolor="'.$style['text'].'">Тема удалена</td></tr>
<tr><td bgcolor="'.$style['bottom'].'">
<a href="'.htmlspecialchars($_SERVER['HTTP_REFERER']).'">Назад</a>
</td></tr></table>
</body></html>');
				}
	} else
	{
	$id_post = topic2postm($id_theme);
	$SQL = mysql_query("SELECT * FROM `mposts` WHERE `id`=".$id_post);
	$line = mysql_fetch_array($SQL);
	$t_info = mysql_fetch_array($t_i);
	if($version == "wml")
	{
 		header("Content-type: text/vnd.wap.wml; charset=utf-8");
 		header("Cache-Control: no-cache");
echo(doctype("Модераторская").'Логин ['.$line['name'].'] <br />
User-Agent: ['.strtok($line['useragent'], "/").'] <br />
IP: ['.$line['ip'].'] <br />
---<br />
<a href="./?p=25&amp;mode=delm&amp;sid='.$sid.'&amp;tid='.$id_theme.'&amp;v=wml&amp;fid='.$t_info['id_forum'].'">Удалить тему</a><br />');
	if($t_info['pos'] == 1)
	{
		echo('<a href="./?p=25&amp;mode=boltm&amp;b=1&amp;sid='.$sid.'&amp;tid='.$id_theme.'&amp;v=wml&amp;fid='.$t_info['id_forum'].'">Закрепить тему</a><br />');
	} else
	{
		echo('<a href="./?p=25&amp;mode=boltm&amp;b=0&amp;sid='.$sid.'&amp;tid='.$id_theme.'&amp;v=wml&amp;fid='.$t_info['id_forum'].'">Открепить тему</a><br />');
	}
echo('---<br />
Блокировать на : <br />
<select name="time">
<option value="3600">1 час.</option>
<option value="21600">6 час.</option>
<option value="86400">1 день</option>
<option value="604800">1 неделя</option>
<option value="2592000">1 месяц</option>
<option value="ip3600">ip 1 час.</option>
<option value="ip21600">ip 6 час.</option>
<option value="ip86400">ip 1 день</option>
<option value="ip604800">ip 1 неделя</option>
<option value="ip2592000">ip 1 месяц</option>
<option value="ua3600">ua 1 час.</option>
<option value="ua21600">ua 6 час.</option>
<option value="ua86400">ua 1 день</option>
<option value="ua604800">ua 1 неделя</option>
<option value="ua2592000">ua 1 месяц</option>
</select><br />
Причина: <br />
<input type="text" name="mess" /><br />
<anchor>[Блокировать]
<go href="./?p=25&amp;v=wml&amp;sid='.$sid.'&amp;mode=ban" method="post">
<postfield name="time" value="$(time)" />
<postfield name="mess" value="$(mess)" />
<postfield name="who" value="'.$line['name'].'" />
<postfield name="ip" value="'.$line['ip'].'" />
<postfield name="ua" value="'.$line['useragent'].'" />
<postfield name="fid" value="'.$t_info['id_forum'].'" />

</go></anchor><br /><br />
- - - <br />
Переименовать: <br />
<input type="text" name="rename" value="'.$t_info['tname'].'" /> <br />
<anchor>[Переименовать]
<go href="./?p=25&amp;v=wml&amp;sid='.$sid.'&amp;mode=renamem" method="post">
<postfield name="renamem" value="$(rename)" />
<postfield name="tid" value="'.$id_theme.'" />
<postfield name="fid" value="'.$t_info['id_forum'].'" />
</go></anchor><br />
- - - <br />
Переместить: <br />
<select name="nf">');
$fidsS = mysql_query("SELECT id, name FROM `mforums`");
while($fids = mysql_fetch_array($fidsS))
	{
		echo('<option value="'.$fids['id'].'">'.$fids['name'].'</option>');
 	}
 echo('</select><br />
 <anchor>[Переместить]
 <go href="./?p=25&amp;v=wml&amp;sid='.$sid.'&amp;mode=nfm" method="post">
 <postfield name="nfm" value="$(nf)" />
<postfield name="tid" value="'.$id_theme.'" />
<postfield name="fid" value="'.$t_info['id_forum'].'" />

</go></anchor><br />
- - - <br />
<a href="./?p=25&amp;mode=adel&amp;v=wml&amp;sid='.$sid.'&amp;id='.username2id($line['name']).'&amp;fid='.$t_info['id_forum'].'">Удалить все от ника за последний час</a><br />
<a href="./?p=3&amp;v=wml&amp;sid='.$sid.'&amp;f='.$t_info['id_forum'].'">Назад</a><br />
</p></card></wml>');
					} elseif($version == "xhtml")
					{
						header("Content-type: text/html; charset=utf-8");
						header("Last-Modified:".gmdate("D, d M Y H:i:s")." GMT");
   header("Cache-Control: no-cache, must-relative");
						echo('<html>
<head>
<title>Модерка</title>
</head>
<body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
<table align="center" border="0" cellspacing="1" cellpadding="5" width="350">
<tr><td align="center" bgcolor="'.$style['title'].'" colspan="2">
<font color="#FFFFFF"><b>Модерка</b></font>
</td></tr>
<tr><td bgcolor="'.$style['bottom'].'" colspan="2">
<a href="./?p=25&amp;mode=delm&amp;sid='.$sid.'&amp;tid='.$id_theme.'&amp;v=xhtml&amp;fid='.$t_info['id_forum'].'" style="background-color: #FF0000; color: #FFFFFF; text-decoration: underline">Удалить тему</a><br />');
	if($t_info['pos'] == 1)
	{
		echo('<a href="./?p=25&amp;mode=boltm&amp;b=1&amp;sid='.$sid.'&amp;tid='.$id_theme.'&amp;v=xhtml&amp;fid='.$t_info['id_forum'].'">Закрепить тему</a><br />');
	} else
	{
		echo('<a href="./?p=25&amp;mode=boltm&amp;b=0&amp;sid='.$sid.'&amp;tid='.$id_theme.'&amp;v=xhtml&amp;fid='.$t_info['id_forum'].'">Открепить тему</a><br />');
	}
echo('
</td></tr>
<tr bgcolor="'.$style['text'].'"><td>
Логин:</td><td> ['.$line['name'].']</td></tr>
<tr bgcolor="'.$style['text'].'"><td>
User-Agent:</td><td>['.strtok($line['useragent'], "/").'] </td></tr>
<tr bgcolor="'.$style['text'].'"><td>
IP:</td><td> ['.$line['ip'].']</td></tr>
<tr bgcolor="'.$style['text'].'"><td>
<form action="./?p=25&amp;v=xhtml&amp;sid='.$sid.'&amp;mode=ban" method="post">
Блокировать на:</td><td>
<select name="time">
<option value="3600">1 час.</option>
<option value="21600">6 час.</option>
<option value="86400">1 день</option>
<option value="604800">1 неделя</option>
<option value="2592000">1 месяц</option>
<option value="ip3600">ip 1 час.</option>
<option value="ip21600">ip 6 час.</option>
<option value="ip86400">ip 1 день</option>
<option value="ip604800">ip 1 неделя</option>
<option value="ip2592000">ip 1 месяц</option>
<option value="ua3600">ua 1 час.</option>
<option value="ua21600">ua 6 час.</option>
<option value="ua86400">ua 1 день</option>
<option value="ua604800">ua 1 неделя</option>
<option value="ua2592000">ua 1 месяц</option>
</select></td></tr>
<tr bgcolor="'.$style['text'].'"><td>
Причина: </td><td>
<input type="text" name="mess" /></td></tr>
<tr bgcolor="'.$style['text'].'"><td align="center" colspan="2">
<input type="submit" value="Блокировать" /><br />
<input type="hidden" name="ua" value="'.$line['useragent'].'" />
<input type="hidden" name="who" value="'.$line['name'].'" />
<input type="hidden" name="ip" value="'.$line['ip'].'" />
<input type="hidden" name="fid" value="'.$t_info['id_forum'].'" />
</form></td></tr>
<tr bgcolor="'.$style['text'].'"><td>
<form action="./?p=25&amp;v=xhtml&amp;sid='.$sid.'&amp;mode=renamem" method="post">
Переименовать:</td><td>
<input type="text" name="rename" value="'.$t_info['tname'].'" /><br />
<input type="hidden" name="fid" value="'.$t_info['id_forum'].'" />
<input type="hidden" name="tid" value="'.$id_theme.'" /></td></tr>
<tr bgcolor="'.$style['text'].'"><td colspan="2" align="center">
<input type="submit" value="Переименовать" />
</form></td></tr>
<tr bgcolor="'.$style['text'].'"><td>
Переместить:</td><td>
<form action="./?p=25&amp;v=xhtml&amp;sid='.$sid.'&amp;mode=nfm" method="post">
<select name="nf">');
$fidsS = mysql_query("SELECT id, name FROM `mforums`");
while($fids = mysql_fetch_array($fidsS))
	{
		echo('<option value="'.$fids['id'].'">'.$fids['name'].'</option>');
 	}
 echo('</select><br />
 <input type="hidden" name="fid" value="'.$t_info['id_forum'].'" />
 <input type="hidden" name="tid" value="'.$id_theme.'" />
 </td></tr>
 <tr bgcolor="'.$style['text'].'"><td align="center" colspan="2">
 <input type="submit" value="Переместить" />
 </form></td></tr>
<tr bgcolor="'.$style['bottom'].'"><td colspan="2">
<a href="./?p=25&amp;mode=adel&amp;v=xhtml&amp;sid='.$sid.'&amp;id='.username2id($line['name']).'&amp;fid='.$t_info['id_forum'].'">Удалить все от ника за последний час</a><br />
<a href="./?p=3&amp;v=xhtml&amp;sid='.$sid.'&amp;f='.$t_info['id_forum'].'">Назад</a><br />
</td></tr></table>
</body></html>');
			  }
		}
		}
break;
case 'mpost':
	$t_info = mysql_fetch_array(mysql_query("SELECT * FROM `themes` WHERE `id`=".intval($_GET['tid'])));
	if(!mysql_result(mysql_query("SELECT COUNT(*) FROM `posts` WHERE `id`=".intval($_GET['id'])), 0))
	{
		if($version == "wml")
			{
				header('Content-type: text/vnd.wap.wml; charset=utf-8');
				header("Cache-Control: no-cache");
				echo(doctype("Ошибка").'
Поста не существует!  <br />
---   <br />
<a href="./?p=0&amp;v=wml&amp;sid='.$sid.'">Форумы</a>
</p></card></wml>');
			} elseif($version == "xhtml")
				{
					header("Content-type: text/html; charset=utf-8");
					header("Last-Modified:".gmdate("D, d M Y H:i:s")." GMT");
   header("Cache-Control: no-cache, must-relative");
					echo('<html>
<head>
<title>Ошибка</title>
</head>
<body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
<table align="center" border="0" cellspacing="1" cellpadding="5" width="350">
<tr><td align="center" bgcolor="'.$style['title'].'">
<font color="#FFFFFF"><b>Ошибка</b></font>
</td></tr>
<tr><td bgcolor="'.$style['bottom'].'"></td></tr>
<tr><td bgcolor="'.$style['text'].'">Поста не существует!</td></tr>
<tr><td bgcolor="'.$style['bottom'].'">
<a href="'.htmlspecialchars($_SERVER['HTTP_REFERER']).'">Назад</a>
</td></tr></table>
</body></html>');
				}
	} else
	{
		$qline = mysql_query("SELECT * FROM `posts` WHERE `id`=".intval($_GET['id']));
		 $line = mysql_fetch_array($qline);
		 if($version == "wml")
	{
 		header("Content-type: text/vnd.wap.wml; charset=utf-8");
 		header("Cache-Control: no-cache");
echo(doctype("Модераторская").'
Логин ['.$line['name'].'] <br />
User-Agent: ['.strtok($line['useragent'], "/").'] <br />
IP: ['.$line['ip'].'] <br />
---<br />
<a href="./?p=25&amp;v=wml&amp;sid='.$sid.'&amp;mode=del&amp;pid='.$_GET['id'].'&amp;tid='.$_GET['tid'].'">Удалить пост</a><br />
---<br />
Блокировать на : <br />
<select name="time">
<option value="3600">1 час.</option>
<option value="21600">6 час.</option>
<option value="86400">1 день</option>
<option value="604800">1 неделя</option>
<option value="2592000">1 месяц</option>
<option value="ip3600">ip 1 час.</option>
<option value="ip21600">ip 6 час.</option>
<option value="ip86400">ip 1 день</option>
<option value="ip604800">ip 1 неделя</option>
<option value="ip2592000">ip 1 месяц</option>
<option value="ua3600">ua 1 час.</option>
<option value="ua21600">ua 6 час.</option>
<option value="ua86400">ua 1 день</option>
<option value="ua604800">ua 1 неделя</option>
<option value="ua2592000">ua 1 месяц</option>
</select><br />
Причина: <br />
<input type="text" name="mess" /><br />
<anchor>[Блокировать]
<go href="./?p=25&amp;v=wml&amp;sid='.$sid.'&amp;mode=ban" method="post">
<postfield name="time" value="$(time)" />
<postfield name="mess" value="$(mess)" />
<postfield name="ip" value="'.$line['ip'].'" />
<postfield name="who" value="'.$line['name'].'" />
<postfield name="ua" value="'.$line['useragent'].'" />
<postfield name="fid" value="'.$t_info['id_forum'].'" />

</go></anchor><br /><br />
- - - <br />
<a href="./?p=25&amp;mode=adel&amp;v=wml&amp;sid='.$sid.'&amp;id='.username2id($line['name']).'&amp;fid='.$t_info['id_forum'].'">Удалить все от ника за последний час</a><br />
<a href="./?p=4&amp;v=wml&amp;sid='.$sid.'&amp;t='.$_GET['tid'].'">Назад</a>  <br />
<a href="./?p=0&amp;v=wml&amp;sid='.$sid.'">Форумы</a>
</p></card></wml>');
					} elseif($version == "xhtml")
					{
						header("Content-type: text/html; charset=utf-8");
						header("Last-Modified:".gmdate("D, d M Y H:i:s")." GMT");
   header("Cache-Control: no-cache, must-relative");
						echo('<html>
<head>
<title>Модерка</title>
</head>
<body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
<table align="center" border="0" cellspacing="1" cellpadding="5" width="350">
<tr><td align="center" bgcolor="'.$style['title'].'" colspan="2">
<font color="#FFFFFF"><b>Модерка</b></font>
</td></tr>
<tr><td bgcolor="'.$style['bottom'].'" colspan="2">
<a href="./?p=25&amp;v=xhtml&amp;sid='.$sid.'&amp;mode=del&amp;pid='.$_GET['id'].'&amp;tid='.$line['id_theme'].' " style="background-color: #FF0000; color: #FFFFFF; text-decoration: underline">Удалить пост</a>
</td></tr>
<tr bgcolor="'.$style['text'].'"><td>
Логин:</td><td>['.$line['name'].']</td></tr>
<tr bgcolor="'.$style['text'].'"><td>
User-Agent:</td><td>['.strtok($line['useragent'], "/").']</td></tr>
<tr bgcolor="'.$style['text'].'"><td>
IP: </td><td>['.$line['ip'].'] </td></tr>
<tr bgcolor="'.$style['text'].'"><td>
<form action="./?p=25&amp;v=xhtml&amp;sid='.$sid.'&amp;mode=ban" method="post">
Блокировать на:</td><td>
<select name="time">
<option value="3600">1 час.</option>
<option value="21600">6 час.</option>
<option value="86400">1 день</option>
<option value="604800">1 неделя</option>
<option value="2592000">1 месяц</option>
<option value="ip3600">ip 1 час.</option>
<option value="ip21600">ip 6 час.</option>
<option value="ip86400">ip 1 день</option>
<option value="ip604800">ip 1 неделя</option>
<option value="ip2592000">ip 1 месяц</option>
<option value="ua3600">ua 1 час.</option>
<option value="ua21600">ua 6 час.</option>
<option value="ua86400">ua 1 день</option>
<option value="ua604800">ua 1 неделя</option>
<option value="ua2592000">ua 1 месяц</option>
</select></td></tr>
<tr bgcolor="'.$style['text'].'"><td>
Причина:</td><td>
<input type="text" name="mess" /></td></tr>
<tr bgcolor="'.$style['text'].'"><td align="center" colspan="2">
<input type="submit" value="Блокировать" />
<input type="hidden" name="ua" value="'.$line['useragent'].'" />
<input type="hidden" name="who" value="'.$line['name'].'" />
<input type="hidden" name="ip" value="'.$line['ip'].'" />
<input type="hidden" name="fid" value="'.$t_info['id_forum'].'" />
</form></td></tr>
<tr bgcolor="'.$style['bottom'].'"><td colspan="2">
<a href="./?p=25&amp;mode=adel&amp;v=xhtml&amp;sid='.$sid.'&amp;id='.username2id($line['name']).'&amp;fid='.$t_info['id_forum'].'">Удалить все от ника за последний час</a><br />
<a href="./?p=4&amp;v=xhtml&amp;sid='.$sid.'&amp;t='.$_GET['tid'].'">Назад</a><br />
<a href="./?p=0&amp;v=xhtml&amp;sid='.$sid.'">Форумы</a>
</td></tr></table>
</body></html>');
			  }
	}
break;
case 'mpostm':
if( in_array($status, array('admin')) )
			{
	$t_info = mysql_fetch_array(mysql_query("SELECT * FROM `mthemes` WHERE `id`=".intval($_GET['tid'])));
	if(!mysql_result(mysql_query("SELECT COUNT(*) FROM `mposts` WHERE `id`=".intval($_GET['id'])), 0))
	{
		if($version == "wml")
			{
				header('Content-type: text/vnd.wap.wml; charset=utf-8');
				header("Cache-Control: no-cache");
				echo(doctype("Ошибка").'
Поста не существует!  <br />
---   <br />
<a href="./?p=0&amp;v=wml&amp;sid='.$sid.'">Форумы</a>
</p></card></wml>');
			} elseif($version == "xhtml")
				{
					header("Content-type: text/html; charset=utf-8");
					header("Last-Modified:".gmdate("D, d M Y H:i:s")." GMT");
   header("Cache-Control: no-cache, must-relative");
					echo('<html>
<head>
<title>Ошибка</title>
</head>
<body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
<table align="center" border="0" cellspacing="1" cellpadding="5" width="350">
<tr><td align="center" bgcolor="'.$style['title'].'">
<font color="#FFFFFF"><b>Ошибка</b></font>
</td></tr>
<tr><td bgcolor="'.$style['bottom'].'"></td></tr>
<tr><td bgcolor="'.$style['text'].'">Поста не существует!</td></tr>
<tr><td bgcolor="'.$style['bottom'].'">
<a href="'.htmlspecialchars($_SERVER['HTTP_REFERER']).'">Назад</a>
</td></tr></table>
</body></html>');
				}
	} else
	{
		$qline = mysql_query("SELECT * FROM `mposts` WHERE `id`=".intval($_GET['id']));
		 $line = mysql_fetch_array($qline);
		 if($version == "wml")
	{
 		header("Content-type: text/vnd.wap.wml; charset=utf-8");
 		header("Cache-Control: no-cache");
echo(doctype("Модераторская").'
Логин ['.$line['name'].'] <br />
User-Agent: ['.strtok($line['useragent'], "/").'] <br />
IP: ['.$line['ip'].'] <br />
---<br />
<a href="./?p=25&amp;v=wml&amp;sid='.$sid.'&amp;mode=delm&amp;pid='.$_GET['id'].'&amp;tid='.$_GET['tid'].'">Удалить пост</a><br />
---<br />
Блокировать на : <br />
<select name="time">
<option value="3600">1 час.</option>
<option value="21600">6 час.</option>
<option value="86400">1 день</option>
<option value="604800">1 неделя</option>
<option value="2592000">1 месяц</option>
<option value="ip3600">ip 1 час.</option>
<option value="ip21600">ip 6 час.</option>
<option value="ip86400">ip 1 день</option>
<option value="ip604800">ip 1 неделя</option>
<option value="ip2592000">ip 1 месяц</option>
<option value="ua3600">ua 1 час.</option>
<option value="ua21600">ua 6 час.</option>
<option value="ua86400">ua 1 день</option>
<option value="ua604800">ua 1 неделя</option>
<option value="ua2592000">ua 1 месяц</option>
</select><br />
Причина: <br />
<input type="text" name="mess" /><br />
<anchor>[Блокировать]
<go href="./?p=25&amp;v=wml&amp;sid='.$sid.'&amp;mode=ban" method="post">
<postfield name="time" value="$(time)" />
<postfield name="mess" value="$(mess)" />
<postfield name="ip" value="'.$line['ip'].'" />
<postfield name="who" value="'.$line['name'].'" />
<postfield name="ua" value="'.$line['useragent'].'" />
<postfield name="fid" value="'.$t_info['id_forum'].'" />

</go></anchor><br /><br />
- - - <br />
<a href="./?p=25&amp;mode=adel&amp;v=wml&amp;sid='.$sid.'&amp;id='.username2id($line['name']).'&amp;fid='.$t_info['id_forum'].'">Удалить все от ника за последний час</a><br />
<a href="./?p=5&amp;v=wml&amp;sid='.$sid.'&amp;p='.$_GET['tid'].'">Назад</a>  <br />
<a href="./?p=1&amp;v=wml&amp;sid='.$sid.'">Форумы</a>
</p></card></wml>');
					} elseif($version == "xhtml")
					{
						header("Content-type: text/html; charset=utf-8");
						header("Last-Modified:".gmdate("D, d M Y H:i:s")." GMT");
   header("Cache-Control: no-cache, must-relative");
						echo('<html>
<head>
<title>Модерка</title>
</head>
<body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
<table align="center" border="0" cellspacing="1" cellpadding="5" width="350">
<tr><td align="center" bgcolor="'.$style['title'].'" colspan="2">
<font color="#FFFFFF"><b>Модерка</b></font>
</td></tr>
<tr><td bgcolor="'.$style['bottom'].'" colspan="2">
<a href="./?p=25&amp;v=xhtml&amp;sid='.$sid.'&amp;mode=delm&amp;pid='.$_GET['id'].'&amp;tid='.$line['id_theme'].' " style="background-color: #FF0000; color: #FFFFFF; text-decoration: underline">Удалить пост</a>
</td></tr>
<tr bgcolor="'.$style['text'].'"><td>
Логин:</td><td>['.$line['name'].']</td></tr>
<tr bgcolor="'.$style['text'].'"><td>
User-Agent:</td><td>['.strtok($line['useragent'], "/").']</td></tr>
<tr bgcolor="'.$style['text'].'"><td>
IP: </td><td>['.$line['ip'].'] </td></tr>
<tr bgcolor="'.$style['text'].'"><td>
<form action="./?p=25&amp;v=xhtml&amp;sid='.$sid.'&amp;mode=ban" method="post">
Блокировать на:</td><td>
<select name="time">
<option value="3600">1 час.</option>
<option value="21600">6 час.</option>
<option value="86400">1 день</option>
<option value="604800">1 неделя</option>
<option value="2592000">1 месяц</option>
<option value="ip3600">ip 1 час.</option>
<option value="ip21600">ip 6 час.</option>
<option value="ip86400">ip 1 день</option>
<option value="ip604800">ip 1 неделя</option>
<option value="ip2592000">ip 1 месяц</option>
<option value="ua3600">ua 1 час.</option>
<option value="ua21600">ua 6 час.</option>
<option value="ua86400">ua 1 день</option>
<option value="ua604800">ua 1 неделя</option>
<option value="ua2592000">ua 1 месяц</option>
</select></td></tr>
<tr bgcolor="'.$style['text'].'"><td>
Причина:</td><td>
<input type="text" name="mess" /></td></tr>
<tr bgcolor="'.$style['text'].'"><td align="center" colspan="2">
<input type="submit" value="Блокировать" />
<input type="hidden" name="ua" value="'.$line['useragent'].'" />
<input type="hidden" name="who" value="'.$line['name'].'" />
<input type="hidden" name="ip" value="'.$line['ip'].'" />
<input type="hidden" name="fid" value="'.$t_info['id_forum'].'" />
</form></td></tr>
<tr bgcolor="'.$style['bottom'].'"><td colspan="2">
<a href="./?p=25&amp;mode=adel&amp;v=xhtml&amp;sid='.$sid.'&amp;id='.username2id($line['name']).'&amp;fid='.$t_info['id_forum'].'">Удалить все от ника за последний час</a><br />
<a href="./?p=5&amp;v=xhtml&amp;sid='.$sid.'&amp;p='.$_GET['tid'].'">Назад</a><br />
<a href="./?p=1&amp;v=xhtml&amp;sid='.$sid.'">Форумы</a>
</td></tr></table>
</body></html>');
			  }


	}
}
break;
case 'rename':
	if(!mysql_result(mysql_query("SELECT COUNT(*) FROM `themes` WHERE `id`=".intval($_POST['tid'])), 0))
	{
		header("Location: ".$forumdir.'p=2&v='.$version.'&sid='.$sid.'&f='.$_POST['fid']);
	} else
	{
		mysql_query("UPDATE `themes` SET `tname`='".htmlspecialchars(sql($_POST['rename']))."' WHERE `id`=".intval($_POST['tid']));
		header("Location: ".$forumdir.'p=2&v='.$version.'&sid='.$sid.'&f='.$_POST['fid']);
	}
break;
			case 'renamem':
	if( in_array($status, array('admin')) )
			{		
	if(!mysql_result(mysql_query("SELECT COUNT(*) FROM `mthemes` WHERE `id`=".intval($_POST['tid'])), 0))
	{
		header("Location: ".$forumdir.'p=3&v='.$version.'&sid='.$sid.'&f='.$_POST['fid']);
	} else
	{
		mysql_query("UPDATE `mthemes` SET `tname`='".htmlspecialchars(sql($_POST['rename']))."' WHERE `id`=".intval($_POST['tid']));
		header("Location: ".$forumdir.'p=3&v='.$version.'&sid='.$sid.'&f='.$_POST['fid']);
	}
	}
break;
case 'nf':
if(!mysql_result(mysql_query("SELECT COUNT(*) FROM `themes` WHERE `id`=".intval($_POST['tid'])), 0))
	{
		header("Location: ".$forumdir.'p=2&v='.$version.'&sid='.$sid.'&f='.$_POST['fid']);
	} else
	{
		mysql_query("UPDATE `themes` SET `id_forum`=".intval($_POST['nf'])." WHERE `id`=".intval($_POST['tid']));
		header("Location: ".$forumdir.'p=2&v='.$version.'&sid='.$sid.'&f='.$_POST['fid']);
	}
break;
case 'nfm':
if( in_array($status, array('admin')) )
			{
if(!mysql_result(mysql_query("SELECT COUNT(*) FROM `mthemes` WHERE `id`=".intval($_POST['tid'])), 0))
	{
		header("Location: ".$forumdir.'p=3&v='.$version.'&sid='.$sid.'&f='.$_POST['fid']);
	} else
	{
		mysql_query("UPDATE `mthemes` SET `id_forum`=".intval($_POST['nf'])." WHERE `id`=".intval($_POST['tid']));
		header("Location: ".$forumdir.'p=3&v='.$version.'&sid='.$sid.'&f='.$_POST['fid']);
	}
	}
break;
case 'del':
	if(empty($_GET['pid']))
	{
		if(!mysql_result(mysql_query("SELECT COUNT(*) FROM `themes` WHERE `id`=".intval($_GET['tid'])), 0))
		{
			header("Location: ".$forumdir.'p=2&v='.$version.'&sid='.$sid.'&f='.$_GET['fid']);
		} else
		{
			if($status == "admin"){ $SQL = "DELETE FROM `themes` WHERE `id`=".intval($_GET['tid']);
			$num=mysql_num_rows(mysql_query("DELETE FROM `posts` WHERE `id_theme`=".intval($_GET['tid']))); 
			$cen=$num/10;
			$nameus=mysql_query("SELECT `name` FROM `themes` WHERE `id`=".intval($_GET['tid']));
			$idu=mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `username`='".$nameus."'"));
			mysql_query("UPDATE `wcab` SET `balans`=`balans`-'$cen' WHERE `id_user`=".$idu['id']);
			}
			else { $SQL =  "UPDATE `themes` SET `del`=1, `mdel`='".$username."' WHERE `id`=".intval($_GET['tid']);
			}
		mysql_query($SQL);
		header("Location: ".$forumdir.'p=2&v='.$version.'&sid='.$sid.'&f='.$_GET['fid']);
		}
	} else
	{
		if(!mysql_result(mysql_query("SELECT COUNT(*) FROM `posts` WHERE `id`=".intval($_GET['pid'])), 0))
		{
			header("Location: ".$forumdir.'p=4&v='.$version.'&t='.$_GET['tid'].'&sid='.$sid);
		} else
		{
		$nameus=mysql_query("SELECT `name` FROM `posts` WHERE `id`=".intval($_GET['pid']));
		$idu=mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `username`='".$nameus."'"));
		mysql_query("UPDATE `wcab` SET `balans`=`balans`-'0.1' WHERE `id_user`=".$idu['id']);
		mysql_query("DELETE FROM `posts` WHERE `id`=".intval($_GET['pid']));
		header("Location: ".$forumdir.'p=4&v='.$version.'&t='.$_GET['tid'].'&sid='.$sid);
		}
	}

break;
case 'delm':
if( in_array($status, array('admin')) )
			{
	if(empty($_GET['pid']))
	{
		if(!mysql_result(mysql_query("SELECT COUNT(*) FROM `mthemes` WHERE `id`=".intval($_GET['tid'])), 0))
		{
			header("Location: ".$forumdir.'p=3&v='.$version.'&sid='.$sid.'&f='.$_GET['fid']);
		} else
		{
			if($status == "admin"){ $SQL = "DELETE FROM `mthemes` WHERE `id`=".intval($_GET['tid']);
			mysql_query("DELETE FROM `mposts` WHERE `id_theme`=".intval($_GET['tid'])); }
			else { $SQL =  "UPDATE `mthemes` SET `del`=1, `mdel`='".$username."' WHERE `id`=".intval($_GET['tid']); }
		mysql_query($SQL);
		header("Location: ".$forumdir.'p=3&v='.$version.'&sid='.$sid.'&f='.$_GET['fid']);
		}
	} else
	{
		if(!mysql_result(mysql_query("SELECT COUNT(*) FROM `mposts` WHERE `id`=".intval($_GET['pid'])), 0))
		{
			header("Location: ".$forumdir.'p=5&v='.$version.'&t='.$_GET['tid'].'&sid='.$sid);
		} else
		{
		mysql_query("DELETE FROM `mposts` WHERE `id`=".intval($_GET['pid']));
		header("Location: ".$forumdir.'p=5&v='.$version.'&t='.$_GET['tid'].'&sid='.$sid);
		}
	}
}
break;
case 'bolt':
	if($_GET['b'] == "1")
	{
		mysql_query("UPDATE `themes` SET `pos`=0 WHERE `id`=".intval($_GET['tid']));
		header("Location: ".$forumdir.'p=2&v='.$version.'&sid='.$sid.'&f='.$_GET['fid']);
	} else
	{
		mysql_query("UPDATE `themes` SET `pos`=1 WHERE `id`=".intval($_GET['tid']));
		header("Location: ".$forumdir.'p=2&v='.$version.'&sid='.$sid.'&f='.$_GET['fid']);
	}
break;
case 'boltm':
if( in_array($status, array('admin')) )
			{
	if($_GET['b'] == "1")
	{
		mysql_query("UPDATE `mthemes` SET `pos`=0 WHERE `id`=".intval($_GET['tid']));
		header("Location: ".$forumdir.'p=3&v='.$version.'&sid='.$sid.'&f='.$_GET['fid']);
	} else
	{
		mysql_query("UPDATE `mthemes` SET `pos`=1 WHERE `id`=".intval($_GET['tid']));
		header("Location: ".$forumdir.'p=3&v='.$version.'&sid='.$sid.'&f='.$_GET['fid']);
	}
	}
break;
case 'ban':
	if($_POST['time'] == "ua3600")
	{
		$SQL = "INSERT INTO `ban` VALUES(0, '', '".$_POST['ua']."', '".$_POST['who']."', ".(time() + 3600).", '', '".$username."')";
	} elseif($_POST['time'] == "ua21600")
	{
		$SQL = "INSERT INTO `ban` VALUES(0, '', '".$_POST['ua']."', '".$_POST['who']."', ".(time() + 21600).", '', '".$username."')";
	} elseif($_POST['time'] == "ua86400")
	{
		$SQL = "INSERT INTO `ban` VALUES(0, '', '".$_POST['ua']."', '".$_POST['who']."', ".(time() + 86400).", '', '".$username."')";
	} elseif($_POST['time'] == "ua604800")
	{
		$SQL = "INSERT INTO `ban` VALUES(0, '', '".$_POST['ua']."', '".$_POST['who']."', ".(time() + 604800).", '', '".$username."')";
	} elseif($_POST['time'] == "ua2592000")
	{
		$SQL = "INSERT INTO `ban` VALUES(0, '', '".$_POST['ua']."', '".$_POST['who']."', ".(time() + 2592000).", '', '".$username."')";
	} elseif($_POST['time'] == "ip3600")
	{
		$SQL = $SQL = "INSERT INTO `ban` VALUES(0, '".$_POST['ip']."', '', '".$_POST['who']."', ".(time() + (60 * 60)).", '', '".$username."')";
    } elseif($_POST['time'] == "ip21600")
	{
		$SQL = "INSERT INTO `ban` VALUES(0, '".$_POST['ip']."', '', '".$_POST['who']."', ".(time() + 21600).", '', '".$username."')";
	} elseif($_POST['time'] == "ip86400")
	{
		$SQL = "INSERT INTO `ban` VALUES(0, '".$_POST['ip']."', '', '".$_POST['who']."', ".(time() + 86400).", '', '".$username."')";
	} elseif($_POST['time'] == "ip604800")
	{
		$SQL = "INSERT INTO `ban` VALUES(0, '".$_POST['ip']."', '', '".$_POST['who']."', ".(time() + 604800).", '', '".$username."')";
	} elseif($_POST['time'] == "ip2592000")
	{
		$SQL = "INSERT INTO `ban` VALUES(0, '".$_POST['ip']."', '', '".$_POST['who']."', ".(time() + 2592000).", '', '".$username."')";
	} else
    {
    $SQL = "INSERT INTO `ban` VALUES(0, '', '', '".$_POST['who']."', ".(time() + intval($_POST['time'])).", '".$_POST['mess']."', '".$username."')";
    }
    mysql_query($SQL);
    header("Location: ".$forumdir.'p=2&v='.$version.'&sid='.$sid.'&f='.$_POST['fid']);
 break;

case 'checkbox':

		if(!empty($_GET['fid']) && !empty($_POST['id']))
		{
			mysql_query ( "DELETE FROM `themes` WHERE `id` IN(".implode(", ", array_map("intval", (array)$_POST['id'])).")" );
			mysql_query("DELETE FROM `posts` WHERE `id_theme` IN(".implode(", ", array_map("intval", (array)$_POST['id'])).")" );
			header("Location: ".$forumdir.'p=2&v='.$version.'&sid='.$sid.'&f='.$_GET['fid']);
		} elseif(!empty($_GET['tid']) && !empty($_POST['id']))
		{
			mysql_query( "DELETE FROM `posts` WHERE `id` IN(".implode(", ", array_map("intval", $_POST['id'])).")" );
			header("Location: ".$forumdir.'p=4&v='.$version.'&sid='.$sid.'&t='.$_GET['tid']);
		}
break;
case 'adel':
	$time = (time() - (60 * 60));
	$usern = mysql_fetch_array(mysql_query("SELECT `username` FROM `users` WHERE `id`=".intval($_GET['id'])));
	mysql_query("DELETE FROM `themes` WHERE `name`='".$usern['username']."' AND `time` > '".$time."'");
	mysql_query("DELETE FROM `posts` WHERE `name`='".$usern['username']."' AND `time` > '".$time."'");
	header("Location: ".$forumdir.'p=2&v='.$version.'&sid='.$sid.'&f='.$_GET['fid']);
break;

case 'adelall':
	$usern = mysql_fetch_array(mysql_query("SELECT `username` FROM `users` WHERE `id`=".intval($_GET['id'])));
	mysql_query("DELETE FROM `themes` WHERE `name`='".$usern['username']."'");
	mysql_query("DELETE FROM `posts` WHERE `name`='".$usern['username']."'");
	header("Location: ".$forumdir.'p=2&v='.$version.'&sid='.$sid.'&f='.$_GET['fid']);
break;

case 'whois':
	$ip = $_GET['ip']."\r\n";
	$fp = fsockopen("whois.ripe.net", 43, $errno, $errstr);
    if(!$fp)
    {
    	exit;
    }
	fwrite($fp, $ip."\r\n");

	$info = "";

		while(!feof($fp))
		{
			$info .= fread($fp, 1024);
		}
		fclose($fp);
		if($version == "xhtml")
		{
			header("Content-type: text/html; charset=utf-8");

			echo('<html>
<head>
<title>'.$ip.'</title>
</head>
<body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
<table align="center" border="0" cellspacing="1" cellpadding="5" width="350">
<tr><td align="center" bgcolor="'.$style['title'].'">
<font color="#FFFFFF"><b>'.$ip.'</b></font>
</td></tr>
<tr><td bgcolor="'.$style['bottom'].'"></td></tr>
<tr><td bgcolor="'.$style['text'].'">'.nl2br($info).'</td></tr>
<tr><td bgcolor="'.$style['bottom'].'">
<a href="'.htmlspecialchars($_SERVER['HTTP_REFERER']).'">Назад</a>
</td></tr></table>
</body></html>');
		} elseif($version == "wml")
		{
			header("Content-type: text/vnd.wap.wml; charset=utf-8");
			echo(doctype($ip));
			echo(nl2br($info)."\r\n");
			echo("<anchor>Назад<prev /></anchor>\r\n
			</p></card></wml>");
		}

break;
case 'checkboxm':

		if(!empty($_GET['fid']) && !empty($_POST['id']))
		{
			mysql_query ( "DELETE FROM `mthemes` WHERE `id` IN(".implode(", ", array_map("intval", (array)$_POST['id'])).")" );
			mysql_query("DELETE FROM `mposts` WHERE `id_theme` IN(".implode(", ", array_map("intval", (array)$_POST['id'])).")" );
			header("Location: ".$forumdir.'p=3&v='.$version.'&sid='.$sid.'&f='.$_GET['fid']);
		} elseif(!empty($_GET['tid']) && !empty($_POST['id']))
		{
			mysql_query( "DELETE FROM `mposts` WHERE `id` IN(".implode(", ", array_map("intval", $_POST['id'])).")" );
			header("Location: ".$forumdir.'p=5&v='.$version.'&sid='.$sid.'&t='.$_GET['tid']);
		}
break;

	}
 }




 list($msec,$sec)=explode(chr(32),microtime());
 echO("\r\n<!-- ".round(($sec+$msec)-$headtime,4).' -->');
?>