Файл: rezult.php
Строк: 47
<?
session_start();
include ('inc/db.php');
if (isset($_SESSION['user_id']))
{
$query = "SELECT *
FROM `user`
WHERE `id_user`='{$_SESSION['user_id']}'
LIMIT 1";
$sql = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_assoc($sql);
}
$title = "Результаты";
include ('inc/head.php');
include 'inc/functions.php';
$url = "http://m.championat.ru/results";
$unique_start = '<div id="content">';
$unique_end = '<div id="footer">';
function weather($url, $unique_start, $unique_end) {
$code = file_get_contents($url);
preg_match('/'.preg_quote($unique_start,
'/').'(.*)'.preg_quote($unique_end, '/').'/Us', $code, $match);
return @$match[1];
}
$per = weather($url, $unique_start, $unique_end);
$per = preg_replace('#<h3>#si', '<div class="name">', $per);
$per = preg_replace('#</h3>#si', '</div>', $per);
$per = preg_replace('#<ul class="live-list">#si', '<div class="nulled">', $per);
$per = preg_replace('#<li class="odd">#si', '<div class="links">', $per);
$per = preg_replace('#<li>#si', '<div class="links">', $per);
$per = preg_replace('#</li>#si', '</div>', $per);
$per = preg_replace('#</ul>#si', '</div></div>', $per);
$per = preg_replace('#<p class="section">#si', '<b>', $per);
$per = preg_replace('#<p class="meta">(.*?)</p>#si', '<br/><small>1</small>', $per);
$per = preg_replace('#</p>#si', '</b>', $per);
$per = preg_replace('#<a href="(.*?)">#si', '<font color = "blue">', $per);
$per = preg_replace('#</a>#si', '</font>', $per);
$per = preg_replace('#<span class="score-set">(.*?)</span>#si', '1 ', $per);
?>
<div class="name">Результаты:</div>
<?
echo $per;
?>
<div class="si">
По информации сайта <a href="http://championat.ru">championat.ru</a>
</div>
<div class="name">Навигация:</div>
<div class="links"><a href="index.php">На главную</a></div>
<?
include ('inc/foot.php');
?>