Более строгие ссылки.

This commit is contained in:
Igor Barkov (iwork) 2019-09-24 13:26:08 +03:00
parent 1ec965ad02
commit 9a6f1c8567
2 changed files with 18 additions and 27 deletions

View File

@ -1281,10 +1281,7 @@ if (input::get('edit')) {
</div> </div>
<?php <?php
/* Бонусы за количество статов. # Отображение (только отображение!) бонусов за количество статов.
* TODO Клёвые, но не суммируются никуда...
*
*/
$bonus['fkrit'] = $bonus['fakrit'] = $bonus['fuvorot'] = $bonus['fauvorot'] = $bonus['uminu'] = $bonus['umaxu'] = 0; $bonus['fkrit'] = $bonus['fakrit'] = $bonus['fuvorot'] = $bonus['fauvorot'] = $bonus['uminu'] = $bonus['umaxu'] = 0;
if (($user['sila']) >= 25) { if (($user['sila']) >= 25) {
@ -1373,10 +1370,10 @@ if (input::get('edit')) {
if (in_array(input::get('razdel'), [0, 1, 2, 3, 4, 5])) $_SESSION['razdel'] = input::get('razdel'); if (in_array(input::get('razdel'), [0, 1, 2, 3, 4, 5])) $_SESSION['razdel'] = input::get('razdel');
?> ?>
<table border=0 width=100% cellspacing="0" cellpadding="0" bgcolor="#A5A5A5"> <table class="allzeroes" style="background-color: #a5a5a5;">
<tr> <tr>
<td> <td>
<table border=0 width=100% cellspacing="0" cellpadding="3" bgcolor=#d4d2d2> <table bgcolor=#d4d2d2 class="allzeroes" style="background-color: #d4d2d2;">
<tr> <tr>
<td align=center bgcolor="<?= ($_SESSION['razdel'] == null) ? "#A5A5A6" : "#C7C7C8" ?>"><a <td align=center bgcolor="<?= ($_SESSION['razdel'] == null) ? "#A5A5A6" : "#C7C7C8" ?>"><a
href="?edit=1&razdel=0" ajax="mZeInventory">Амуниция</a></td> href="?edit=1&razdel=0" ajax="mZeInventory">Амуниция</a></td>

View File

@ -10,10 +10,6 @@ if ($user['battle'] != 0) {
die(); die();
} }
$level = filter_input(INPUT_GET, 'level');
$logs = filter_input(INPUT_GET, 'logs');
$tklogs = filter_input(INPUT_GET, 'tklogs');
db::c()->query('LOCK TABLES `bots` WRITE, `battle` WRITE, `logs` WRITE, `users` WRITE, `inventory` WRITE, `zayavka` WRITE, `effects` WRITE, `online` WRITE, `clans` WRITE'); db::c()->query('LOCK TABLES `bots` WRITE, `battle` WRITE, `logs` WRITE, `users` WRITE, `inventory` WRITE, `zayavka` WRITE, `effects` WRITE, `online` WRITE, `clans` WRITE');
if ((input::check('do') == "clear") AND $user['admin'] == 1) { if ((input::check('do') == "clear") AND $user['admin'] == 1) {
@ -638,10 +634,10 @@ if (!empty($_POST['open'])) {
</TR> </TR>
<TR> <TR>
<TD class=m width=40>&nbsp;<B>Бои:</B></TD> <TD class=m width=40>&nbsp;<B>Бои:</B></TD>
<TD class=s><A HREF="?level=fiz&<?= mt_rand() ?>">Физические</A></TD> <TD class=s><A HREF="?fiz">Физические</A></TD>
<TD class=s><A HREF="?level=group&<?= mt_rand() ?>">Групповые</A></TD> <TD class=s><A HREF="?group">Групповые</A></TD>
<TD class=s><A HREF="?level=haos&<?= mt_rand() ?>">Хаотические</A></TD> <TD class=s><A HREF="?haos">Хаотические</A></TD>
<TD class=s><A HREF="?tklogs=1&<?= mt_rand() ?>">Текущие</A> <TD class=s><A HREF="?current">Текущие</A>
</TD> </TD>
</TR> </TR>
</TABLE> </TABLE>
@ -649,13 +645,11 @@ if (!empty($_POST['open'])) {
<TR> <TR>
<TD valign=top> <TD valign=top>
<?php <?php
if (!in_array($user['room'], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 16, 19]) AND empty($tklogs)) die(err('В этой комнате невозможно подавать заявки!')); $get = urldecode(filter_input(INPUT_SERVER, 'QUERY_STRING'));
if ($user['room'] != 1 AND $get != 'current') die(err('В этой комнате невозможно подавать заявки!'));
if (!$get) echo '<p style="text-align: center; font-weight: bold; margin-top: 16px;">Выберите раздел</p>';
if (!$level && !$tklogs && !$logs) { if ($get == 'fiz') {
echo "<BR><BR><BR><CENTER><B>Выберите раздел</b></CENTER>";
}
if ($level == 'fiz') {
echo "<font color=red><b>"; echo "<font color=red><b>";
if (!empty($_POST['open'])) { if (!empty($_POST['open'])) {
if ($_POST['k'] == 6) { if ($_POST['k'] == 6) {
@ -664,7 +658,7 @@ if (!empty($_POST['open'])) {
$blood = 0; $blood = 0;
} }
echo $zay->addzayavka(0, $_POST['timeout'], 1, 1, $_POST['k'], $user['level'], 1, $user['level'], 21, '', $user['id'], 2, 0, $blood); echo $zay->addzayavka(0, $_POST['timeout'], 1, 1, $_POST['k'], $user['level'], 1, $user['level'], 21, '', $user['id'], 2, 0, $blood);
die("<script>document.location='zayavka.php?level=fiz';</script>"); die("<script>document.location='zayavka.php?fiz';</script>");
} }
if (!empty($_POST['back'])) { if (!empty($_POST['back'])) {
unlink("/tmp/zayavka/" . $user['id'] . ".txt"); unlink("/tmp/zayavka/" . $user['id'] . ".txt");
@ -709,7 +703,7 @@ if (!empty($_POST['open'])) {
$timeFigth = fread($f, filesize($Path)); $timeFigth = fread($f, filesize($Path));
fclose($f); fclose($f);
if ($timeFigth < time() && ($user['level'] <= 14)) { if ($timeFigth < time() && ($user['level'] <= 14)) {
if ($_GET['trainstart'] == 1 && $user['hp'] > $user['maxhp'] * 0.33 && ($user['level'] <= 7 || $user['align'] == 2.99)) { if ($get == 'trainstart' && $user['hp'] > $user['maxhp'] * 0.33 && ($user['level'] <= 7 || $user['admin'] == 1)) {
unlink("/tmp/zayavka/" . $user['id'] . ".txt"); unlink("/tmp/zayavka/" . $user['id'] . ".txt");
$zay->delzayavka($user['id'], $user['zayavka'], 2, 0); $zay->delzayavka($user['id'], $user['zayavka'], 2, 0);
@ -739,8 +733,8 @@ if (!empty($_POST['open'])) {
$timeFigth = fread($f, filesize($Path)); $timeFigth = fread($f, filesize($Path));
fclose($f); fclose($f);
if ($user['level'] < 7 || $user['align'] == 2.99) { if ($user['level'] < 7 || $user['admin'] == 1) {
echo " или <input type=button onclick=\"location.href='zayavka.php?level=fiz&trainstart=1';\" value=\"Начать тренировочный бой\">"; echo " или <input type=button onclick=\"location.href='zayavka.php?trainstart';\" value=\"Начать тренировочный бой\">";
} }
} }
@ -760,7 +754,7 @@ if (!empty($_POST['open'])) {
echo '<INPUT TYPE=submit value="Принять вызов" NAME=confirm2></TD></TR></TABLE>'; echo '<INPUT TYPE=submit value="Принять вызов" NAME=confirm2></TD></TR></TABLE>';
} }
if ($level == 'group') { if ($get == 'group') {
if ($user['level'] < 2) { if ($user['level'] < 2) {
die("<BR><BR><BR><CENTER><B>Групповые бои доступны с 2 уровня.</b></CENTER>"); die("<BR><BR><BR><CENTER><B>Групповые бои доступны с 2 уровня.</b></CENTER>");
} }
@ -1024,7 +1018,7 @@ if (!empty($_POST['open'])) {
} }
if ($level == 'haos') { if ($get == 'haos') {
if ($user['level'] < 2) { if ($user['level'] < 2) {
die("<BR><BR><BR><CENTER><B>Хаотичные бои доступны с 2 уровня.</b></CENTER>"); die("<BR><BR><BR><CENTER><B>Хаотичные бои доступны с 2 уровня.</b></CENTER>");
} }
@ -1078,7 +1072,7 @@ if (!empty($_POST['open'])) {
//print_r($_POST); //print_r($_POST);
} }
if (!is_null($tklogs)) { if ($get == 'current') {
$t1 = floor(time() - 900); $t1 = floor(time() - 900);
$data = db::c()->query('SELECT * FROM `battle` WHERE `win` = 3 AND `to1` > ?i AND `to2` > ?i ORDER BY `id` ASC', $t1, $t1); $data = db::c()->query('SELECT * FROM `battle` WHERE `win` = 3 AND `to1` > ?i AND `to2` > ?i ORDER BY `id` ASC', $t1, $t1);
while ($row = $data->fetch_assoc()) { while ($row = $data->fetch_assoc()) {