From b115f4823ba4842fcc11cd3f96f8699743d75c16 Mon Sep 17 00:00:00 2001 From: lopar Date: Fri, 9 Mar 2018 00:14:29 +0200 Subject: [PATCH] code clean --- functions.php | 17 +++++++++-------- main.php | 32 ++++++-------------------------- 2 files changed, 15 insertions(+), 34 deletions(-) diff --git a/functions.php b/functions.php index 4b94f1a..1a74cdf 100644 --- a/functions.php +++ b/functions.php @@ -1650,10 +1650,10 @@ function echoscroll($slot) $script = 'main'; } - if ($user['battle'] > 0) $bat = mysql_fetch_array(mysql_query("SELECT `id`, `magic` FROM `battle` WHERE `id` = '{$user['battle']}' LIMIT 1")); + if ($user['battle'] > 0) $bat = db::c()->query('SELECT `id`, `magic` FROM `battle` WHERE `id` = ?i', $user['battle'])->fetch_assoc(); $all_magic = unserialize($bat['magic']); - $dress = mysql_fetch_array(mysql_query("SELECT `id`, `magic`, `name`, `img`, `duration`, `maxdur` FROM `inventory` WHERE `id` = '{$user[$slot]}' LIMIT 1")); - $need_charge = mysql_fetch_array(mysql_query("SELECT `needcharge` FROM `magic` WHERE `id` = '{$dress['magic']}' LIMIT 1")); + $dress = db::c()->query('SELECT `id`, `magic`, `name`, `img`, `duration`, `maxdur` FROM `inventory` WHERE `id` = ?i', $user[$slot])->fetch_assoc(); + $need_charge = db::c()->query('SELECT `needcharge` FROM `magic` WHERE `id` = ?i', $dress['magic'])->fetch_assoc(); if (($user[$slot] > 0) && ($all_magic[$user['id']] < 1 || $need_charge['needcharge'] == 0)) { $row['id'] = $user[$slot]; if ($dress['magic']) { @@ -2561,12 +2561,13 @@ function showpersout($pas = 0) У персонажа $trt травма."; - } - $dd = mysql_query("SELECT * FROM `effects` WHERE `owner` = " . $user['id'] . ";"); + // FIXME Научиться отображать травмы +// if ($trt) { +// echo "У персонажа $trt травма."; +// } + $dd = db::c()->query('SELECT `time`, `type` FROM `effects` WHERE `owner` = ?i', $user['id']); $param_bonus = []; - while ($row = mysql_fetch_array($dd)) { + while ($row = $dd->fetch_assoc()) { if ($row['time'] < time()) { $row['time'] = time(); } diff --git a/main.php b/main.php index 99a0a01..8a1f6d9 100644 --- a/main.php +++ b/main.php @@ -2645,32 +2645,12 @@ if ($user['room'] == 666) { ?> - - - - - < link - rel = "stylesheet" - href = "/i/btn.css" - type = "text/css" > - < meta - content = "text/html; charset=utf-8" - http - equiv = Content - type > - < META - Http - Equiv = Cache - Control - Content = "no-cache, max-age=0, must-revalidate, no-store" > - < meta - http - equiv = PRAGMA - content = NO - CACHE > - < META - Http - Equiv = Expires - Content = 0 > - < link - rel = "stylesheet" - type = "text/css" - href = "css/tooltip.css" / > - < script - src = "js/jquery-1.7.2.min.js" > + + + + + +