Файл: inc/head.php
Строк: 34
<?php
defined('WBCAT') or die('Restricted access');
ob_start();
session_start();
error_reporting(E_ALL & ~E_NOTICE);
require_once ('config.php');
require_once ('func.php');
require_once ('online.php');
// Проверяем ip-адрес на наличие бана
#############################
if(isset($_SERVER['HTTP_X_REAL_IP'])) {
$ip2 = $_SERVER['HTTP_X_REAL_IP'];
} else {
$ip2 = $_SERVER['REMOTE_ADDR'];
}
$ip2 = ip2int($ip2);
$isset = mysql_query("SELECT COUNT(*) FROM `ban_ip` WHERE `ip`='".$ip2."' LIMIT 1");
if (mysql_result($isset,0) > 0) {
$res = mysql_fetch_array(mysql_query("SELECT `ip`,`reason`,`type`,`url` FROM `ban_ip` WHERE `ip`='".$ip2."' LIMIT 1"));
// Полная блокировка
if ($res['type'] == 1) {
echo 'Ваш ip-адрес забанен ! Причина <br/> '.( !empty($res['reason']) ? $res['reason'] : 'причина не указана' ).' ';
exit;
}
// Редирект по ссылке
if ($res['type'] == 2) {
header("Location: " . $res['url']);
exit;
}
}
#############################
// Проверка переменных id,site
#############################
if ($loc == 'cat') {
if ($id) {
$req = mysql_query("SELECT * FROM `cat` WHERE `id` = '$id' LIMIT 1");
if (mysql_num_rows($req) == 0 ) {
echo 'Категория не найдена';
exit;
}
$title = mysql_result(mysql_query("SELECT `title` FROM `cat` WHERE `id` = '$id'"),0,'title');
}
if ($site) {
$req = mysql_query("SELECT * FROM `sites` WHERE `id` = '$site' LIMIT 1");
if (mysql_num_rows($req) == 0 ) {
echo 'Сайт не найден';
exit;
}
$title = mysql_result(mysql_query("SELECT `name` FROM `sites` WHERE `id` = '$site'"),0,'name');
}
}
#############################
$title = isset($title) ? $title : 'Белый каталог';
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="'.$home.'/themes/'.$set_module['theme'].'/style.css">';
echo '
<title>'.$title.'</title></head>
<html><body>';
echo '<div class="menu">';
echo '<div class="head"><img src="'.$home.'/images/logo.png" alt="logo"/></div>';
?>