<?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&v=wml&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&mode=del&sid='.$sid.'&tid='.$id_theme.'&v=wml&fid='.$t_info['id_forum'].'">Удалить тему</a><br />');
if($t_info['pos'] == 1)
{
echo('<a href="./?p=25&mode=bolt&b=1&sid='.$sid.'&tid='.$id_theme.'&v=wml&fid='.$t_info['id_forum'].'">Закрепить тему</a><br />');
} else
{
echo('<a href="./?p=25&mode=bolt&b=0&sid='.$sid.'&tid='.$id_theme.'&v=wml&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&v=wml&sid='.$sid.'&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&v=wml&sid='.$sid.'&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&v=wml&sid='.$sid.'&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&mode=adel&v=wml&sid='.$sid.'&id='.username2id($line['name']).'&fid='.$t_info['id_forum'].'">Удалить все от ника за последний час</a><br />
<a href="./?p=2&v=wml&sid='.$sid.'&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&mode=del&sid='.$sid.'&tid='.$id_theme.'&v=xhtml&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&mode=bolt&b=1&sid='.$sid.'&tid='.$id_theme.'&v=xhtml&fid='.$t_info['id_forum'].'">Закрепить тему</a><br />');
} else
{
echo('<a href="./?p=25&mode=bolt&b=0&sid='.$sid.'&tid='.$id_theme.'&v=xhtml&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&v=xhtml&sid='.$sid.'&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&v=xhtml&sid='.$sid.'&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&v=xhtml&sid='.$sid.'&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&mode=adel&v=xhtml&sid='.$sid.'&id='.username2id($line['name']).'&fid='.$t_info['id_forum'].'">Удалить все от ника за последний час</a><br />
<a href="./?p=2&v=xhtml&sid='.$sid.'&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&v=wml&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&mode=delm&sid='.$sid.'&tid='.$id_theme.'&v=wml&fid='.$t_info['id_forum'].'">Удалить тему</a><br />');
if($t_info['pos'] == 1)
{
echo('<a href="./?p=25&mode=boltm&b=1&sid='.$sid.'&tid='.$id_theme.'&v=wml&fid='.$t_info['id_forum'].'">Закрепить тему</a><br />');
} else
{
echo('<a href="./?p=25&mode=boltm&b=0&sid='.$sid.'&tid='.$id_theme.'&v=wml&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&v=wml&sid='.$sid.'&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&v=wml&sid='.$sid.'&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&v=wml&sid='.$sid.'&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&mode=adel&v=wml&sid='.$sid.'&id='.username2id($line['name']).'&fid='.$t_info['id_forum'].'">Удалить все от ника за последний час</a><br />
<a href="./?p=3&v=wml&sid='.$sid.'&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&mode=delm&sid='.$sid.'&tid='.$id_theme.'&v=xhtml&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&mode=boltm&b=1&sid='.$sid.'&tid='.$id_theme.'&v=xhtml&fid='.$t_info['id_forum'].'">Закрепить тему</a><br />');
} else
{
echo('<a href="./?p=25&mode=boltm&b=0&sid='.$sid.'&tid='.$id_theme.'&v=xhtml&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&v=xhtml&sid='.$sid.'&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&v=xhtml&sid='.$sid.'&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&v=xhtml&sid='.$sid.'&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&mode=adel&v=xhtml&sid='.$sid.'&id='.username2id($line['name']).'&fid='.$t_info['id_forum'].'">Удалить все от ника за последний час</a><br />
<a href="./?p=3&v=xhtml&sid='.$sid.'&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&v=wml&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&v=wml&sid='.$sid.'&mode=del&pid='.$_GET['id'].'&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&v=wml&sid='.$sid.'&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&mode=adel&v=wml&sid='.$sid.'&id='.username2id($line['name']).'&fid='.$t_info['id_forum'].'">Удалить все от ника за последний час</a><br />
<a href="./?p=4&v=wml&sid='.$sid.'&t='.$_GET['tid'].'">Назад</a> <br />
<a href="./?p=0&v=wml&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&v=xhtml&sid='.$sid.'&mode=del&pid='.$_GET['id'].'&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&v=xhtml&sid='.$sid.'&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&mode=adel&v=xhtml&sid='.$sid.'&id='.username2id($line['name']).'&fid='.$t_info['id_forum'].'">Удалить все от ника за последний час</a><br />
<a href="./?p=4&v=xhtml&sid='.$sid.'&t='.$_GET['tid'].'">Назад</a><br />
<a href="./?p=0&v=xhtml&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&v=wml&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&v=wml&sid='.$sid.'&mode=delm&pid='.$_GET['id'].'&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&v=wml&sid='.$sid.'&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&mode=adel&v=wml&sid='.$sid.'&id='.username2id($line['name']).'&fid='.$t_info['id_forum'].'">Удалить все от ника за последний час</a><br />
<a href="./?p=5&v=wml&sid='.$sid.'&p='.$_GET['tid'].'">Назад</a> <br />
<a href="./?p=1&v=wml&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&v=xhtml&sid='.$sid.'&mode=delm&pid='.$_GET['id'].'&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&v=xhtml&sid='.$sid.'&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&mode=adel&v=xhtml&sid='.$sid.'&id='.username2id($line['name']).'&fid='.$t_info['id_forum'].'">Удалить все от ника за последний час</a><br />
<a href="./?p=5&v=xhtml&sid='.$sid.'&p='.$_GET['tid'].'">Назад</a><br />
<a href="./?p=1&v=xhtml&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']);
mysql_query("DELETE FROM `posts` WHERE `id_theme`=".intval($_GET['tid'])); }
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
{
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']."', '', ".(time() + 3600).", '', '".$username."')";
} elseif($_POST['time'] == "ua21600")
{
$SQL = "INSERT INTO `ban` VALUES(0, '', '".$_POST['ua']."', '', ".(time() + 21600).", '', '".$username."')";
} elseif($_POST['time'] == "ua86400")
{
$SQL = "INSERT INTO `ban` VALUES(0, '', '".$_POST['ua']."', '', ".(time() + 86400).", '', '".$username."')";
} elseif($_POST['time'] == "ua604800")
{
$SQL = "INSERT INTO `ban` VALUES(0, '', '".$_POST['ua']."', '', ".(time() + 604800).", '', '".$username."')";
} elseif($_POST['time'] == "ua2592000")
{
$SQL = "INSERT INTO `ban` VALUES(0, '', '".$_POST['ua']."', '', ".(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']."', '', ".(time() + 21600).", '', '".$username."')";
} elseif($_POST['time'] == "ip86400")
{
$SQL = "INSERT INTO `ban` VALUES(0, '', '".$_POST['ip']."', '', ".(time() + 86400).", '', '".$username."')";
} elseif($_POST['time'] == "ip604800")
{
$SQL = "INSERT INTO `ban` VALUES(0, '', '".$_POST['ip']."', '', ".(time() + 604800).", '', '".$username."')";
} elseif($_POST['time'] == "ip2592000")
{
$SQL = "INSERT INTO `ban` VALUES(0, '', '".$_POST['ip']."', '', ".(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 '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).' -->');
?>