View file tv/index.php

File size: 5.58Kb
<?php

/*
TV for Wap-Motor 19
Автор: SmartMan
E-mail: [email protected]         
Site: http://my60.ru
ICQ: 199426
*/

require_once ("../includes/start.php");
require_once ("../includes/functions.php");
require_once ("../includes/header.php");
include_once ("../themes/".$config['themes']."/index.php");

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

switch($do){
default:

echo '<div><img src="../images/img/partners.gif" alt="img" /><b>TV программа</b></div>';

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

break;

case ("show"):


if($tv){

if($tv=='ort'){$n='Первый канал.ort';}
elseif($tv=='rtr'){$n='РТР.rtr';}
elseif($tv=='tvc'){$n='ТВЦ.tvc';}
elseif($tv=='ntv'){$n='НТВ.ntv';}
elseif($tv=='kult'){$n='Культура.kult';}
elseif($tv=='sport'){$n='Спорт.spo';}
elseif($tv=='ctc'){$n='СТС.sts';}
elseif($tv=='tnt'){$n='ТНТ.tnt';}
elseif($tv=='rentv'){$n='Рен-ТВ.ren';}
elseif($tv=='tv3'){$n='ТВ-3.tv3';}
elseif($tv=='7tv'){$n='7-ТВ.7tv';}
elseif($tv=='dom'){$n='Домашний.domashnii';}
elseif($tv=='zvezda'){$n='Звезда.zvezda';}
elseif($tv=='dar'){$n='Дарьял ТВ.dar';}
elseif($tv=='mtv'){$n='MTV.mtv';
} else { $n='Муз-ТВ.muztv';}

$dt=split("\.",$n);

echo '<div><img src="/images/tv/'.$dt[1].'.gif" alt="img" /> <b>'.$dt[0].' на <span style="color:#BB00BB">'.date("d.m.y").'</span></b></div>';

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: my60.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('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);

$file=str_replace('    <br/>
<br/><br/>
---<br/>
<a href="index.wml">Ka&#x043D;a&#x043B;&#x044B;</a>
<br/>
<a href="../index.wml"></a>
</small>
</p>

<p><br/><br/>

</p>
</card>
</wml>','',$file);

$file=str_replace('<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>','',$file);

$file = preg_replace('#\<card title="(.*?)">
<p>
<a href="http://wap.1124.ru/partner/6577264562/game/,desc,5014"></a>
<br/>
<a href="http://wapos.ru/javakat.wml"></a><br/>
</p>
<p>#si', '', $file);
$file=preg_replace('#\<small>
<b>(.*?)</b>
</small>
</p>
<p>
<small>#si','',$file);
$file=str_replace('<br/>','<br />',$file);

echo '<div>'.$file.'</div>';

echo '<img src="/images/img/back.gif" alt="img" /> <a href="/tv/?'.SID.'">TV программа</a><br />';

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

break;

}

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

include_once ("../themes/".$config['themes']."/foot.php");
?>