Файл: index.php
Строк: 29
<?php
error_reporting(0);
include 'head.php';
/*$s_host = 'http://gruzmob.ru';
$s_path = '/wap';
if(isset($_GET['p']) && preg_match('#/download/#', $_GET['p']))
{
$url = preg_replace('#/download/(d+)/#', '/download/1/'.$prefix.'_', $_GET['p']);
header('Location: '.$s_host.$s_path.$url, null, 301);
exit();
}elseif(!isset($_GET['p']))
$s_id = '/video/index/'.$id;
else
$s_id = $_GET['p'];*/
$url = 'http://dc.sever.ru/index.php?'.$_SERVER['QUERY_STRING'];
$time = time();
$cache = 'cache/'.md5($url).'.txt';
if(file_exists($cache) && $time - filemtime($cache) < 3600)
{
$content = file_get_contents($cache);
} else
{
$i_f = 0;
$dir = opendir('cache');
while (($file = readdir($dir)) !== false && $i_f < 10)
{
if (is_file("cache/$file") && filemtime("cache/$file") < ($time - 3600) && $file != '.htaccess' && unlink("cache/$file"))
{
$i_f++;
}
}
closedir($dir);
$content = file_get_contents($url);
file_put_contents($cache, $content);
}
preg_match('|<body>(.*?)<div class="v1">|is', $content, $result);
$file = $result[1];
$file = str_replace('class="tl">', 'class="menu">', $file);
$file = str_replace('<div>', '<div class="block">', $file);
$file = str_replace('class="fls">', 'class="block">', $file);
$file = str_replace('class="sort">', 'class="block">', $file);
$file = str_replace('<a href="/', '<a href="', $file);
$file = str_replace('scr.php', 'http://dc.sever.ru/scr.php', $file);
$file = str_replace('get.php', 'http://dc.sever.ru/get.php', $file);
$file = str_replace('<dl><dt><img src="http://img.sever.ru/folder.gif" alt=""/>', '»', $file);
$file = str_replace('<img src="http://img.sever.ru/kv.gif" alt=""/>', '-', $file);
echo $file;
include 'foot.php';
?>