Просмотр файла tm/themes.php

Размер файла: 2.46Kb
<?php
/*
mod by denich
*/

$host = "kengu.ru";
$path = '/themes.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: waping.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(.*?)<div style="text-align: left; background-color: #804040">/si','',$file);
$file = str_replace('<span  style=" color: #ffffff">', '',$file);
$file = str_replace('</span>', '',$file);
$file = str_replace('</div>', '<br/>',$file);
$file = str_replace('<div class="center">', '',$file);
$file = str_replace(' style=" color: #0000ff"', '',$file);
$file = str_replace('<span  style=" color: #800000">', '<br/>',$file);
$file = str_replace('<div style="text-align: left; background-color: #804040">', '',$file);
$file = str_replace('<div style="text-align: left; background-color: #EA7409">', '',$file);
$file = preg_replace('/<a href="http:\/\/kengu.ru" style="color: #FFFF5E">На главную<\/a>(.*?)<\/html>/si','',$file);
$file = preg_replace('/Выбор страницы(.*?)<\/form>/si','',$file);
$file = str_replace(' style=" color: #ffff5e"', '',$file);
//$file = str_replace(' Стр.', '<br/>Стр.',$file);
$file = preg_replace('/<form action(.*?)style=\'margin:0px\'>/si','<br/>',$file);
$file = str_replace(' style=" color: #ffff5e"', '',$file);
$file = str_replace('<div>', '<br/>',$file);
$file = str_replace('<img src="old_content', '<img src="http://kengu.ru/old_content',$file);
$file = str_replace('<a href="themes.php?get', '<a href="http://kengu.ru/themes.php?get',$file);
$file = preg_replace('/Назад<\/a><br\/>- - - - - - -<br\/>(.*?)<\/wml>/si','Назад</a><br/><br/><a href="index.php?">Анекдоты</a><br/>',$file);
$file = str_replace('<a href="index.php?', '<a href="index.php?site='.$site.'&amp;tcolor='.$tcolor.'&amp;fcolor='.$fcolor.'&amp;lcolor='.$lcolor.'&amp;',$file);

include '../head.php';

echo $file;

include '../foot.php';
?>