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 .= '