View file pages/tv.php

File size: 4.35Kb
<?php

/*
TV for wap motor17-18
Автор: SmartMan
E-mail: [email protected]         
Site: http://xsmartos.ru
ICQ: 199426
*/

require_once"../template/start.php";
require_once"../template/regglobals.php";
require_once"../template/config.php";
require_once"../template/functions.php";
require_once"../template/antidos.php";
require_once"../template/cookies.php";
require_once"../template/gzip.php";
require_once"../template/header.php";
require_once"../template/referer.php";
include_once"../themes/$config_themes/index.php";
include_once"../template/isset.php";

$do = isset($_GET["do"]) ? check($_GET["do"]) : "";
$tv = isset($_GET["tv"]) ? check($_GET["tv"]) : "";

echo '<img src="../images/img/partners.gif" alt=""><b>Программа ТВ</b><br />';

switch($do){
default:

echo '<img src="../images/tv/ort.gif" alt="ort" /> <a href="tv.php?do=show&amp;tv=ort&amp;'.SID.'">Первый канал</a><br />';
echo '<img src="../images/tv/rtr.gif" alt="rtr" /> <a href="tv.php?do=show&amp;tv=rtr&amp;'.SID.'">РТР</a><br />';
echo '<img src="../images/tv/tvc.gif" alt="tvc" /> <a href="tv.php?do=show&amp;tv=tvc&amp;'.SID.'">ТВЦ</a><br />';
echo '<img src="../images/tv/ntv.gif" alt="ntv" /> <a href="tv.php?do=show&amp;tv=ntv&amp;'.SID.'">НТВ</a><br />';
echo '<img src="../images/tv/kult.gif" alt="kult" /> <a href="tv.php?do=show&amp;tv=kult&amp;'.SID.'">Культура</a><br />';
echo '<img src="../images/tv/spo.gif" alt="spo" /> <a href="tv.php?do=show&amp;tv=sport&amp;'.SID.'">Спорт</a><br />';
echo '<img src="../images/tv/sts.gif" alt="sts" /> <a href="tv.php?do=show&amp;tv=cts&amp;'.SID.'">СТС</a><br />';
echo '<img src="../images/tv/tnt.gif" alt="tnt" /> <a href="tv.php?do=show&amp;tv=tnt&amp;'.SID.'">ТНТ</a><br />';
echo '<img src="../images/tv/ren.gif" alt="ren" /> <a href="tv.php?do=show&amp;tv=rentv&amp;'.SID.'">Рен-ТВ</a><br />';
echo '<img src="../images/tv/tv3.gif" alt="tv3" /> <a href="tv.php?do=show&amp;tv=tv3&amp;'.SID.'">ТВ-3</a><br />';
echo '<img src="../images/tv/7tv.gif" alt="7tv" /> <a href="tv.php?do=show&amp;tv=7tv&amp;'.SID.'">7-ТВ</a><br />';
echo '<img src="../images/tv/domashnii.gif" alt="domashnii" /> <a href="tv.php?do=show&amp;tv=dom&amp;'.SID.'">Домашний</a><br />';
echo '<img src="../images/tv/zvezda.gif" alt="zvezda" /> <a href="tv.php?do=show&amp;tv=zvezda&amp;'.SID.'">Звезда</a><br />';
echo '<img src="../images/tv/dar.gif" alt="dar" /> <a href="tv.php?do=show&amp;tv=dar&amp;'.SID.'">Дарьял ТВ</a><br />';
echo '<img src="../images/tv/mtv.gif" alt="mtv" /> <a href="tv.php?do=show&amp;tv=mtv&amp;'.SID.'">MTV</a><br />';
echo '<img src="../images/tv/muztv.gif" alt="muztv" /> <a href="tv.php?do=show&amp;tv=muztv&amp;'.SID.'">Муз-ТВ</a><br />';

break;

case ("show"):
if($tv){
error_reporting(0);
$host = "wapos.ru";
$path = "/tvprogs/$tv.wml?$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: xsmartos.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('.wml', '.php',$file);
$file = str_replace('index.php', 'tv.php',$file);
$file = str_replace('Java-&#x043A;a&#x0442;a&#x043B;o&#x0433; &#x0437;a&#x0433;p&#x0443;&#x0437;o&#x043A;!', '',$file);
$file = str_replace('X&#x0418;T! &#x0414;&#x0443;pa&#x043A; &#x043D;a pa&#x0437;&#x0434;e&#x0432;a&#x043D;&#x0438;e', '',$file);
$file = str_replace('&#x041D;&#x0430; &#x0433;&#x043B;&#x0430;&#x0432;&#x043D;&#x0443;&#x044E;', '',$file);
$file = str_replace('<a href="http://waplog.net/ru/c.shtml?4102"><img src="http://c.waplog.net/ru/4102.cnt" alt="w" /></a>', '',$file);

echo $file;

} else {
header("Location tv.php?rand=".rand(100,999)."&".SID);}
break;

}

echo '<img src="../images/img/act_home.gif" alt="img" /> <a href="../index.php?'.SID.'">На главную</a><br />';

include_once"../themes/$config_themes/foot.php";
?>