<?php
defined('WBCAT') or die('Restricted access');
ob_start();
session_start();
error_reporting(E_ALL & ~E_NOTICE);
define('SKRIPT_DIR', $_SERVER['DOCUMENT_ROOT']);
define('REPUCK_VER', '1.0.3');
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');
}
}
$TINYMCEHTML=array(
'script'=>'<script language="JavaScript" type="text/javascript">
function tag(text1, text2,about){obg=document.getElementById(about);if(!tag_add(obg, text1, text2)){alert(\'Ошибка возможно ваш браузер не поддерживает эту функцию\');}} function tag_add(obj, str1, str2){obj.focus(); if(document.selection) { var s = document.selection.createRange(); if(s.text) { s.text = str1 + s.text + str2; } else { obj.value = obj.value + str1 + str2; } return true; }else if (typeof(obj.selectionStart) == "number") { if (obj.selectionStart != obj.selectionEnd) { var start = obj.selectionStart; var end = obj.selectionEnd; s = obj.value.substr(start,end-start); obj.value = obj.value.substr(0, start) + str1 + s + str2 + obj.value.substr(end); } else { obj.value = obj.value + str1 + str2; } return true; } return false;}
</script>',
'app'=>'<div class="review">
<div>
<a href="javascript:tag(\'[left]\', \'[/left]\',bbcodeid)"><img src="'.$home.'/smileys/bb/left.png" alt="img" title="Выровнять по левой стороне"/></a>
<a href="javascript:tag(\'[center]\', \'[/center]\',bbcodeid)"><img src="'.$home.'/smileys/bb/center.png" alt="img" title="Выровнять по центру"/></a>
<a href="javascript:tag(\'[right]\', \'[/right]\',bbcodeid)"><img src="'.$home.'/smileys/bb/right.png" alt="img" title="Выровнять по правой стороне"/></a>
<a href="javascript:tag(\'[url=http://]\', \'[/url]\',bbcodeid)"><img src="'.$home.'/smileys/bb/l.png" alt="url" title="Ссылка" /></a>
<a href="javascript:tag(\'[b]\', \'[/b]\',bbcodeid)"><img src="'.$home.'/smileys/bb/b.png" alt="b" title="Жирный"/></a>
<a href="javascript:tag(\'[i]\', \'[/i]\',bbcodeid)"><img src="'.$home.'/smileys/bb/i.png" alt="i" title="Наклонный"/></a>
<a href="javascript:tag(\'[u]\', \'[/u]\',bbcodeid)"><img src="'.$home.'/smileys/bb/u.png" alt="u" title="Подчёркнутый"/></a>
<a href="javascript:tag(\'[s]\', \'[/s]\',bbcodeid)"><img src="'.$home.'/smileys/bb/s.png" alt="s" title="Перечёркнутый"/></a>
<a href="javascript:tag(\'[color=#ff0000]\', \'[/color]\',bbcodeid)"><img src="'.$home.'/smileys/bb/re.png" alt="red" title="Красный"/></a>
<a href="javascript:tag(\'[color=#00ff00]\', \'[/color]\',bbcodeid)"><img src="'.$home.'/smileys/bb/gr.png" alt="green" title="Зелёный"/></a>
<a href="javascript:tag(\'[color=#0000ff]\', \'[/color]\',bbcodeid)"><img src="'.$home.'/smileys/bb/bl.png" alt="blue" title="Синий"/></a>
<a href="javascript:tag(\'[img]\', \'[/img]\',bbcodeid)"><img src="'.$home.'/smileys/bb/img.png" alt="img" title="Картинка"/></a>
</div>',
'end'=>'<div>
<a href="javascript:tag(\'\', \' :) \',bbcodeid)"><img src="'.$home.'/smileys/1.gif" alt=":)" title="Улыбка" /></a>
<a href="javascript:tag(\'\', \' :( \',bbcodeid)"><img src="'.$home.'/smileys/2.gif" alt=":(" title="Грустно"/></a>
<a href="javascript:tag(\'\', \' :P \',bbcodeid)"><img src="'.$home.'/smileys/3.gif" alt=":P" title="Подмигивание"/></a>
<a href="javascript:tag(\'\', \' :D \',bbcodeid)"><img src="'.$home.'/smileys/4.gif" alt=":D" title="Смех"/></a>
</div>
</div>');
$counters_and_baners=mysql_result(mysql_query("SELECT `code` FROM `counters` WHERE `id` = '1'"),0,'code');
$baner_top=mysql_result(mysql_query("SELECT `code` FROM `counters` WHERE `id` = '2'"),0,'code');
$baner_down=mysql_result(mysql_query("SELECT `code` FROM `counters` WHERE `id` = '3'"),0,'code');
$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>';
if($baner_top!=""){echo '<div class="title">'.$baner_top.'</div>';}
?>