<?php
/*
mod by denich
*/
$host = "wapos.ru";
$path = '/lib/b.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: wapos.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('- <a href="http://wapas.ru/lib/index.php">к списку книг</a><br/>', '<br/><a href="index.php">к списку книг</a><br/>',$file);
$file = str_replace('- <a href="http://wapas.ru/clik/jump.php?22">Ha глaвную</a><br/>
-------<br/>', '',$file);
$file = str_replace('- <a href="http://wap2.1124.ru/demo/6577264562/">Демо-игры</a><br/>', '',$file);
$file = str_replace('- <a href="http://wap2.1124.ru/catalog/6577264562/erotic/">Лучшaя Эpoтикa</a><br/>', '',$file);
$file = str_replace('- <a href="http://wap2.1124.ru/partner/6577264562/video/">Bидeo-Kлубничкa</a><br/>', '',$file);
$file = str_replace('<b>wap.wapos.ru</b><br/><br/><br/><br/><br/>', '',$file);
$file = str_replace('<a href="http://waplog.net/ru/c.shtml?57"><img src="http://c.waplog.net/ru/57.cnt" alt="w" /></a>', '',$file);
$file = str_replace('<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"><wml>', '',$file);
$file = str_replace('<card id="WAPContact" title="wapos.ru library">', '',$file);
$file = str_replace('<p>', '',$file);
$file = str_replace('</p>', '',$file);
$file = str_replace('</card>', '',$file);
$file = str_replace('</wml>', '',$file);
$file = str_replace('<small>', '',$file);
$file = str_replace('</small>', '',$file);
$file = str_replace('<?xml version="1.0" encoding="UTF-8"?>', '',$file);
$file = str_replace('<a href="b.php?', '<a href="b.php?site='.$site.'&tcolor='.$tcolor.'&fcolor='.$fcolor.'&lcolor='.$lcolor.'&',$file);
$file = str_replace('<a href="index.php', '<a href="index.php?site='.$site.'&tcolor='.$tcolor.'&fcolor='.$fcolor.'&lcolor='.$lcolor.'',$file);
include '../head.php';
echo $file;
include '../foot.php';
?>