<?php
define('START_TIME', microtime(true));
define('NAME_SITE', 'WAPR.US');
define('URL_SITE', 'http://wapr.us');
ob_start('ob_gzhandler');
echo'<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xml:lang="ru" xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="content-language" content="ru"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<title>Гороскопы на 4 дня</title>
<style type="text/css">
h1{font-size:medium;}
body{font-size:12px;font-family:Arial;color:#555;background-color:#fff;margin:4px auto;max-width:320px;text-align:center;}
img{vertical-align:middle;border:0;}
img.border{margin:3px;padding:1px;border:1px #9db2ce solid;-o-border-radius:4px;-icab-border-radius:4px;-khtml-border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;-o-box-shadow:2px 2px 4px #333;-icab-box-shadow:2px 2px 4px #333;-khtml-box-shadow:2px 2px 4px #333;-moz-box-shadow:2px 2px 4px #333;-webkit-box-shadow:2px 2px 4px #333;box-shadow:2px 2px 4px #333;}
h1.h1{display:block;text-align:center;font:11px verdana;margin:0 2px 0 2px;padding:1px;}
a:link,a:visited{text-decoration:none;color:#408DCE;}
a:active,a:hover,a:focus{color:#900;text-decoration:underline;}
.a,.b{word-wrap:break-word;background-color:#f7f7f7;margin-top:1px;margin-bottom:1px;padding:3px;border:1px solid #6CABD7;border-left:2px solid #6CABD7;border-right:2px solid #6CABD7;border-bottom-color:#6CABD7;border-bottom-width:1px;}
.b{text-align:left;}
.head{border-radius:8px 8px 0px 0px;background-color:#2671BF;height:28px;border:1px solid #6CABD7;}
.head_text{padding:4px;text-shadow:#000 3px 3px 2px;color:#FFF;font-size:16px;font-weight:bold;}
.head_text a:link, .head_text a:visited{color:#CAFDFF;}
.head_text a:active, .head_text a:hover{color:#E53;}
.foot{height:24px;background-color:#385606;border-radius:0px 0px 8px 8px;border:1px solid #6CABD7;padding:2px;color:#ffffff;margin:0 0 1px;}
.foot_text{padding:4px;text-shadow:#000 3px 3px 2px;color:#FFF;font-size:14px;font-weight:bold;}
.foot_text a:link, .foot_text a:visited{color:#CAFDFF;}
.foot_text a:active, .foot_text a:hover{color:#E53;}
.nav{font:bold 11px verdana;border:solid 1px #CDE2FE;padding:0px 2px;margin:1px;background-color:#FFF;}
.nav_act{font:bold 11px verdana;border:solid 1px #CDE2FE;padding:0px 2px;margin:1px;color:#900;background-color:#FFF;}
input,textarea,select{color: #000; background-color: #86B5F5; border: solid 1px #666;padding:2px;margin:2px;}
input:hover,textarea:hover,select:hover{color: #000; background-color: #A6D5FF; border: solid 1px #666;padding:2px;}
</style>
</head><body>
<div class="head"><div class="head_text">
<a href="'.URL_SITE.'">'.NAME_SITE.'</a>
</div></div>';
$arr_title_cat = array('','Общий гороскоп','Бизнес гороскоп','Мобильный гороскоп','Кулинарный гороскоп','Гороскоп здоровья', 'Эротический гороскоп', 'Любовный гороскоп', 'Антигороскоп');
$size_arr_title_cat = sizeof($arr_title_cat);
$arr_zn = array('','Oвeн (21.03-20.04)','Teлeц (21.04-20.05)','Близнeцы (21.05-21.06)','Paк (22.06-22.07)','Лeв (23.07-23.08)','Дeвa (24.08-23.09)','Becы (24.09-23.10)','Cкopпиoн (24.10-22.11)','Cтpeлeц (23.11-21.12)','Koзepoг (22.12-20.01)','Boдoлeй (21.01-20.02)','Pыбы (21.02-20.03)');
function get_xml_horo($cat)
{
$file = 'horo_'.$cat.'.dat';
$url_xml = array('',
'http://img.ignio.com/r/export/utf/xml/daily/com.xml',
'http://img.ignio.com/r/export/utf/xml/daily/bus.xml',
'http://img.ignio.com/r/export/utf/xml/daily/mob.xml',
'http://img.ignio.com/r/export/utf/xml/daily/cook.xml',
'http://img.ignio.com/r/export/utf/xml/daily/hea.xml',
'http://img.ignio.com/r/export/utf/xml/daily/ero.xml',
'http://img.ignio.com/r/export/utf/xml/daily/lov.xml',
'http://img.ignio.com/r/export/utf/xml/daily/anti.xml'
);
$url_xml = $url_xml[$cat];
if(file_exists($file))
{
if((time()-filemtime($file)) >= 43200)
{
$rss = file_get_contents($url_xml);
$fp = fopen($file, "w+");
fwrite($fp, $rss);
fclose($fp);
}
}
else
{
$rss = file_get_contents($url_xml);
$fp = fopen($file, "w+");
fwrite($fp, $rss);
fclose($fp);
chmod($file, 0666);
}
}
if(!$_GET['cat'])
{
for($i=1; $i<$size_arr_title_cat; $i++)
{echo'<div class="b"><a href="index.php?cat='.$i.'">'.$link_icon.''.$arr_title_cat[$i].'</a></div>';}
}
else
{
$cat = intval($_GET['cat']);
if($cat<1 OR $cat>$size_arr_title_cat) {$cat=1;}
if(!$_GET['zn'])
{
for($i=1; $i<=12; $i++)
{echo'<div class="b"><a href="index.php?cat='.$cat.'&zn='.$i.'">'.$link_icon.''.$arr_zn[$i].'</a></div>';}
}
else
{
$zn = intval($_GET['zn']);
if($zn<1 OR $zn>12) {$zn=1;}
$arr_zn_eng = array('','aries','taurus','gemini','cancer','leo','virgo','libra','scorpio','sagittarius','capricorn','aquarius','pisces');
get_xml_horo($cat);
$xml = simplexml_load_file('horo_'.$cat.'.dat');
if($xml === false) {echo'Ошибка!<br/>Повторите запрос позднее.<br/>';}
foreach($xml->xpath('//'.$arr_zn_eng[$zn]) as $horo)
{
$yesterday=$horo->yesterday;
$today=$horo->today;
$tomorrow=$horo->tomorrow;
$tomorrow02=$horo->tomorrow02;
}
foreach($xml->xpath('//date') as $date ) {$date=$date;}
echo'<div class="a"><big>'.$arr_zn[$zn].'</big></div>';
echo'<div class="b"><u>'.$arr_title_cat[$cat].' на '.$date['yesterday'].'</u><br />'.$yesterday.'</div>';
echo'<div class="b"><u>'.$arr_title_cat[$cat].' на '.$date['today'].'</u><br />'.$today.'</div>';
echo'<div class="b"><u>'.$arr_title_cat[$cat].' на '.$date['tomorrow'].'</u><br />'.$tomorrow.'</div>';
echo'<div class="b"><u>'.$arr_title_cat[$cat].' на '.$date['tomorrow02'].'</u><br />'.$tomorrow02.'</div>';
}
}
if($_GET['zn']) {echo'<div class="a">Источник: <a href="http://ignio.com" target="_blank">ignio.com</a></div>';}
echo'<div class="a">';
if($_GET['cat'])
{
echo'<a href="index.php?cat='.$cat.'">К выбору знака</a><br />';
echo'<a href="index.php">Категории</a><br />';
}
echo'<a href="'.URL_SITE.'">На главную</a></div>';
echo'<div class="foot"><div class="foot_text"><b><a href="'.URL_SITE.'">© '.NAME_SITE.'</a></b><small style="float:right;color:#BBB;">'.round((microtime(true) - START_TIME), 4).'</small></div></div>';
echo'</body></html>';
ob_end_flush();
exit;
?>