Файл: index.php
Строк: 23
<?
if(isset($_SERVER["QUERY_STRING"])){
$q = "http://kekis.ru".$_SERVER["QUERY_STRING"];
}
else{
$q = "http://kekis.ru";
}
$md5 = md5($q);
if(file_exists("cache/".$md5) && filemtime("cache/".$md5)>time()-3599)
{
$data = file_get_contents("cache/".$md5);
}
else{
$curl = curl_init($q);
curl_setopt ($curl, CURLOPT_USERAGENT, "Оpera Mini/ Nokia5130с-2/2.0 (07.97) Prоfilе/MIDP-2.1 Cоnfigurаtiоn/CLDC-1.1 Opera/9.60 (J2ME/MIDP;Opera Mini/4.2.14912Mod.by.Handler/503; U; en)Prеsto/2.2.0 UNTRUSTED/1.0");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_REFERER, ($_SERVER["HTTP_REFERER"])?$_SERVER["HTTP_REFERER"]:'');
$data = curl_exec($curl);
$data = str_replace(array(chr(13),chr(10)),'',$data);
curl_close($curl);
$data = str_replace('<!doctype html>', '', $data);
$data = str_replace('<html lang=ru>', '', $data);
$data = preg_replace("~<head>(.*)</head>~siU", "", $data);
$data = preg_replace("~<div class="logo">(.*)</div>~iU", "", $data);
$data = preg_replace("~<div class="line"><script(.*)</script></div>~iU", "", $data);
$data = str_replace('<div class="videos_list"><!--TEASER BLOCK START--><div class="ms_block" block_id="18512" place_id="14068"></div><!--TEASER BLOCK END--></div>', '', $data);
$data = str_replace('<div class="videos_list"><!--TEASER BLOCK START--><div class="ms_block" block_id="18511" place_id="14068"></div><!--TEASER BLOCK END--></div>', '', $data);
$data = preg_replace("~<!--TEASER BLOCK START-->(.*)<!--TEASER LOADER END-->~iU", "", $data);
$data = preg_replace("~<div class="search">(.*)</div>~iU", "", $data);
$data = preg_replace("~<div class="block"><a href="/search.html">(.*)</a></div>~iU", "", $data);
$data = preg_replace("~<div class="banners">(.*)</body>~iU", "</body>", $data);
$data = str_replace('href="', 'href="?', $data);
$data = str_replace("href='", "href='?", $data);
$data = preg_replace("~?/get/(.*)~iU", "get.php?l=$1", $data);
$data = str_replace('href="?http:', 'href="http:', $data);
$data = str_replace('<img src="', '<img src="http://kekis.ru', $data);
$data = preg_replace("~<div class="link"><a href="?/porn_search.html">(.*)Поиск порно видео</b></a></div>~iU",'',$data);
$data = preg_replace("~<div class="link"><a href="?/comments/(.*).html"><img src="(.*)" alt="." /> Комментировать видео</a></div>~U","", $data);
if(!empty($data))file_put_contents("cache/".$md5,$data);
}
session_start();
include ("header.php");
echo $data;
include ("footer.php");
?>