Избавляемся от mysql_query.
This commit is contained in:
parent
36473235b0
commit
92d125a914
@ -1,13 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
session_start();
|
||||||
if($_SESSION['uid'] == null) { header("Location: index.php"); }
|
if ($_SESSION['uid'] == null) {
|
||||||
|
header("Location: index.php");
|
||||||
|
}
|
||||||
include("config.php");
|
include("config.php");
|
||||||
include("functions.php");
|
include("functions.php");
|
||||||
|
|
||||||
$start = mysql_fetch_array(mysql_query('SELECT `value` FROM `variables` WHERE `var` = "arena_of_gods" LIMIT 1'));
|
$start = db::c()->query('SELECT `value` FROM `variables` WHERE `var` = "arena_of_gods"')->fetch_assoc();
|
||||||
$is_now = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `aren_of` = 1 AND `win` = 3 ORDER BY `id` DESC LIMIT 1'));
|
$is_now = db::c()->query('SELECT `id` FROM `battle` WHERE `aren_of` = 1 AND `win` = 3 ORDER BY `id` DESC')->fetch_assoc();
|
||||||
$eff = mysql_fetch_array(mysql_query("SELECT `id` FROM `effects` WHERE `owner` = '".$user['id']."' AND (`type` = 11 OR `type` = 12) LIMIT 1"));
|
$eff = db::c()->query('SELECT `id` FROM `effects` WHERE `owner` = ?i AND (`type` = 11 OR `type` = 12)', $user['id'])->fetch_assoc();
|
||||||
$w = mysql_fetch_array(mysql_query('SELECT `value` FROM `variables` WHERE `var` = "arena_win" LIMIT 1'));
|
$w = db::c()->query('SELECT `value` FROM `variables` WHERE `var` = "arena_win"')->fetch_assoc();
|
||||||
$al = aligntype($user['align']);
|
$al = aligntype($user['align']);
|
||||||
|
|
||||||
if ($w['value'] == 1) {
|
if ($w['value'] == 1) {
|
||||||
@ -29,7 +31,7 @@ if(isset($_GET['append'])) {
|
|||||||
if ($user['hp'] > $user['maxhp'] * 0.33) {
|
if ($user['hp'] > $user['maxhp'] * 0.33) {
|
||||||
if ($user['align'] != 4) {
|
if ($user['align'] != 4) {
|
||||||
if ($is_now['time_m'] < (time() + 60 * 60)) {
|
if ($is_now['time_m'] < (time() + 60 * 60)) {
|
||||||
$bot = mysql_fetch_array(mysql_query('SELECT `id` FROM `bots` WHERE `battle` = "'.$is_now['id'].'" AND `prototype` = "10023" LIMIT 1'));
|
$bot = db::c()->query('SELECT `id` FROM `bots` WHERE `battle` = ?i AND `prototype` = 10023', $is_now['id'])->fetch_assoc();
|
||||||
join_arena($user['id'], $is_now['id'], 2, $bot['id']);
|
join_arena($user['id'], $is_now['id'], 2, $bot['id']);
|
||||||
} else {
|
} else {
|
||||||
$error = 'Время истекло ...';
|
$error = 'Время истекло ...';
|
||||||
@ -60,7 +62,7 @@ if(isset($_GET['append'])) {
|
|||||||
if ($user['hp'] > $user['maxhp'] * 0.33) {
|
if ($user['hp'] > $user['maxhp'] * 0.33) {
|
||||||
if ($user['align'] != 4) {
|
if ($user['align'] != 4) {
|
||||||
if ($is_now['time_m'] < (time() + 60 * 60)) {
|
if ($is_now['time_m'] < (time() + 60 * 60)) {
|
||||||
$bot = mysql_fetch_array(mysql_query('SELECT `id` FROM `bots` WHERE `battle` = "'.$is_now['id'].'" AND `prototype` = "10024" LIMIT 1'));
|
$bot = db::c()->query('SELECT `id` FROM `bots` WHERE `battle` = ?i AND `prototype` = 10024', $is_now['id'])->fetch_assoc();
|
||||||
join_arena($user['id'], $is_now['id'], 1, $bot['id']);
|
join_arena($user['id'], $is_now['id'], 1, $bot['id']);
|
||||||
} else {
|
} else {
|
||||||
$error = 'Время истекло ...';
|
$error = 'Время истекло ...';
|
||||||
@ -153,6 +155,7 @@ if(isset($_GET['append'])) {
|
|||||||
padding: 2px;
|
padding: 2px;
|
||||||
zoom: 1;
|
zoom: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.contentContainer {
|
.contentContainer {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
@ -160,23 +163,28 @@ if(isset($_GET['append'])) {
|
|||||||
height: auto;
|
height: auto;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0px;
|
||||||
color: #FFF;
|
color: #FFF;
|
||||||
font-family: verdana;
|
font-family: verdana;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #FFF;
|
color: #FFF;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
a:hover {
|
a:hover {
|
||||||
color: Red;
|
color: Red;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<body>
|
<body>
|
||||||
<center><div><span class="hs">Арена Ангелов</span></div></center>
|
<center>
|
||||||
|
<div><span class="hs">Арена Ангелов</span></div>
|
||||||
|
</center>
|
||||||
|
|
||||||
<div class="contentContainer">
|
<div class="contentContainer">
|
||||||
<div class="buttonContainer">
|
<div class="buttonContainer">
|
||||||
@ -187,20 +195,30 @@ a:hover {
|
|||||||
<div class="credenzaBox" style="background: url('/i/im/u1001573_1407648022.jpg') no-repeat center;">
|
<div class="credenzaBox" style="background: url('/i/im/u1001573_1407648022.jpg') no-repeat center;">
|
||||||
<div class="credenzaItem">
|
<div class="credenzaItem">
|
||||||
<? if (!isset($is_now['id'])) { ?>
|
<? if (!isset($is_now['id'])) { ?>
|
||||||
<div class="credenza-stateCaption"><center><? echo $winers;?>.<br />Следующая битва для 7-21 ур. состоится : <? echo date("d.m.Y H:i", $start['value']);?></center></div>
|
<div class="credenza-stateCaption">
|
||||||
|
<center><? echo $winers; ?>.<br/>Следующая битва для 7-21 ур. состоится
|
||||||
|
: <? echo date("d.m.Y H:i", $start['value']); ?></center>
|
||||||
|
</div>
|
||||||
<? } else { ?>
|
<? } else { ?>
|
||||||
<div class="credenza-stateCaption"><h2><center>Идет сражение [7-21 уровни]</center></h2><br /><a href="/logs.php?log=<?=$is_now['id'];?>" target="_blank" style="text-align: center;">ход боя »»</a></div>
|
<div class="credenza-stateCaption">
|
||||||
|
<h2>
|
||||||
|
<center>Идет сражение [7-21 уровни]</center>
|
||||||
|
</h2>
|
||||||
|
<br/><a href="/logs.php?log=<?= $is_now['id']; ?>" target="_blank" style="text-align: center;">ход
|
||||||
|
боя »»</a></div>
|
||||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left">
|
<td align="left">
|
||||||
<a href="?append=1" style="display: inline;"><img src="/i/im/append_1.png" height="70" /><br />Вмешаться</a>
|
<a href="?append=1" style="display: inline;"><img src="/i/im/append_1.png"
|
||||||
|
height="70"/><br/>Вмешаться</a>
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<img src="/i/im/logo_big2.png"/>
|
<img src="/i/im/logo_big2.png"/>
|
||||||
</td>
|
</td>
|
||||||
<td align="right">
|
<td align="right">
|
||||||
<a href="?append=2" style="display: inline;"><img src="/i/im/append_2.png" height="70" /><br />Вмешаться</a>
|
<a href="?append=2" style="display: inline;"><img src="/i/im/append_2.png"
|
||||||
|
height="70"/><br/>Вмешаться</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -209,6 +227,8 @@ a:hover {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<center><? if($error != '') { echo '<b style=\'color: Red;\'>'.$error.'</b>'; } ?></center>
|
<center><? if ($error != '') {
|
||||||
|
echo '<b style=\'color: Red;\'>' . $error . '</b>';
|
||||||
|
} ?></center>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
x
Reference in New Issue
Block a user