This commit is contained in:
lopar 2021-01-31 16:59:13 +02:00
parent 3d8803d67d
commit c2c0317f00

View File

@ -398,8 +398,9 @@ function timeOut($ttm)
return $out; return $out;
} }
function show_eff_inf($u, $type) function show_eff_inf($u)
{ {
global $db;
$img = [ $img = [
1 => "travma.gif", 2 => "magic/sleep.gif", 3 => "magic/sleepf.gif", 4 => "magic/haos.gif", 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", 5 => "magic/obezl.gif", 6 => "expx15.gif", 7 => "euphoria.png", 8 => "sleep_obj.gif",
@ -412,56 +413,22 @@ function show_eff_inf($u, $type)
1022 => "sh/hidden.gif", 1022 => "sh/hidden.gif",
]; ];
$r = ''; $r = '';
$and = '';
$adds = ''; $effs = $db->ofetchAll('SELECT * FROM users_effects WHERE type != 20 AND owner_id = ?', $u);
if ($type == 1) {
$and = " AND `type` != 1022"; $i = 0;
} while ($i < count($effs)) {
$effs = db::c()->query('SELECT * FROM `users_effects` WHERE `type` <> 20 AND `owner_id` = ?i' . $and, $u)->fetch_assoc();
/* Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 132644820 bytes) in /home/combats/web/combats.loc/public_html/functions.php on line 873 $r .= '<div>';
* Если на человеке стоит type=20 $r .= '<img class="image" src="/i/' . $img[$effs->type] . '" /> <a href=\'main.php?edit=1&del=1&efid=' . $effs->effect_id . '\' onclick=\'return confirm("Удалить ' . $effs->name . '?")\'><img src=\'i/clear.gif\' style=\'float: right;\' /></a>';
* #26 $r .= '<span class="title">' . $effs->name . '</span>';
*/ if ($effs['sleep'] != 0) {
$etype = $effs['type']; $r .= '<div class="timeleft">Эффект заморожен</div>';
if ($type == 1) { } else {
while ($effs) { $r .= '<div class="timeleft">' . timeOut($effs->remaining_time - time()) . '</div>';
if ($etype == 11 || $etype == 12 || $etype == 13 || $etype == 14) {
if ($etype == 11) {
$adds = 'Легкая ';
} elseif ($etype == 12) {
$adds = 'Средняя ';
} elseif ($etype == 13) {
$adds = 'Тяжелая ';
} elseif ($etype == 14) {
$adds = 'Неизлечимая ';
} else {
$adds = '';
}
} else {
$adds = '';
}
$r .= '<div>';
$r .= '<img class="image" src="i/{$img[$etype]}">';
$r .= '<span class="title">' . $adds . $effs['name'] . '</span>';
if ($effs['sleep'] != 0) {
$r .= '<div class="timeleft">Эффект заморожен</div>';
} else {
$r .= '<div class="timeleft">' . timeOut($effs['time'] - time()) . '</div>';
}
$r .= '</div>';
}
} else {
while ($effs) {
$r .= '<div>';
$r .= '<img class="image" src="/i/' . $img[$etype] . '" /> <a href=\'main.php?edit=1&del=1&efid=' . $effs['id'] . '\' onclick=\'return confirm("Удалить ' . $adds . $effs['name'] . '?")\'><img src=\'i/clear.gif\' style=\'float: right;\' /></a>';
$r .= '<span class="title">' . $adds . $effs['name'] . '</span>';
if ($effs['sleep'] != 0) {
$r .= '<div class="timeleft">Эффект заморожен</div>';
} else {
$r .= '<div class="timeleft">' . timeOut($effs['time'] - time()) . '</div>';
}
$r .= '</div>';
} }
$r .= '</div>';
$i++;
} }
return $r; return $r;
} }