<?php
/*
mod by denich
*/
$host = "fwap.ru";
$path = '/d/index.php?'.$_SERVER['QUERY_STRING'];
$fp = fsockopen($host,80,$errno,$errstr,30);
if(!$fp) echo"$errstr ($errno)<br />\n";
else{
$headers = "GET $path HTTP/1.0\r\n";
$headers .= "Host: $host\r\n";
$headers .= "Accept: *\r\n";
$headers .= "Accept-Charset: UTF-8\r\n";
$headers .= "Accept-Charset: *\r\n";
$headers .= "Accept-Encoding: deflate\r\n";
$headers .= "Accept-Language: ru\r\n";
$headers .= "Referer: fwap.ru\r\n";
$headers .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; ru) Opera 8.01\r\n\r\n";
fwrite($fp,$headers);
while($file != "\r\n") $file = fgets($fp,128);
$file = "";
while(!feof($fp)) $file .= fgets($fp,4096);
fclose($fp);
}
$file = str_replace('<?xml version="1.0" encoding="UTF-8"?>', '',$file);
$file = preg_replace('/<!DOCTYPE(.*?)<dt>/si','',$file);
$file = str_replace('<small>', '',$file);
$file = str_replace('</small>', '',$file);
$file = str_replace('</dt>', '',$file);
$file = str_replace('<dt>', '',$file);
$file = preg_replace('/<\/dl>(.*?)<\/html>/si','',$file);
$file = preg_replace('/<!DOCTYPE(.*?)Загрузки<\/div><div class="body">/si','',$file);
$file = str_replace('<hr/>', '<br/>',$file);
$file = str_replace('<img src="d.gif" alt="D"/> ', '',$file);
$file = preg_replace('/<a href="search\/(.*?)<\/html>/si','',$file);
$file = str_replace('<img src="p.php', '<img src="http://fwap.ru/d/p.php',$file);
$file = str_replace('<a href="/d/', '<a href="http://fwap.ru/d/',$file);
$file = str_replace('<a href="p.php', '<a href="http://fwap.ru/d/p.php',$file);
$file = str_replace('<img src="save.gif" alt="скачать"/> ', '',$file);
$file = preg_replace('/Прямая ссылка:(.*?)<br\/><br\/><br\/>/si','',$file);
$file = preg_replace('/<a href="http:\/\/fwap.ru\/servis\/mp3">(.*?)Сделайте заказ./si','',$file);
$file = str_replace('<a href="http://fwap.ru/servis/i_want/">Cтол заказов</a><br/>', '',$file);
$file = preg_replace('/<br\/><b>Ошибка:<\/b>(.*?)<\/html>/si','',$file);
$file = str_replace('<img src="/d/', '<img src="http://fwap.ru/d/',$file);
$file = str_replace('<a href="jad.php', '<a href="http://fwap.ru/d/jad.php',$file);
$file = str_replace('<img src="vscreen', '<img src="http://fwap.ru/d/vscreen',$file);
$file = str_replace('index.php?', 'index.php?site='.$site.'&fcolor='.$fcolor.'&tcolor='.$tcolor.'&lcolor='.$lcolor.'&',$file);
include '../head.php';
echo $file;
include '../foot.php';
?>