Файл: in.php
Строк: 28
<?php
define('MTOP', 1);
require_once('system/connect.php');
require_once('system/core.php');
require_once('system/function.php');
$ban = mysql_query("SELECT * FROM `sait` WHERE `ban` = '1' AND `id` = '".$id."'");
if(mysql_num_rows($ban) != 0){
echo 'Сайт заблокирован.';
exit;
}
if(!$id OR $id < 1){
header('Location: /?zivus');
exit;
}
$isset = mysql_query("SELECT * FROM `sait` WHERE `status` != '0' AND `id` = '".$id."'");
if(mysql_num_rows($isset) == 0){
header('Location: /?zivus');
exit;
}
$page = ceil(mysql_result(mysql_query("SELECT COUNT(*) FROM `sait` WHERE `status` = '1' AND `hosts` > '0' AND `id` = '".$id."'"), 0) / $page_top);
$sait = mysql_fetch_array($isset);
$nakrut = mysql_query("SELECT * FROM `in` WHERE `id_sait` = '".$id."' AND `ip` = '".$ip."'");
if (mysql_num_rows($nakrut) == 0){
mysql_query("INSERT INTO `in` (`id_sait`,`ip`) values('".$id."','".$ip."')");
mysql_query("UPDATE `sait` SET `in` = (`in` + 1), `all_in` = (`all_in` + 1) WHERE `id` = '".$id."'");
}
if($sait['category'] == 4) {
header('Location: /m/category/view/4&zivus&id_site='.$sait['id']);
} elseif($sait['category'] == 14) {
header('Location: /m/category/view/14&zivus&id_site='.$sait['id']);
} else {
header('Location: /?page='.$page.'&zivus&id_site='.$sait['id']);
}
?>