Просмотр файла sdark.mobi/core/head.php

Размер файла: 29.7Kb
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="Keywords" content="сила, тьмы, игра, браузерная,  мобильная, для мобильных, империи, битвы, sdark, mobi, фентези, онлайн, бесплатная, колизей, битвы, походы, кланы, алхимик, монстры, скелеты, оборона, выживания, задания, охота, храм, магазин" />
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
<title><?=$header?></title>
<link rel="stylesheet" href="/style/style.css" type="text/css"/>
<link rel="apple-touch-icon" href="/images/icon/apple-touch-icon.png">
<link rel="icon" href="/favicon.ico" type="image/x-icon"/>
</head>
<body>

<?php
$setgame = mysql_fetch_array(mysql_query("SELECT * from `setgame`"));
$tm = time();
 

if($_SESSION['pumpit_id'] > 0){

$widgets = $pumpit->getWidgets($_SESSION['p_sid']);
echo $widgets['header'];

}

if ($_SESSION['fs_key'] > 0)
{
?>
<span style="text-shadow:none;">
<div style="background:#008BC8;border-bottom:1px solid #335470;border-top:1px solid #8AE6FD;box-shadow:rgba(0,0,0,0.6) 0px 0px 2px 0px;">
<a href="http://m.fotostrana.ru/games" style="background:#009ADD url(/images/fs/bgh_menu.png) repeat-x;display:block;padding:6px 10px;">
<i style="background:url(/images/fs/logo_big.png) no-repeat;height:23px;width:155px;display:block;">
</i>
</a>
</div>
</span>
<?
}

if ($_SESSION['ok_id'] > 0)
{
?>
<a href="http://m.odnoklassniki.ru" id="returnToOK" style="display:block;height:32px;width:32px;margin:0;padding:0;border:0;border-radius:4px;background:url(https://st.mycdn.me/res/i/custom/widget/back2ok2.png) no-repeat 6px 6px #ed812b;"> </a>
<?
}
if ($_SESSION['m_id'] > 0 && ($_SESSION['mobile_spec'] == 'basic' OR $_SESSION['mobile_spec']=='smartphone')){
?>
<style>
.mm-menu {
    background: #168DE2 !important;
    color: white !important;
    font: 18px "Open Sans", arial, sans-serif !important;
    display: block !important;
    height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    text-align: center !important;
}
.mm-menu__item {
    color: white !important;
    display: block;
    text-decoration: none !important;
}
.mm-menu__item.m-left,
.mm-menu__item.m-right {
    font-size: 12px !important;
    line-height: 15px !important;
    padding: 15px 12px 14px !important;
    position: absolute !important;
    top: 0 !important;
}
.mm-menu__item.m-right {
    right: 0 !important;
}
.mm-menu__item.m-left {
    left: 0 !important;
}
.mm-menu__item.m-center {
    padding: 12px 0 0;
}
</style>
<div class="mm-menu">
  <a href="https://r.mail.ru/clr2111156/m.my.mail.ru/apps?ref=mobheader" class="mm-menu__item m-left">Игры</a>
  <span class="mm-menu__item m-center">Мой Мир</span>


  
    
  
  
    <a href="http://my.mail.ru/community/sdark/" class="mm-menu__item m-right">Группа</a>
  
</div>
<?
}
if(isset($user['id'])){
$level = file(H."data/ex.txt");
$exp = trim($level[$user['level']+1]);
$exp_gold = (5 + $user['level'])*100;

if($setgame['obnova'] < 1 || $user['prava'] > 3){
if($user['level'] < 150){
echo"<div class='exp_bar'>
<div class='progress' style='width:".round(100/($exp/($user['exp'])))."%'>
</div>
</div>";

} else {
?>
	<div class='exp_bar'>
	<div class='progress' style='width:0%'>
	</div>
	</div>
<?

}

?>
<div class='head left' >
<span class='normal'>
<font color='BAC1C8'>
<?

$gold = floor($user['gold'] / 100);

if($user['gold'] < 100){
	
echo'<img src="/images/icon/silver.png">'.$user['gold'].'';

} else {
	
echo'<img src="/images/icon/gold.png">'.$gold.'';

}

$hp = $user['max_health'] / 2;
if($user['health'] > $hp){
	
echo' <img src="/images/icon/hp.png">';
} elseif($user['health'] <= $hp && $user['health'] > 0){
	
echo' <img src="/images/icon/hp2.png">';

} else {
	
echo' <img src="/images/icon/hp3.png">';

}

echo''.$user['health'].' ';


$bonusik = mysql_query("SELECT `image` FROM `bonus` WHERE `time` > '".time()."' and `typ`='0' and `usr`='".$user['id']."'");
$avik = mysql_num_rows($bonusik);

if($avik > 0){
	
echo'<div class="float-right">';

While($bonik = mysql_fetch_array($bonusik)){
	
echo'<img src="/images/bonus/'.$bonik['image'].'.png" width="15" height="15">';

}
echo'</div>';
} 

if($setgame['fight']==0  or $setgame['def_bat'] < time()){
	
$recharge = $setgame['def_time']-time();
} else {
$recharge = $setgame['def_bat']-time();
}

if($recharge < 600){
$de = date(''.i.':'.s.'', ''.$recharge.'');
echo' <div class="float-right">
 <img src="/images/icon/dead.png" width="15" height="15"><font color="CDCDCD">'.$de.' </font> </div> ';
}

?>
</div>

<?
$k_new = mysql_result(mysql_query("SELECT COUNT(id) FROM `users_konts` WHERE `id_user` = '".$user['id']."' AND `new_msg`"),0);
if($k_new > 0){
echo'</div><div class="line"></div><div class="news"><a class="news-close" href="?msg_read"></a><a class="news-sms" href="/user/new_mess"><img src="/images/icon/mail.png"> <font color="D2D2D2">Новое сообщение ('.$k_new.')</font></a></div>';
}
if (isset($user) && isset($_GET['news_read'])){
mysql_query("UPDATE `user` set `news_read` = '0' where `id` = '".$user['id']."' ");
header("Location: ?");
} 

$q = mysql_query("SELECT `id` FROM `news` ORDER BY `id` DESC ");
$news = mysql_fetch_array($q);
if ($user['news_read'] == 1){
echo'</div>
<div class="line"></div>
<div class="news">
<a class="news-close" href="?news_read"></a>
<div class="news-sms"><img src="/images/icon/st.png" alt=""><a href="/news/post/'.$news['id'].'/?news_read"><font color="D2D2D2"> Узнайте новости!</font></a>
</div>
</div>';
}

if($user['zvan'] < 8){
	
if($user['zvan']==1){
$zvanbon = 25;	$zvanbon2 = 35;	$master = 100;	$zadan = 70;	$par = 1000;	$wins = 300;	$duel = 7;	$kol = 30;	$max_uron = 2500;
}

if($user['zvan'] == 2){
$zvanbon = 35;	$zvanbon2 = 70;	$master = 700;	$zadan = 200;	$par = 4000;	$wins = 1500;	$duel = 30;	$kol = 150;	$max_uron = 7000;
}

if($user['zvan']==3){
$zvanbon = 130;	$zvanbon2 = 200;	$master = 1600;	$zadan = 500;	$par = 12000;	$wins = 12000;	$duel = 80;	$kol = 360;	$max_uron = 20000;
}

if($user['zvan']==4){
$zvanbon = 300;	$zvanbon2 = 500;	$master = 3000;	$zadan = 1200;	$par = 20000;	$wins = 60000;	$duel = 200;	$kol = 800;	$max_uron = 35000;
}

if($user['zvan']==5){
$zvanbon = 700;	$zvanbon2 = 1200;	$master = 4700;	$zadan = 3000;	$par = 35000;	$wins = 340000;	$duel = 500;	$kol = 1700;	$max_uron = 50000;
}

if($user['zvan']==6){
$zvanbon = 1800;	$zvanbon2 = 3000;	$master = 6000;	$zadan = 7000;	$par = 55000;	$wins = 960000;	$duel = 900;	$kol = 2500;	$max_uron = 85000;
}

if($user['zvan']==7){
$zvanbon=4000;	$zvanbon2 = 7000;	$master = 10000;	$zadan = 15000;	$par = 80000;	$wins = 2000000;	$duel = 1600;	$kol = 4000;	$max_uron = 140000;
}

if($user['zadan'] >= $zadan){
	$zadan2 = $zadan;
} else {
	$zadan2 = $user['zadan'];
}

if($user['param'] >= $par){
	$par2 = $par;
} else {
	$par2 = $user['param'];
}

if($user['wins'] >= $wins){
	$wins2 = $wins;
} else {
	$wins2 = $user['wins'];
}

if($user['duel'] >= $duel){
	$duel2 = $duel;
} else {
	$duel2 = $user['duel'];
}

if($user['kol'] >= $kol){
	$kol2 = $kol;
} else {
	$kol2 = $user['kol'];
}

if($user['master'] >= $master){
	$master2 = $master;
} else {
	$master2 = $user['master'];
}

if($user['max_uron'] >= $max_uron){
	$max_uron2 = $max_uron;
} else {
	$max_uron2 = $user['max_uron'];
}

$min = $zadan2 + $par2 + $wins2 + $duel2 + $kol2 + $master2 + $max_uron2;
$max = $zadan + $par + $wins + $duel + $kol + $master + $max_uron;
if($min >= $max){
$nextzvanie = $user['zvan']+1;
mysql_query("UPDATE `bonus` set `kol`=`kol`+'".$zvanbon."',  `time` = '".$tm."', `bonus`='+".$zvanbon2." к параметрам', `image`=`image`+'1' where `usr` = '".$user['id']."' and `name`='Бонус звания'");
mysql_query("UPDATE `user` set `sila`=`sila`+'".$zvanbon."',`max_health`=`max_health`+('".$zvanbon."'*'10'),`zashit`=`zashit`+'".$zvanbon."', `zvan` = '".$nextzvanie."' where `id` = '".$user['id']."'");
$_SESSION['message'] = " Звание повышено";
}
}

$req = mysql_query("SELECT `id`,`kto`,`clan` FROM `clan_zayavky` WHERE `kogo` = '".$user['id']."'");
$zayavky = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
$z_clan = mysql_fetch_array(mysql_query("SELECT id,name FROM `clan` WHERE `id`  = '".$zayavky['clan']."'"));
$z_kto = mysql_fetch_array(mysql_query("SELECT prava,id,font,nick FROM `user` WHERE `id`  = '".$zayavky['kto']."'"));
if($avto > 0){
if($z_kto['prava'] == 5){
	$status="<font color='ffc22b'>[A]</font>";
}
if($z_kto['prava'] == 4){
	$status="<font color='ffc22b'>[a]</font>";
}
if($z_kto['prava'] == 3){
	$status="<font color='ffc22b'>[M]</font>";
}
if($z_kto['prava'] == 2){
	$status="<font color='ffc22b'>[m]</font>";
}
echo '</div>
<div class="mini-line"></div>
<div class="foot center">
<table  class="d-grey" width="100%" border="0" cellpadding="0" cellspacing="0" style="padding-top: 5px;">
<tbody>
<tr>
<div class="inpc-ar">
<a  href="/user/'.$z_kto['id'].'/">';
echo online($z_kto['id']);
echo'<font color="'.$z_kto['font'].'">'.$z_kto['nick'].'</font>';
if($z_kto['prava'] > 1){
echo' '.$status.'';
}
echo'</a> приглашает тебя в клан <a href="/clan/'.$z_clan['id'].'/"><img src="/images/main/clan.png">'.$z_clan['name'].'</a>
</div>
<div class="empty2"></div>
<tr>
<td width="40%">
<a class="big-but" href="/clan/zayavka?yes&id='.$zayavky['id'].'">
<div class="imgwrap"><img src="/images/icon/ok.png"></div>Принять</a>
</td>
<td width="40%">
<a class="big-but" href="/clan/zayavka?otkaz&id='.$zayavky['id'].'">
<div class="imgwrap"><img src="/images/icon/error.png"></div>Отказаться</a>
</td>
</tbody>
</table>
</div>
</div>';
}


$rek = mysql_query("SELECT `id`,`kto`,`hiking`,`pohod` FROM `hik_zay` WHERE `kogo` = '".$user['id']."'");
$zavky = mysql_fetch_array($rek);
$avto = mysql_num_rows($rek);
$z_kto = mysql_fetch_array(mysql_query("SELECT `prava`,`id`,`font`,`nick` FROM `user` WHERE `id`  = '".$zavky['kto']."'"));
if($avto > 0){
if($z_kto['prava'] == 5){
	$status="<font color='ffc22b'>[A]</font>";
}
if($z_kto['prava'] == 4){
	$status="<font color='ffc22b'>[a]</font>";
}
if($z_kto['prava'] == 3){
	$status="<font color='ffc22b'>[M]</font>";
}
if($z_kto['prava'] == 2){
	$status="<font color='ffc22b'>[m]</font>";
}
echo "</div><div class='mini-line'></div><div class='foot center'><table  class='d-grey' width='100%' border='0' cellpadding='0' cellspacing='0' style='padding-top: 5px;'>
<tbody>
<tr>";
echo '<div class="inpc-ar"><a  href="/user/'.$z_kto['id'].'/">';
echo online($z_kto['id']);
echo'<font color="'.$z_kto['font'].'">'.$z_kto['nick'].'</font>';
if($z_kto['prava'] > 1){
echo' '.$status.'';
}
if($zavky['pohod']==1){
	$namep = 'gates-of-Fornost'; 
	$nazvc = 'Врата Форноста';
	}
if($zavky['pohod']==2){
	$namep = 'land-of-death';
	$nazvc = 'Долина Смерти';
	}
if($zavky['pohod']==3){
	$namep = 'lair-of-the-Werewolf';
	$nazvc = 'Логово Оборотней';
	}
if($zavky['pohod']==4){
	$namep = 'ghost-trail';
	$nazvc = 'Тропа Призраков';
	}
if($zavky['pohod']==5){
	$namep = 'snake-marsh';
	$nazvc = 'Змеиное Болото';
	}
if($zavky['pohod']==6){
	$namep = 'abode-dragons';
	$nazvc = 'Обитель Драконов';
	}
echo'</a> приглашает тебя в команду <a href="/hiking/'.$namep.'/team?id='.$zavky['hiking'].'">'.$nazvc.'</a>
</div>
<div class="empty2"></div>
<tr>
<td width="40%">
<a class="big-but" href="/hiking/'.$namep.'/join?id='.$zavky['hiking'].'"><div class="imgwrap"><img src="/images/icon/ok.png"></div>Принять</a>
</td>
<td width="40%">
<a class="big-but" href="/hiking/cancel?id='.$zavky['id'].'"><div class="imgwrap"><img src="/images/icon/error.png"></div>Отказаться</a>
</td>
</tbody>
</table>
</div>
</div>';
} 

$colis = mysql_query("SELECT `timer` FROM `coliseum` WHERE `usr` = '".$user['id']."' and `status`='1' and `fight`='0'");
$coli = mysql_fetch_array($colis);
$coll = mysql_num_rows($colis);
if($coll > 0 and $user['mesto']!='Бой' and $user['battle']==0){
echo "</div>
<div class='mini-line'></div>
<div class='foot center'>
<table width='100%' border='0' cellpadding='2px' cellspacing='0' style='padding-top: 5px;'>
<tbody>
<tr>";
$do = $coli['timer']-time();
if($do > 0){
echo'<div class="inpc-ar">
Бой начнется через '.$do.' сек.
</div>
<tr>';
} else {
echo'<div class="inpc-ar">
Скорее в бой, бой начался!
</div>
<tr>';
}
if($coli['timer'] > $tm){
echo'<td width="40%">
<a class="mini-fight" href="?">Обновить</a>
</td>
</tbody>
</table>
</div>
</div>';
} else {
echo'<td width="40%">
<a class="mini-fight" href="/coliseum/fight">В бой</a>
</td>
</tbody>
</table>
</div>
</div>';
}
}
$offen = mysql_query("SELECT * FROM `offen` WHERE `clan` = '".$user['clan']."' and (`status1`='1' || `status2`='1')");
$ofn = mysql_fetch_array($offen);
$ofi = mysql_num_rows($offen);
if($ofi > 0 and $user['mesto']!='Бой' and $user['battle']==0){
echo "</div>
<div class='mini-line'></div>
<div class='foot center'>
<table width='100%' border='0' cellpadding='2px' cellspacing='0' style='padding-top: 5px;'>
<tbody>
<tr>";
if($ofn['status1'] == 1){$obat = 'servants';} else {$obat = 'serpent';}
echo'<div class="inpc-ar">
Скорее в бой, идёт наступление!
</div>
<tr>
<td width="40%">
	<a class="mini-fight" href="/offensive/'.$obat.'">В бой</a>
	</td>
	</tbody>
	</table>
	</div>
	</div>';
}

$reoa = mysql_query("SELECT `battle`,`kak`,`rating` FROM `coliseum` WHERE `usr` = '".$user['id']."' and `status`='1' and `close`='0' and `kak`!=''");
$coliseu = mysql_fetch_array($reoa);
$reqa = mysql_query("SELECT `id` FROM `coliseum` WHERE `status`='1' and `fight`='1' and `battle`='".$coliseu['battle']."'");
$avto = mysql_num_rows($reqa);
if($avto > 0){
	
$_SESSION['light'] = "<font color='#FE642E'>Битва завершена!</font>
<div class='empty'></div>
<span class='blue'>Рейтинг:</span> <img src='/images/main/coliseum.png' alt=''/> <font color='CDCDCD'>".$coliseu['kak']."".$coliseu['rating']."</font> </div>";
mysql_query("UPDATE `coliseum` set `close`='1' WHERE `usr`  = '".$user['id']."' and `status`='1' and `battle`='".$coliseu['battle']."'");
if($coliseu['kak']=='+'){
	mysql_query("UPDATE `user` set `kol`=`kol`+'".$coliseu['rating']."' WHERE `id`  = '".$user['id']."'");
}
$ckol = $user['kol'] - $coliseu['rating'];
if($coliseu['kak']=='-' and $ckol >= 0){
mysql_query("UPDATE `user` set `kol`=`kol`-'".$coliseu['rating']."' WHERE `id`  = '".$user['id']."'");
}
if($coliseu['kak']=='-' and $ckol < 0){
mysql_query("UPDATE `user` set `kol`='0' WHERE `id`  = '".$user['id']."'");
}
}

$reqkvb = mysql_query("SELECT `id`,`who`,`timer`,`fight1`,`otm` FROM `duel` WHERE `usr` = '".$user['id']."' and `status`='0'");
$zayavkvb = mysql_fetch_array($reqkvb);
$avtgovb = mysql_num_rows($reqkvb);
if($avtgovb > 0 and $user['mesto']!='Бой' and $zayavkvb['fight1']!='1'){
?>
</div>
<div class='mini-line'></div>
<div class='foot center'>
<table width='100%' border='0' cellpadding='2px' cellspacing='0' style='padding-top: 5px;'>
<tbody>
<tr>
<?
if($zayavkvb['who'] > 0){
$do = $zayavkvb['timer']-time();
if($do > 0){
echo'<div class="inpc-ar">
Заявка принята. Дуэль начнется через '.$do.' сек.
</div>
<tr>';
} else {
echo'<div class="inpc-ar">
Скорее в бой, дуэль началась!
</div>
<tr>';
}
if($zayavkvb['timer'] > $tm){
echo'<td width="40%">
<a class="mini-fight" href="?">Обновить</a>
</td>
</tbody>
</table>
</div>
</div>';
} else {
echo'<td width="40%">
<a class="mini-fight" href="/duel/fight">В бой</a>
</td>
</tbody>
</table>
</div>
</div>';
}
} else {
if($zayavkvb['otm']!='1' and $zayavkvb['timer'] > $tm and $zayavkvb['who']==0){
echo '<div class="inpc-ar">
Заявка принята. Идет поиск противника...  
</div>
</div>
<div class="empty2"></div>
<tr>
<td width="40%">
<a class="fight" href="?"><img src="/images/icon/reload.png">Обновить</a>
</td>';
} else {
echo'<div class="inpc-ar">
Никто не принял вызов, дуэль не состоялась.
</div>
<tr>';
}
echo '<td width="40%">
<a class="fight" href="/duel/zayavka?otm&id='.$zayavkvb['id'].'"><img src="/images/icon/error.png">Отменить</a>
</td>
</tbody>
</table>
</div>
</div>';
}
}

$reqkvkb = mysql_query("SELECT * FROM `duel` WHERE `who` = '".$user['id']."' and `status`='0'");
$reqkvib = mysql_fetch_assoc($reqkvkb);
$avtvb = mysql_num_rows($reqkvkb);
if($avtvb > 0 and $user['mesto']!='Бой' and $reqkvib['fight2']!='1'){
echo "</div>
<div class='mini-line'>
</div>
<div class='foot center'>
<table width='100%' border='0' cellpadding='2px' cellspacing='0' style='padding-top: 5px;'>
<tbody>
<tr>";

if($reqkvib['who'] > 0){
$do = $reqkvib['timer']-time();
if($do > 0){
echo'<div class="inpc-ar">
Заявка принята. Дуэль начнется через '.$do.' сек.
</div>
<tr>';
} else {
echo'<div class="inpc-ar">
Скорее в бой, дуэль началась!
</div>
<tr>';
}

if($reqkvib['timer'] > $tm){
echo'<td width="40%">
<a class="mini-fight" href="?">Обновить</a>
</td>
</tbody>
</table>
</div>
</div>';
} else { 
echo'<td width="40%">
<a class="mini-fight" href="/duel/fight">В бой</a>
</td>
</tbody>
</table>
</div>
</div>';
}
} else {
echo'<div class="inpc-ar">
Вы не успели зайти в бой, дуэль не состоялась!
</div>
<tr>';
echo'<td width="40%">
<a class="fight" href="/"><img src="/images/icon/error.png">Скрыть</a>
</td>
</tbody>
</table>
</div>
</div>';
}
}

if(isset($_GET['hide'])){
mysql_query("UPDATE `user` set `desk` = '0' where `id` = '".$user['id']."'");
header('location: ?'); 
}

$req = mysql_query("SELECT `id` FROM `master` WHERE `usr` = '".$user['id']."' and `status`!='1' and `time`<".time()."");
$avto = mysql_num_rows($req);
if($avto > 0){
?>
</div>
<div class='mini-line'></div>
<div class='foot center'>
<table  class='d-grey' width='100%' border='0' cellpadding='0' cellspacing='0' style='padding-top: 5px;'>
<tbody>
<tr>
<div class="inpc-ar">
 Работа завершена! Вы можете забрать камни.
<td width="40%">
<a class="big-but" href="/master/">
<div class="imgwrap">
<img src="/images/main/master.png"></div>Мастер</a>
</td>
<td width="40%">
<a class="big-but" href="?m_hide">
<div class="imgwrap">
<img src="/images/icon/error.png"></div>Скрыть</a>
</td>
</tbody>
</table>
</div>
</div>
<?
}

$req = mysql_query("SELECT `id` FROM `hunting` WHERE `usr` = '".$user['id']."' and `status`='1' and `close`='0'");
$avto = mysql_num_rows($req);
if($avto > 0){
?>
</div>
<div class='mini-line'></div>
<div class='foot center'>
<table  class='d-grey' width='100%' border='0' cellpadding='3px' cellspacing='0' style='padding-top: 5px;'>
<tbody>
<tr>
<div class="inpc-ar">
 Охота завершена. Вы можете забрать награду!
<td width="40%">
<a class="fight" href="/hunting/"><img src="/images/main/hunting.png"> Охота</a>
</td>
<td width="40%">
<a class="fight" href="?h_hide"><img src="/images/icon/error.png"> Скрыть</a>
</td>
</tbody>
</table>
</div>
</div>
<?
}

if(isset($_GET['h_hide'])){
mysql_query("UPDATE `hunting` set `close` = '1' where `usr` = '".$user['id']."'");
header('location: ?'); 
}

if(isset($_GET['m_hide'])){
mysql_query("UPDATE `master` set `status` = '1' where `usr` = '".$user['id']."'");
header('location: ?');
}
$sear = mysql_query("SELECT `link` FROM `link` WHERE `usr`='".$user['id']."'");
$link = mysql_fetch_array($sear);
$lik = mysql_num_rows($sear);
$hnk = mysql_result(mysql_query("SELECT COUNT(id) FROM `hiking` where (`lider`='".$user['id']."' || `usr1`='".$user['id']."' || `usr2`='".$user['id']."' || `usr3`='".$user['id']."') and `fight`='1'"),0);
if($lik > 0 && $user['battle']==1 && $user['mesto']!='Бой' && $hnk==0){
echo'</div>
<div class="line"></div>
<div class="but-list-light">
<a href="'.$link['link'].'"><img src="/images/icon/r.png"> Вернуться в бой</a>
</div>';
}
$req = mysql_query("SELECT * FROM `hiking` where (`lider`='".$user['id']."' || `usr1`='".$user['id']."' || `usr2`='".$user['id']."' || `usr3`='".$user['id']."')");
$hik = mysql_fetch_array($req);
if($user['mesto']!='Бой' && $hnk > 0 && $hik['status'] < 1){
	
if($hik['name']==1){
	$nbep='gates-of-Fornost';
}
if($hik['name']==2){
	$nbep='land-of-death';
}
if($hik['name']==3){
	$nbep='lair-of-the-Werewolf';
}
if($hik['name']==4){
	$nbep='ghost-trail';
}
if($hik['name']==5){
	$nbep='snake-marsh';
}
if($hik['name']==6){
	$nbep='abode-dragons';
}

echo '<div class="line"></div>
<div class="head">
<a class="fight" href="/hiking/'.$nbep.'/fight"><img src="/images/icon/ok.png"> В бой</a>
<a class="fight" href="/hiking/'.$nbep.'/?exit"><img src="/images/icon/error.png"> Покинуть команду</a>
</div>
</div>
</div>';
}
        
if(isset($_GET['info'])){
$req = mysql_query("SELECT * FROM `task` WHERE `id`='".intval($_GET['id'])."'");
$task = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if($avto > 0){
echo '</div>
<div class="mini-line"></div>
<div class="foot center">
<div class="inpc-ar">
<font color="DADBDC">'.$task['name'].'</font>
</div>
<div class="empty2"></div>
</font>
<div class="ob">
'.smiles($task['info']).'
</div> 
</div>
<hr>
<div class="d-grey center">
'.$task['what'].': <img src="/images/icon/task/'.$task['img'].'.png">'.$task['kol'].'';
if(!empty($task['what2']) and $task['task']!=36 and $task['task']!=37 and $task['task']!=44){
	echo'</br>
	'.$task['what2'].': <img src="/images/icon/task/'.$task['img2'].'.png">'.$task['kol2'].' ';
	}
if($task['task']==36){
	echo"</br>
	Умение: <img src='/images/umen/healing.png' height='16' width='16'> Исцеление";
}
if($task['task']==37){
	echo"</br>
	Умение: <img src='/images/umen/gift_of_the_Gods.png' height='16' width='16'> Дар Богов";
}
if($task['task']==44){
	echo"</br>
<img src='/images/chests/1.png' height='20' width='20'> Старый Ящик";
}

?>
</div>
<hr>
<div class="foot center">
<div class='empty2'></div>
<table  class='d-grey' width='100%' border='0' cellpadding='0' cellspacing='0' style='padding-top: 5px;'>
<tbody>
<tr>
<?
echo '<td width="40%">
<a class="big-but" href="/task/taken?id='.$task['id'].'">
<div class="imgwrap"><img src="/images/icon/ok.png"></div>Взять задание</a>
</td>
<td width="40%"><a class="big-but" href="/task/normal">
<div class="imgwrap"><img src="/images/icon/error.png"></div>Скрыть</a>
</td>
</tbody>
</table>
</div>
</div>';
}
}

if(isset($_GET['inf'])){
$req = mysql_query("SELECT * FROM `duel` WHERE `id`='".intval($_GET['id'])."' and `status`='0'");
$sel = mysql_fetch_array($req);
$sels = mysql_num_rows($req);
$kso = mysql_fetch_array(mysql_query("SELECT `mesto`,`id`,`prava`,`nick`,`font` FROM `user` WHERE `id` = '".$sel['usr']."'"));
$avto = mysql_num_rows($req);
$rhe = mysql_query("SELECT `id` from `duel_zayavky` where (`kogo` = '".$user['id']."' or `usr`='".$user['id']."') and `agree`='1' and `status`='0'");
$khl = mysql_num_rows($rhe);
if($khl > 0){
	header('Location: /duel/'); $_SESSION['err']='Заявка на дуэль уже создана';
}

$re = mysql_query("SELECT `id` from `duel_zayavky` where `usr` = '".$user['id']."'");
$kl = mysql_num_rows($re);
if($kl > 0){
	header('Location: /duel/'); $err='Заявка на дуэль уже создана';
}

$rne = mysql_query("SELECT `id` from `duel` where `usr` = '".$user['id']."' and `status`='0'");
$knl = mysql_num_rows($rne);
if($knl > 0){
	header('Location: /duel/'); $err='Заявка на дуэль уже создана';
}
	
if($sels==0 or $sel['who'] > 0 or $sel['timer'] < $tm or $sel['status'] > 0 ){
	header('Location: /duel/'); 
	$_SESSION['err'] ='Дуэль не состоялась';
	}
	
if($sel['min'] > $user['level'] or $sel['max'] < $user['level']){
	header('Location: /duel/'); 
	$err='Не подходит уровень';
}
	
if($kso['mesto']=='Бой'){
	header('Location: /duel/'); 
	$err='Игрок уже в бою'; 
}

if($avto > 0){
echo'</div>
<div class="mini-line"></div>
<div class="foot center">
<div class="inpc-ar">
<font color="DADBDC">Вы уверены, что хотите сразиться с <a  href="/user/'.$sel['usr'].'/">';
echo online($kso['id']);
echo'<font color="'.$kso['font'].'">'.$kso['nick'].'</font>';
if($kso['prava'] > "1"){
	echo' '.$status.'';
}
?>
<font color="DADBDC">? </font></a> 
</div>
<div class="empty2"></div>
<table width='100%' border='0' cellpadding='2px' cellspacing='0' style='padding-top: 5px;'>
<tbody>
<tr>
<?
echo'<td width="40%">
<a class="fight" href="/duel/zayavka?agree&id='.$sel['id'].'"><img src="/images/icon/ok.png"> Принять вызов</a>
</td>
<td width="40%">
<a class="fight" href="/duel/"><img src="/images/icon/error.png">Отменить</a>
</td>
</tbody>
</table>
</div>
</div>';
}
}

$arrt = mysql_query("SELECT * from `at_bat` where `usr` = '$user[id]'");
$att= mysql_num_rows($arrt);
$demi = mysql_fetch_assoc(mysql_query("SELECT * from `attack` where `id` = '1'"));
if($att == 0 && $demi['status'] == 0 && $user['level'] > 4){
echo'</div>
<div class="line"></div>
<div class="foot center">
<font size="2" color="DADBDC">Внимание!!! На мир снова напал Демон! Скорее в бой!!!
</font><div class="empty2"></div>
<img src="/attack/attack.png" width="100%">
<hr> <a class="mini-fight center" href="/attack/"><img src="/images/icon/stat/sila.png"> В бой </a>
</div>
<hr>';
}

$req = mysql_query("SELECT `desk`,`desk_kto` FROM `clan` WHERE `id` = '".$user['clan']."' ");
$desk = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
$kkto = mysql_fetch_array(mysql_query("SELECT `id`,`prava`,`nick`,`font` FROM `user` WHERE `id` = '".$desk['desk_kto']."'"));
if($avto > 0 and $user['desk']==1){
if($kkto['prava']=="5"){
	$status = "<font color='ffc22b'>[A]</font>";
}
if($kkto['prava']=="4"){
	$status = "<font color='ffc22b'>[a]</font>";
}
if($kkto['prava']=="3"){
	$status = "<font color='ffc22b'>[M]</font>";
}
if($kkto['prava']=="2"){
	$status = "<font color='ffc22b'>[m]</font>";
}
echo"</div>
<div class='mini-line'></div>
<div class='foot center'>";
echo'<div class="ob">
<font size="2">
<font color="DADBDC">Объявление от
</font>
<a href="/user/'.$kkto['id'].'/">';
echo online($kkto['id']);
echo'<font color="'.$kkto['font'].'">'.$kkto['nick'].'</font>';
if($kkto['prava']>"1"){
	echo' '.$status.''; 
}
echo'</a> </font> 
</br> '.smiles($desk['desk']).'
</div>
<div class="empty2"></div>
<table class="d-grey" width="100%" border="0" cellpadding="0" cellspacing="0" style="padding-top: 5px;">
<tbody>
<tr>
<td width="40%">
<a class="big-but" href="/clan/'.$user['clan'].'/?hide"><div class="imgwrap"><img src="/images/main/clan.png"></div>Перейти в клан</a>
</td>
<td width="40%">
<a class="big-but" href="?hide"><div class="imgwrap"><img src="/images/icon/error.png"></div>Скрыть объявление</a>
</td>
</tbody>
</table>
</div>
</div>';
}
}
}
 
if(isset($user['id'])){
	
if(isset($_SESSION['light'])){
echo '</div>
<div class="mini-line"></div>
<div class="block_light center">
'.$_SESSION['light'].'
</div>';
$_SESSION['light']=NULL;
}

if($user['exp'] >= $exp and $user['level'] < 150){

mysql_query("update `user` set `level` = '".($user['level']+1)."', `exp`='0', `gold`='".($user['gold']+$exp_gold)."', `health`='".($user['max_health'])."' where `id` = '".$user['id']."'");
$l=$user['level']+1;
$_SESSION['light'] = "<font color='#FE642E'>Вы получили ".$l." уровень!</font><div class='empty'></div><span class='blue'>Ваша награда:</span> <img src='/images/icon/gold.png' alt=''/> ".($exp_gold/100)." </div>";
header('location: ?');
exit; 
}
}

if(isset($_SESSION['message'])){
	
echo "</div>
<div class='mini-line'></div>
<div class='ok center'>
<div class='empty'></div>
<img src='/images/icon/ok.png'> ".$_SESSION['message']."
<div class='empty'></div>
</div>";
$_SESSION['message']=NULL;
}
if (isset($_SESSION['err'])){
	
echo "</div>
<div class='mini-line'></div>
<div class='error center'>
<img src='/images/icon/error.png'> ".$_SESSION['err']."
</div>";
$_SESSION['err']=NULL;
}



if($setgame['obnova'] < 1 || $user['prava'] > 3){
	
if($_SERVER['PHP_SELF']!='/index.php'){
	
echo '</div>
<div class="line"></div>
<div class="player title">
<font size="3">
'.$header.'
</font>
</div>
<div class="line"></div>';

}
}

if($setgame['fight']==0 and $setgame['def_time'] <= $tm){
mysql_query("UPDATE `setgame` set `fight` = '1', `def_bat`='".$tm."'+'600', `def_time`='".$tm."'+'86400' WHERE `id`='1'");
mysql_query("UPDATE `defense` set `status` = '0', `hp`='15000', `nextud`='".$tm."'");
mysql_query("DELETE FROM `defense` WHERE `name`='Дух смерти'");
}

if($setgame['fight']==1 and $setgame['def_bat'] <= $tm){
mysql_query("DELETE FROM `def_bat`");
mysql_query("UPDATE `setgame` set `fight` = '0' WHERE `id`='1'");
}
/* 

if($setgame['obnova']==1 && $user['prava'] < 3){
?>
</div>
<div class='line'></div>
<div class='temn'>
<center>
<div class='player title'>
<font size='3'> Игра недоступна </font>
</div>
<div class='mini-line'></div>
<center>
<img src='/images/main.jpg' width='100%'>
</center>
</div>
<div class='line'></div>
<div class='foot grey'>
<center>
В данный момент идёт обновление и улучшение игры. 
<br/>
Зайдите позже или обновите страницу через несколько минут.
</center>
</div>
<div class='line'></div>
<div class='but-list'>
<center>
<a href='?'><img src='/images/icon/reload.png' alt='*'/>Обновить</a>
</div>
</font>
</center>
<div class='px'></div>
<div class='menu'>
<div class='center'>
<div style='text-shadow: 0 1px 0 #000;font-size: 12px; color:#757575; text-align: center;padding: 5px;'>
<div class='empty'></div>
<?
 echo"  ".date("H:i:s")." 
 <div class='empty'></div>
 Сила Тьмы © 2015, 16+ 
</div>";
if($_SESSION['pumpit_id'] > 0){
	
require_once(H.'pumpitapi/pumpit-class.php');

$widgets = $pumpit->getWidgets($_SESSION['p_sid']);
echo $widgets['footer'];
}
exit;
}
 */