Чистка кода.

This commit is contained in:
lopar 2018-01-29 00:09:37 +02:00
parent 0e0e5ccd7d
commit fbd473bf97
1 changed files with 14 additions and 17 deletions

View File

@ -402,9 +402,6 @@ function battlewithbot($b, $name = '', $time = 3, $blood = 1, $group = 1, $battl
}
}
return $battleid;
if (!$noredir) {
die("<script>location.href='fbattle.php';</script>");
}
}
@ -708,11 +705,11 @@ function takeshopitem($item, $table = "shop", $present = '', $onlyonetrip = '',
$rec1['ecost'] = 0;
}
if ($fields) {
foreach ($fields as $k => $v) {
$rec1[$k] = $v;
}
}
// if ($fields) {
// foreach ($fields as $k => $v) {
// $rec1[$k] = $v;
// }
// }
$sql = "";
while ($rec = mysql_fetch_assoc($r)) {
@ -774,15 +771,15 @@ function bank_check($item, $table = "shop", $present = '', $onlyonetrip = '', $f
$rec1['cost'] = $cost;
}
if ($fields) {
foreach ($fields as $k => $v) {
$rec1[$k] = $v;
}
}
// if ($fields) {
// foreach ($fields as $k => $v) {
// $rec1[$k] = $v;
// }
// }
$sql = "";
while ($rec = mysql_fetch_assoc($r)) {
if (!@$flds[$rec['Field']]) continue;
if (!$flds[$rec['Field']]) continue;
if ($rec['Field'] == "id" || $rec['Field'] == "prototype" || $rec['Field'] == "dategoden" || $rec['Field'] == "name") continue;
$sql .= ", `$rec[Field]` = '" . $rec1[$rec['Field']] . "' ";
}
@ -2610,7 +2607,7 @@ function showinf_pers($id, $pas = 0, $battle = 0, $me = 0, $main = false)
$ru_2 = show_rune(2, $user['id']);
$ru_3 = show_rune(3, $user['id']);
$r .= '<table cellspacing="0" cellpadding="0" border="0" style="background-image: url(\'i/runes_slots.jpg\'); background-position: center bottom; background-repeat: no-repeat;"><tbody><tr><td width="59" height="48" align="right">' . $ru_1 . '</td><td width="74" height="48" align="center">' . $ru_2 . '</td><td width="57" height="48" align="left">' . $ru_3 . '</td></tr></tbody></table></center>';
$r .= '<table cellspacing="0" cellpadding="0" border="0" style="background: url(i/runes_slots.jpg) no-repeat center bottom;"><tbody><tr><td width="59" height="48" align="right">' . $ru_1 . '</td><td width="74" height="48" align="center">' . $ru_2 . '</td><td width="57" height="48" align="left">' . $ru_3 . '</td></tr></tbody></table></center>';
$r .= '<center><table cellPadding=0 cellSpacing=0 width="100%"><tbody>';
if (!$battle) {
@ -2771,8 +2768,8 @@ function year_text($days)
$s = substr($days, strlen($days) - 1, 1);
if (strlen($days) >= 2) {
if (substr($days, strlen($days) - 2, 1) == '1') {
return $days . " лет ";
$ok = true;
return $days . " лет ";
}
}
if (!$ok) {
@ -2793,8 +2790,8 @@ function month_text($days)
$s = substr($days, strlen($days) - 1, 1);
if (strlen($days) >= 2) {
if (substr($days, strlen($days) - 2, 1) == '1') {
$ok = 1;
return $days . " месяцев ";
$ok = true;
}
}
if (!$ok) {