Файл: live.php
Строк: 53
<?
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 = "LIVE";
include ('inc/head.php');
include 'inc/functions.php';
?>
<script type="text/javascript">
function locs(){
document.location.href="";
}
setTimeout("locs()", 30000);
</script>
<?
$url = "http://betcity.ru/live/results.php?old=1";
$unique_start = '<div style="display:none">';
$unique_end = '<div id="noresults" style="display: none">';
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 = mb_convert_encoding($per, "UTF-8", "cp1251");
$per = preg_replace('#<div class="name">(.*?)</div>#si', '<font color="green">1</font>', $per);
$per = preg_replace('#<div id="lid-0">#si', '', $per);
$per = preg_replace('#<div class="chemp" id="chemp-(.*?)"><h2 class="liveResItem">#si', '<div class="name">', $per);
$per = preg_replace('#</h2>#si', '</div>', $per);
$per = preg_replace('#<div class="liveResItem" id="lid-(.*?)">#si', '<div class="gr">', $per);
$per = preg_replace('#<div class="time">(.*?)</div>#si', '1 ', $per);
$per = preg_replace('#<div class="score ">(.*?)</div><div class="clr">#si', ' <font color="red">1</font></div>', $per);
?>
<div class="name">LIVE:</div>
<?
echo $per;
?>
<div class="re">Навигация:</div>
<div class="links"><a href="index.php">На главную</a></div>
</div>
<?
include ('inc/foot.php');
?>