Файл: public_html/index.php
Строк: 346
<?
include './system/common.php';
include './system/functions.php';
include './system/user.php';
$title = 'Мир Богов';
include './system/h.php';
///News
if(isset($_SESSION['news'])){
echo "";
echo $_SESSION['news'];
echo "";
unset($_SESSION['news']);
}
if($user) {
////Cохра
if(isset($_GET['save_login']) and isset($_GET['save_pass'])){
echo "<div class='block_light center'>";
echo "<b class='dgreen'>Персонаж успешно сохранен!</b><br>Ник: ".$_GET['save_login']."<br>Пароль: ".$_GET['save_pass']."<br>";
echo "<a class='btn' href='?'><span class='end'><span class='label'>Да всё верно</span></span></a>";
echo "</div>";
}
if($mail > 0) {
?>
<div class="menuList">
<li class="center"><a href="/mail/"><img src="/images/icon/mail.png" alt=""><span class="green">Новая почта</span> +<?=$mail;?></a></li>
</div>
<div class="dot-line"></div>
<?
}
if($user[level]>2){
$max = 1;
$q = mysql_query("SELECT * FROM `forum_topic` WHERE `sub` = '1' ORDER BY `id` DESC LIMIT 1");
while($row = mysql_fetch_array($q)) {
if (isset($_GET['nread'])){
if($user['nread'])$nnred = '0';
mysql_query("UPDATE `users` SET `nread` = '".($nnred + $row['id'])."' WHERE `id` = '".$user['id']."'");
header("Location: /");
exit;
}
if (isset($_GET['sread'])){
if($user['nread'])$nnred = '0';
mysql_query("UPDATE `users` SET `nread` = '".($nnred + $row['id'])."' WHERE `id` = '".$user['id']."'");
header("Location: /forum/topic/".$row['id']."/");
exit;
}
if($row['id'] > $user['nread']){
?>
<div class="block_light center">
<span class="dgreen">Новая тема в новостях!</span>
<div class="separ"></div>
<img src="/images/icon/forum_2.png" alt=""> <b><?=$row['name']?></b> <img src="/images/icon/forum_2.png" alt="">
<div class="mb10"></div>
<a class="btn" href="?sread"><span class="end"><span class="label">Посмотреть новость</span></span></a>
<br>
<a href="?nread">Скрыть</a>
</div>
<div class="mini-line"></div>
<?
}
}
$undying = mysql_query('SELECT * FROM `undying` WHERE `start` = "0" LIMIT 1');
$undying = mysql_fetch_array($undying);
$undying_time = round(($undying['time'] - time(600)));
echo '<div class='block_zero center'><img src=''.($undying_time > 600 ? '/images/elka.jpg' alt='*' width=100%/>':'/images/logo/enter.gif' alt='*' width=100%/><center>Долина бессмертных через: <span name='timer'>'._time(($undying[time] - time())).'</span><p><a class='btn' href='/undying/'><span class='end'><span class='label'>Перейти</span></span></a></center>').'';
?>
</div>
<div class="mini-line"></div>
<div class="menuList">
<?
if($user['access'] != 0) echo '<li><center><a href="/adm/"><img src="/images/icon/arena.png" alt="">Админка </a></center></a></li>';
?>
<li><a href="/arena?attack=true"><img src="/images/icon/arena.png" alt="">Арена <?=($user['mp'] > 49 ? '<font color='#30c030'>(+)</font>':'')?></a></li>
<?
if($user['level'] > 1){
?>
<li><a href="/duel/"><img src="/images/icon/league.png" alt="">Дуэли <?=($user['duel_fights'] > 0 ? '<font color='#30c030'>(+)</font>':'')?></a></li>
<li><a href="/turnirs/" class='grey'><img src='/images/icon/lab.png' alt=''/> Турниры</a></li>
<?
}
$cave = mysql_query('SELECT * FROM `cave` WHERE `user` = "'.$user['id'].'"');
$cave = mysql_fetch_array($cave);
?>
<li><a href="/cave/"><img src="/images/icon/cave.png" alt="">Пещера<?=(($cave['dawn'] == 0 OR $cave['dawn'] == 1 && $cave['time'] <= time() OR $cave['dawn'] == 1 && $cave['gather'] == 1 && $cave['time'] <= time()) ? '<span class="green"> (+)</span>':'')?></a></li>
<?php
$q = mysql_query ('select * from `user_q` WHERE (`user`="' . $user['id'] . '") AND (`complete`="0")');
if (mysql_num_rows ($q) != 0) {
while ($user_q = mysql_fetch_array ($q)) {
//
$q_ = mysql_query ('SELECT * FROM `quest` WHERE (`id`="' . $user_q['q'] . '")');
$quest = mysql_fetch_array ($q_);
if ($user_q['c']==$quest['c'])
$sage_flag = true;
}
}
?>
<li><a href='/sage.php/'><img src="/images/icon/quest.png" alt=""> Хижина мудреца <?= ( $sage_flag ? ' <span style="color:#30c030;">(+)</span>':'' ) ?></a></li>
<?
$undying = mysql_query('SELECT * FROM `undying` WHERE `start` = "0" LIMIT 1');
$undying = mysql_fetch_array($undying);
?>
<li><a href="/undying/"><img src="/images/icon/bar.png" alt="">Долина бессмертных
<?
if($undying) {
$undying_time = round(($undying['time'] - time()) / 3600);
if($undying_time > 1) {
?>
<span class="grey"> (< <?=$undying_time?> час<?=($undying_time > 1 ? 'ов':'а')?>)</span>
<?
}
}else{
?>
<span class="grey"> (<?=_time(($undying['time'] - time()))?>)</span>
<?
}
?>
</a></li>
<li><a href="/fights/"><img src="/images/icon/arena.png" alt="">Сражения</a></li>
<li><a href="/coliseum/"><img src="/images/icon/coliseum.png" alt="">Колизей</a></li>
<?
// © Вилы Выкидные, 2016
$camp=mysql_fetch_assoc(mysql_query("SELECT * FROM `campaign` WHERE `id_user`='".$user['id']."' LIMIT 1"));
if($camp['limit']<=time() AND $camp['status']=='4'){
mysql_query("UPDATE `campaign` SET `status`='0', `udar`='9', `kol`='3' WHERE `id_user`='".$user['id']."' LIMIT 1");
}
if($camp){
if($camp['kol'] > 0){
$metka='<span class="green">(+)</span>';
}else{
$metka='';
}
}else{
$metka=FALSE;
}
?>
<li><a href="/campaign/"><img src="/images/icon/farm.png" alt="">Поход <?=$metka?></a></li>
</div>
<div class="mini-line"></div>
<div class="menuList">
<li><a class="dgreen" href="/trade/"><img src="/images/icon/gold.png" alt="">Получить золото</a></li>
<li><a href="/shop/"><img src="/images/icon/equip.png" alt="">Магазин снаряжения</a></li>
<li><a href="/smith/"><img src="/images/icon/smith.png" alt="">Кузница<br>
<span class="white small">Руны, заточка, бонус</span></a></li>
<li><a href="/lab/"><img src="/images/icon/lab.png" alt="">Лаборатория<br>
<span class="white small">Усиления, эликсиры, камень и трава</span></a></li>
<li><a href="/rinok/"><img src="/images/icon/equip.png" alt="">Центр города</a></li>
</div>
<?
}
if($user[level] < 2){
?>
<div class='block_zero center'><img src='/images/main_w.jpg' width='100%' alt=''/><div class='mb5'></div>Сражайся на Арене!</div><div class='mini-line'></div><div class='menuList'><li><a href='/arena/'><img src='/images/icon/arena.png' alt=''/>Арена<span class='green'> (+)</span></a></li><li><a class='grey'><img src='/images/icon/cave.png' alt=''/>Пещера</a></li><li><a class='grey'><img src='/images/icon/quest.png' alt=''/>Хижина мудреца</a></li><li><a class='grey'><img src='/images/icon/arena.png' alt=''/>Сражения</a></li><li><a class='grey'><img src='/images/icon/farm.png' alt=''/>Поход
</a></li></div><div class='mini-line'></div><div class='menuList'><li><a class='grey'><img src='/images/icon/gold.png' alt=''/>Получить золото</a></li><li><a class='grey'><img src='/images/icon/equip.png' alt=''/>Магазин снаряжения</a></li><li><a class='grey'><img src='/images/icon/smith.png' alt=''/>Кузница</a></li><li><a class='grey'><img src='/images/icon/lab.png' alt=''/>Лаборатория</a></li></div></div>
<?
}
?>
<?
if($user[level] < 3){
?>
<?
if($user[level] > 1){
?>
<div class='block_zero center'><img src='/images/main_w.jpg' width='100%' alt=''/><div class='mb5'></div>Побеждай в Дуэлях!</div><div class='mini-line'></div><div class='menuList'><li><a class='grey'><img src='/images/icon/arena.png' alt=''/>Арена</a></li><li><a href='/duel/'><img src='/images/icon/league.png' alt=''/>Дуэли<span class='green'> (+)</span></a></li><li><a class='grey'><img src='/images/icon/cave.png' alt=''/>Пещера</a></li><li><a class='grey'><img src='/images/icon/quest.png' alt=''/>Хижина мудреца</a></li><li><a class='grey'><img src='/images/icon/arena.png' alt=''/>Сражения</a></li><li><a class='grey'><img src='/images/icon/farm.png' alt=''/>Поход</a></li></div><div class='mini-line'></div><div class='menuList'><li><a class='grey'><img src='/images/icon/gold.png' alt=''/>Получить золото</a></li><li><a class='grey'><img src='/images/icon/equip.png' alt=''/>Магазин снаряжения</a></li><li><a class='grey'><img src='/images/icon/smith.png' alt=''/>Кузница</a></li><li><a class='grey'><img src='/images/icon/lab.png' alt=''/>Лаборатория</a></li><li><a href="/clanr.php"><a class='grey'><img src='/images/icon/lab.png' alt=''/>Рейтинг Арены Клана</a></li></div>
<?
}
?>
<?
}
?>
<?
if(isSet($_GET['exit'])) {
setCookie('id', '');
setCookie('password', '');
header('location: /');
}
}else{
$login = _string($_POST['login']);
$login = strToLower($login);
$password = _string($_POST['password']);
if($login && $password) {
$q = mysql_query('SELECT * FROM `users` WHERE `login` = "'.$login.'" AND `password` = "'.$password.'" LIMIT 1');
$user = mysql_fetch_array($q);
if($user) {
setCookie('id', $user['id'], time() + 86400, '/');
setCookie('password', $password, time() + 86400, '/');
header('location: /');
$_SESSION['news'] = '<div class="block_light center">Добро пожаловать в мир титанов<br/> Приятной игры!<img src="/images/smiles/mini_ulibka.gif" alt=""></div>';
}
}
$ref = _string(_num($_GET['ref']));
?>
<div class="center"><img src="/images/logo/bitva_titanov.png" alt="Битва титанов" height="40px"><br><img src='/images/town/hd/main.jpg' width='100%' alt=''/></div>
<div class="block_zero center">
<h1>Сражайся вместе с нами</h1>
<span class="medium">
Впервые на мобильниках. Игра, о которой ходят легенды
<br>
Теперь к легенде можешь прикоснуться и ты!
</span>
<div class="mb10"></div>
<h1 class="yellow">В игре уже <?=n_f(mysql_result(mysql_query('SELECT COUNT(*) FROM `users`'),0))?> игроков!</h1>
</div>
<div class="mini-line" style="margin-top:5px;"></div>
<div class="block_zero center" style="padding-top:15px;"><div class="bigBtn"><a class="btn" href="/start/<?=$ref?>"><span class="end"><span class="label"><span class="green">Начать свой путь</span></span></span></a></div></div>
<div class="separ"></div>
<?
if(isset($_GET['sign_in'])){
?>
<div class="block_zero center" style="padding-bottom:8px;">
<form action="/" method="post">
<div style="margin-bottom:10px;">Имя персонажа:<br>
<input class="text medium-text" name="login" value="" type="text">
<br>Пароль:<br>
<input class="text medium-text" name="password" type="password">
<br>
<span class="btn"><span class="end"><input class="label" value="Войти" type="submit">Войти</span></span>
</div>
<a class="btn" href="/repass/"><span class="end"><span class="label">Забыли пароль?</span></span></a>
</form>
</div>
<?
}else{
?>
<div class="block_zero center" style="padding:12px;"><a class="btn" href="/?sign_in"><span class="end"><span class="label">Войти</span></span></a></div>
<?
}
?>
<div class="mini-line"></div>
<div class="block_zero">
<div class="center"><img src="/images/icon/2hit.png" alt=""> <span class="bold">Об игре</span> <img src="/images/icon/2hit.png" alt=""></div>
<ul>
«Битва титанов» - захватывающая игра, для мобильных телефонов
<br>
Сражения, приключения, общение, любовь - всё это, неотъемлемая часть нашего мира
</ul>
</div>
<?
}
include './system/f.php';
?>