Файл: waphero.ru/core/head.php
Строк: 83
<?php
echo '<?xml version="1.0" encoding="utf-8"?>';
echo '<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">';
echo '<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">';
echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">';
echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru"><head><title>'.$header.'</title><link rel="stylesheet" href="http://'.$set['site'].'/style/theme/style.css" type="text/css"/><link rel="icon" href="/favicon.ico" type="image/x-icon"/></head><body><div>';
$q_gift = mysql_query("SELECT * FROM `user_podarok` WHERE `user_id` = '$user[id]'");
$gift = mysql_fetch_array($q_gift);
$time = $gift['last_auth'] + 84600;
$now = time();
if(isset($user['id']))
{
$level = file(H."data/exp.txt");
$exp = trim($level[$user[level]+1]);
$exp_gold = (20+(($user['level']-1)*2));
$k_new = mysql_result(mysql_query("SELECT COUNT(*) FROM `users_konts` WHERE `id_user` = '".$user[id]."' AND `new_msg`"),0);
if ($time < $now) {
echo "<div class='menuList'>";
echo "<li><a href='/bonus.php'><img src='/images/icon/gift.png'>Ежедневный подарок</a></li></div>";}
echo"<center><img src='/style/theme/img/logo.png'></center><div class='line'></div>";
echo "<div class='main' style='word-wrap:break-word;'>
<span style='text-shadow:none;'></span>
<div class='head center' onclick='location.href="/index.php"'>
<img src='/images/icon/health.png' alt='hp'/> $user[health] | <img src='/images/icon/mana.png' alt='mp'/> $user[mana]";
if($k_new > 0)echo " | <a href='/user/new_mess.php'><img src='/images/icon/mail.png'></a>";
echo "</div>
<div class='exp_bar'>
<div class='progress' style='width:".round(100/($exp/($user[exp]+1)))."%'></div>
</div>";
}else{
echo"<center><img src='/style/theme/img/logo.png'></center>";
}
if (isset($_SESSION['message'])){
echo "<div class='ok center'><img src='/images/icon/ok.png'> $_SESSION[message]</div>";
$_SESSION['message']=NULL;
}
if (isset($_SESSION['err'])){
echo "<div class='error center'><img src='/images/icon/error.png'> $_SESSION[err]</div>";
$_SESSION['err']=NULL;
}
if ($_SERVER['PHP_SELF']!='/index.php') {
echo "<div class='player title'>$header</div><div class='mini-line'></div>";
}
if(isset($user['id']))
{
if (isset($_SESSION['light'])){
echo "<div class='block_light center'>$_SESSION[light]</div>";
$_SESSION['light']=NULL;
}
if($user['exp'] >= $exp)
{
mysql_query("update `user` set `level` = '".($user['level']+1)."',`exp`='0',`gold`='".($user['gold']+$exp_gold)."',`health`='".($user['max_health'])."',`mana`='".($user['max_mana'])."' where (`id` = '".$user['id']."') LIMIT 1");
header('Location: /index.php');
$_SESSION['light'] = "<span class='quality-4'>Вы получили новый уровень!</span><div class='separ'></div><span class='blue'>Награда:</span> <img src='/images/icon/gold.png' alt=''/> $exp_gold золота";
exit();
}
}
list ( $ms , $s ) = explode ( chr ( 32 ) , microtime ( ) );
$g = $s + $ms;
$manka = mysql_query("SELECT id,mana,max_mana from `user` order by `id` desc");
while($m = mysql_fetch_assoc($manka)){ if($m['mana'] + 1 > $m['max_mana']){
mysql_query("UPDATE `user` set `mana` = '".$m['max_mana']."' where `id` = '".$m['id']."'");
}else{
mysql_query("UPDATE `user` set `mana` = `mana` + '1' where `id` = '".$m['id']."'");
}
}
?>