<?php

include_once '../../sys/inc/start.php';
include_once '../../sys/inc/compress.php';
include_once '../../sys/inc/sess.php';
include_once '../../sys/inc/home.php';
include_once '../../sys/inc/settings.php';
include_once '../../sys/inc/db_connect.php';
include_once '../../sys/inc/ipua.php';
include_once '../../sys/inc/fnc.php';
include_once '../../sys/inc/user.php';
    $set['title']='Лучшие анекдоты'; 
    include_once H.'sys/inc/thead.php';
    title().aut();




$textl = 'Результаты матчей';
$rootpath = '../../';
$headmod = 'anekdots';



$host= "gruzok.net";
$path="/anekdots/?".$_SERVER['QUERY_STRING'];
$fp=fsockopen($host,80,$errno, $errstr,10);
if(!$fp) { echo "$errstr ($errno)<br/>\n"; }else{
$data = "";
$post=0; foreach($_POST as $key=>$value){
$post=1; $data.="&$key=$value";} if($data)$data=substr($data,1);
if($post) $headers = "POST $path HTTP/1.0\r\n";else
$headers = "GET $path HTTP/1.0\r\n"; $headers .= "Host: $host\r\n";
$headers .= "Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif,image/x-bitmap, */*;q=0.1\r\n";
$headers .= "Accept-Charset: utf-8;q=0.6 windows-1251;q=0.1*;q=0.1\r\n";
$headers .= "Accept-Encoding: utf-8\r\n";
$headers .= "Accept-Language: ru, en;q=0.9\r\n";
$headers .= "User-Agent: ".$_SERVER['HTTP_USER_AGENT']."\r\n";
if($post){ $headers .= "Content-type: application/x-www-form-urlencoded\r\n";
$headers .= "Content-Length: ".strlen ($data)."\r\n";
$headers .= "\r\n"; $headers .= $data;}else $headers.="\r\n";
@fwrite($fp, $headers); 
$file = ''; 
while($file != "\r\n") 
$file = @fgets($fp, 128);
$file = ''; 
while(!feof($fp)) $file .= @fgets($fp, 4096); 
@fclose($fp); }

//$file = preg_replace('|<!DOC(.*)<div class="menu">|sU','<div class="gmenu">',$file);

$file = str_replace('<div class="block-title-wrap"><div class="block-title-wrap-2"><div class="block-title">','<div>',$file);

$file = str_replace('<div class="block-title-wrap"><div class="block-title-wrap-2"><div class="block-title">','<div>',$file);

$file = str_replace('<div class="item-wrap"><div class="item item-first"><div class="item-marker item-marker-green">','<div>',$file);

$file = str_replace('<div class="separator-wrap"><div class="separator">','',$file);

$file = str_replace('<div class="item-wrap"><div class="item"><div class="item-marker item-marker-green">','<div>',$file);

$file = str_replace('<div class="item-wrap"><div class="item"><div class="item-marker item-marker-grey">','',$file);
$file = str_replace('<br/>','',$file);


$file = str_replace('На главную','',$file);
$file = str_replace('Оценить','',$file);
$file = str_replace('[+]','',$file);
$file = str_replace('[-]','',$file);
$file = str_replace('|','',$file);
$file = str_replace('—','',$file);




$file = str_replace('<br/>','',$file);
$file = str_replace('<br/>','',$file);
$file = str_replace('</div></ul>','</ul></div>',$file);

 $file = preg_replace('|<title>(.*)</title>|ism','', $file);
 $file = preg_replace('|<div class="verx">(.*)</div>|','', $file);
 $file = preg_replace('|<div class="menu">|','<div class="nav1">', $file);
 $file = preg_replace('|<script(.*)</script>|','', $file);
 $file = preg_replace('|<noscript>(.*)</noscript>|','', $file);
 $file = preg_replace('|(.*)<noindex>(.*)([^<]+)|','', $file);
 $file = preg_replace('|(.*)</noindex>(.*)([^<]+)|','', $file);
 $file = preg_replace('|</center>([^<]+)|','', $file);
 $file = preg_replace('|<a class="menu_j" (.*)>(.*)</a>|',' ', $file); 
 $file = preg_replace('|<meta[^>]+>([^<]+)|ism','', $file);
 $file = preg_replace('|([^>]+)<!-- Yandex.Metrika counter -->([^<]+)|','', $file);
 $file = preg_replace('|([^>]+)<!-- /Yandex.Metrika counter -->([^<]+)|','', $file);
 $file = preg_replace('|</div></div>([^<]+)|','', $file);
 $file = preg_replace('|<div class="main">([^<]+)|','', $file);
 $file = preg_replace('|</b></div>([^<]+)|','</b>', $file);
 $file = preg_replace('|</body></html>|','', $file);
 $file = preg_replace('|<!DOCTYPE[^>]+>([^<]+)|ism','', $file);
 $file = preg_replace('|<html[^>]+>([^<]+)|ism','', $file);
 $file = preg_replace('|<head>([^<]+)|ism','', $file);
 $file = preg_replace('|</head>([^<]+)|ism','', $file);
 $file = preg_replace('|<title[^>]+>([^<]+)|ism','', $file);
 $file = preg_replace('|<link[^>]+>([^<]+)|ism','', $file);
 $file = preg_replace('|<body>([^<]+)|ism','', $file);
 $file = preg_replace('|<center>(.*)<div class="(.*)|','', $file);
 $file = preg_replace('|<script[^>]+>([^<]+)</script>|ism','', $file);
 $file = preg_replace('|<div class="foot">(.*)</div>|','', $file);
 $file = preg_replace('|<div class="titles">|','<div class="nav2">', $file);
 $file = preg_replace('|<a rel="nofollow" (.*)>(.*)</a>|','', $file);

$file = preg_replace('|<a href="/anekdots/|','<a href="/services/anekdots/', $file);

$file = preg_replace('|<a href="./index.php?anekdots=|','<a id="l" href="./index.php?anekdots=', $file);
$file = preg_replace('|<a href="./?anekdots=|','<a id="l" href="./?anekdots=', $file);

$file=preg_replace('|</div><a href="http://gruzok.net/anekdots/|', '</div><div class="nav2"><a href="/services/?', $file);
$file=preg_replace('|<a href="http://gruzok.net/anekdots/|', '<a href="/services/?', $file);


echo $file;

 include_once H.'sys/inc/tfoot.php';
?>