From 8262dd3f45124e37b7c4c51a225c7bf8f259cfd2 Mon Sep 17 00:00:00 2001 From: "Igor Barkov (iwork)" Date: Wed, 30 Sep 2020 14:49:17 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D0=BD=D0=B5=D0=B4=D1=80=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=88=D0=B0=D0=B1=D0=BB=D0=BE=D0=BD=D0=B8=D0=B7?= =?UTF-8?q?=D0=B0=D1=82=D0=BE=D1=80=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bots_razmen.php | 0 buy.php | 20 +++++++++----------- inf.php | 15 +++++---------- 3 files changed, 14 insertions(+), 21 deletions(-) delete mode 100644 bots_razmen.php diff --git a/bots_razmen.php b/bots_razmen.php deleted file mode 100644 index e69de29..0000000 diff --git a/buy.php b/buy.php index 9d05cf1..bc9fa45 100644 --- a/buy.php +++ b/buy.php @@ -9,21 +9,19 @@ $is_now = db::c()->query('SELECT `id`, `uid` FROM `abils_user` WHERE `uid` = ?i' function add_user_abil($ab, $cost) { global $user, $banks; - if (isset($ab)) { - if ($banks['ekr'] >= $cost) { - $isset = mysql_fetch_array(mysql_query('SELECT `id`, `' . $ab . '` FROM `abils_user` WHERE `uid` = "' . $user['id'] . '" LIMIT 1')); - $isset[$ab] += 1; - mysql_query('UPDATE `abils_user` SET `' . $ab . '` = "' . $isset[$ab] . '" WHERE `uid` = "' . $user['id'] . '" LIMIT 1'); - $banks['ekr'] -= $cost; - mysql_query('UPDATE `bank` SET `ekr` = "' . $banks['ekr'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1'); - return true; - } + if (isset($ab) && $banks['ekr'] >= $cost) { + $isset = mysql_fetch_array(mysql_query('SELECT `id`, `' . $ab . '` FROM `abils_user` WHERE `uid` = "' . $user['id'] . '" LIMIT 1')); + $isset[$ab] += 1; + mysql_query('UPDATE `abils_user` SET `' . $ab . '` = "' . $isset[$ab] . '" WHERE `uid` = "' . $user['id'] . '" LIMIT 1'); + $banks['ekr'] -= $cost; + mysql_query('UPDATE `bank` SET `ekr` = "' . $banks['ekr'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1'); + return true; } return false; } -$cost = array(1, 2, 10, 0.50, 0.80, 1, 1, 0.10, 0.20, 4, 0.02, 20, 10, 1, 1); -$mag = array('sleep15', 'sleep30', 'closebattle', 'heal20', 'heal35', 'heal50', 'travmoff', 'attack', 'bloodattack', 'death', 'comment', 'openbattle', 'reamdeath', 'clone', 'unclone'); +$cost = [1, 2, 10, 0.50, 0.80, 1, 1, 0.10, 0.20, 4, 0.02, 20, 10, 1, 1]; +$mag = ['sleep15', 'sleep30', 'closebattle', 'heal20', 'heal35', 'heal50', 'travmoff', 'attack', 'bloodattack', 'death', 'comment', 'openbattle', 'reamdeath', 'clone', 'unclone']; if (isset($_POST['type'], $_POST['user'])) { if (isset($user['id'])) { diff --git a/inf.php b/inf.php index 0ca7729..83273d4 100644 --- a/inf.php +++ b/inf.php @@ -1,21 +1,16 @@ id); $presentsList = $presentsModel->getAllPresents(); $userInfo->watcher_id = $userInfo->id ?? null; -Template::header('Информация о'.$userInfo->login); - -if (empty($userInfo->id)): ?> - Ошибка: персонаж не найден... -

←назад

- - -login); +if (!$userInfo->id) { + sprintf('Ошибка: персонаж %s не найден...

←назад

', $login); + exit; +} try { $userInfo->showUserInfo();