From f8038010427f92e74822c4f5b8ae3eb2859fa81b Mon Sep 17 00:00:00 2001 From: "Igor Barkov [iwork]" Date: Thu, 1 Nov 2018 17:08:24 +0200 Subject: [PATCH] Fix --- functions.php | 40 ++++++++++++---------------------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/functions.php b/functions.php index 1713cb5..69e6aca 100644 --- a/functions.php +++ b/functions.php @@ -825,7 +825,9 @@ function timeOut($ttm) return $out; } -$img = [ +function show_eff_inf($u, $type) +{ + $img = [ 1 => "travma.gif", 2 => "magic/sleep.gif", 3 => "magic/sleepf.gif", 4 => "magic/haos.gif", 5 => "magic/obezl.gif", 6 => "expx15.gif", 7 => "euphoria.png", 8 => "sleep_obj.gif", 10 => "magic/chains.gif", 11 => "travma.gif", 12 => "travma.gif", 13 => "travma.gif", @@ -835,27 +837,24 @@ $img = [ 220 => "magic/wis_earth_def3.gif", 221 => "magic/wis_fire_def1.gif", 222 => "magic/wis_fire_def2.gif", 223 => "magic/wis_fire_def3.gif", 224 => "magic/wis_water_def1.gif", 225 => "magic/wis_water_def2.gif", 226 => "magic/wis_water_def3.gif", 227 => "magic/attack_defence.gif", 1022 => "sh/hidden.gif" -]; - -function show_eff_inf($u, $type) -{ - global $img; + ]; $r = ''; $and = ''; if ($type == 1) { $and = " AND `type` != 1022"; } $effs = db::c()->query('SELECT * FROM `effects` WHERE `owner` = ?i'.$and, $u)->fetch_assoc(); + $etype = $effs['type']; if ($type == 1) { while ($effs) { - if ($effs['type'] == 11 || $effs['type'] == 12 || $effs['type'] == 13 || $effs['type'] == 14) { - if ($effs['type'] == 11) { + if ($etype == 11 || $etype == 12 || $etype == 13 || $etype == 14) { + if ($etype == 11) { $adds = 'Легкая '; - } elseif ($effs['type'] == 12) { + } elseif ($etype == 12) { $adds = 'Средняя '; - } elseif ($effs['type'] == 13) { + } elseif ($etype == 13) { $adds = 'Тяжелая '; - } elseif ($effs['type'] == 14) { + } elseif ($etype == 14) { $adds = 'Неизлечимая '; } else { $adds = ''; @@ -864,7 +863,7 @@ function show_eff_inf($u, $type) $adds = ''; } $r .= '
'; - $r .= ''; + $r .= ''; $r .= '' . $adds . $effs['name'] . ''; if ($effs['sleep'] != 0) { $r .= '
Эффект заморожен
'; @@ -875,23 +874,8 @@ function show_eff_inf($u, $type) } } else { while ($effs) { - if ($effs['type'] == 11 || $effs['type'] == 12 || $effs['type'] == 13 || $effs['type'] == 14) { - if ($effs['type'] == 11) { - $adds = 'Легкая '; - } elseif ($effs['type'] == 12) { - $adds = 'Средняя '; - } elseif ($effs['type'] == 13) { - $adds = 'Тяжелая '; - } elseif ($effs['type'] == 14) { - $adds = 'Неизлечимая '; - } else { - $adds = ''; - } - } else { - $adds = ''; - } $r .= '
'; - $r .= ' '; + $r .= ' '; $r .= '' . $adds . $effs['name'] . ''; if ($effs['sleep'] != 0) { $r .= '
Эффект заморожен
';