File size: 2.24Kb
<?php
define('WBCAT',1);
$title = 'Модерация сайтов';
require_once ('../inc/head.php');
if(!$allow) exit('Доступ закрыт');
##########Обработка сайта##########
if (isset($_GET['do'])) {
if($_GET['do'] == 'add') {
$si = mysql_result(mysql_query("SELECT `id_cat` FROM `sites` WHERE `id`='".intval($_GET['id'])."';"), 0);
mysql_query("UPDATE `cat` SET `count`=(`count`+1) WHERE id='" .$si. "'") or die(mysql_error());
mysql_query("UPDATE `sites` SET `type`='1' WHERE id='" .intval($_GET['id']). "'") or die(mysql_error());
header('Location: '.$home.'/adm/mod_site.php');
}
if($_GET['do'] == 'del') {
mysql_query("DELETE FROM `sites` WHERE id='" .intval($_GET['id']). "';");
header('Location: '.$home.'/adm/mod_site.php');
}
}
##################################
echo '<div class="zag">Модерация сайтов</div>';
$count = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `sites` WHERE type='0'"), 0);
$pager = new pager($count,2,$home.'/adm/mod_site.php?page=');
$result = mysql_query('SELECT * FROM `sites` WHERE `type` = "0" ORDER BY id DESC LIMIT '.$pager->get_start().', '.$pager->on_page.'');
if ($count > 0 ) {
while ($m = mysql_fetch_array($result)){
$ms = mysql_fetch_array(mysql_query("SELECT * FROM `cat` WHERE id='" .$m['id_cat']. "' LIMIT 1;"));
echo '<div class="title">';
echo '<b>Сайт:</b> <a href="http://'.$m['url'].'">'.$m['name'].' </a> [http://'.$m['url'].'][<a href="'.$home.'/cat.php?id='.$ms['id'].'">'.$ms['title'].'</a>]<br/>';
echo '<b>Описание:</b> '.$m['about'].'';
echo '<br/><div class="min"><u>IP</u> : <i>'.int2ip($m['ip']).'</i><br/> <u>USER AGENT</u> : '.$m['browser'].' <br/>
<a href="mod_site.php?do=add&id='.$m['id'].'" class="green">принять</a> <a href="mod_site.php?do=del&id='.$m['id'].'" class="red">отклонить</a>
<a href="ban_site.php?id='.$m['id'].'" class="red">Бан url</a> <a href="ban_ip.php?mod=ban&ip='.int2ip($m['ip']).'" class="red">Бан ip</a></div>';
echo '</div>';
}
echo $pager->print_nav();
}
else {
echo '<div class="title">Сайтов нет</div>';
}
echo '<div class="main"><a href="index.php">Админка</a></div>';
require_once('../inc/foot.php');
?>