From 76bd11d0f40922993065bb6f913e51e55f02687d Mon Sep 17 00:00:00 2001 From: "Igor Barkov [iwork]" Date: Fri, 18 Jan 2019 14:25:27 +0200 Subject: [PATCH] another fixes --- functions.php | 2 +- inf.php | 17 ++++----- main.php | 95 ++++++++++++++++----------------------------------- 3 files changed, 37 insertions(+), 77 deletions(-) diff --git a/functions.php b/functions.php index 5b535f6..58df0db 100644 --- a/functions.php +++ b/functions.php @@ -1,4 +1,4 @@ -ыр diff --git a/inf.php b/inf.php index e0b6797..928780e 100644 --- a/inf.php +++ b/inf.php @@ -77,32 +77,27 @@ if (!empty($user['realname'])) echo "Имя: " . $user['realname'] . "
"; 1.2)) OR (!empty($own['admin']))) $okdop = 1; +if ((($own['align'] == 1) AND (!$user['admin'])) OR (!empty($own['admin']))) $showModeratorInfo = true; -if ($okld == 1) { - echo "

Личное дело

"; +if ($showModeratorInfo == 1) { $ld = db::c()->query('SELECT * FROM `lichka` WHERE `pers` = ?i ORDER BY `id` ASC', $user['id']); + $iplog = db::c()->query('SELECT idperslater FROM delo_multi WHERE idpersnow = ?i GROUP BY idperslater ASC', $user['id']); + + echo "

Личное дело

"; while ($row_ld = $ld->fetch_assoc()) { $dat = date("d.m.Y H:i", $row_ld['date']); echo "$dat {$row_ld['text']}
"; } -} -if ($okdop == 1) { - $iplog = db::c()->query('SELECT idperslater FROM delo_multi WHERE idpersnow = ?i GROUP BY idperslater ASC', $user['id']); if ($iplog->getNumRows()) { echo "

Возможные мульты

"; while ($row_iplog = $iplog->fetch_assoc()) echo nick::id($row_iplog['idperslater'])->full() . " "; } echo "

Дополнительные сведения

"; - if (!empty($user['id'])) echo "ID: " . $user['id'] . "
"; if (!empty($user['email'])) echo "E-mail: " . $user['email'] . "
"; if (!empty($user['borndate'])) echo "День рождения: " . $user['borndate'] . "
"; diff --git a/main.php b/main.php index 93a9ced..a4e9ca4 100644 --- a/main.php +++ b/main.php @@ -2,11 +2,9 @@ ob_start("ob_gzhandler"); session_start(); $errkom = ''; -if (!isset($_SESSION['uid'])) { - header("Location: index.php"); -} -include("config.php"); -include("functions.php"); +if (!isset($_SESSION['uid'])) header("Location: index.php"); + +require_once 'functions.php'; $tmaz = time(); db::c()->query('UPDATE `online` SET `real_time` = ?i WHERE `id` = ?i', time(), $user['id']); if ($user['battle'] != 0) { @@ -37,7 +35,7 @@ function sum_bron($u) function bron_ads($a1, $a2, $a3, $a4, $col) { - return array('a1' => round(($a1 / 100) * $col), 'a2' => round(($a2 / 100) * $col), 'a3' => round(($a3 / 100) * $col), 'a4' => round(($a4 / 100) * $col)); + return ['a1' => round(($a1 / 100) * $col), 'a2' => round(($a2 / 100) * $col), 'a3' => round(($a3 / 100) * $col), 'a4' => round(($a4 / 100) * $col)]; } @@ -152,7 +150,7 @@ function countmf() $bmfbron = 0; } - $mf = array(); + $mf = []; $user_dress = db::c()->query('SELECT SUM(`minu`), SUM(`maxu`), SUM(`mfkrit`), SUM(`mfakrit`), SUM(`mfuvorot`), SUM(`mfauvorot`), SUM(`bron1`), SUM(`bron2`), SUM(`bron3`), SUM(`bron4`) FROM `inventory` WHERE `dressed` = 1 AND `owner` = ?i', $user['id'])->fetch_row(); $user_dress[6] = $bmfbron; @@ -171,7 +169,7 @@ function countmf() $myuvorot = $user_dress[4] + ($user['lovk'] * 5); $myauvorot = $user_dress[5] + ($user['lovk'] * 4); - $mf['me'] = array('udar' => (floor($user['sila'] / 3) + 1 + $user_dress[0]), 'maxudar' => (floor($user['sila'] / 3) + 4 + $user_dress[1])); + $mf['me'] = ['udar' => (floor($user['sila'] / 3) + 1 + $user_dress[0]), 'maxudar' => (floor($user['sila'] / 3) + 4 + $user_dress[1])]; if ($mf['me']['udar'] < 0) { $mf['me']['udar'] = 0; @@ -193,7 +191,7 @@ function countmf() break; } - return array('minu' => $mf['me']['udar'] + $bmfud + $weap_b, 'maxu' => $mf['me']['maxudar'] + $bmfud + $weap_b, 'fkrit' => round($mykrit, 0), 'fakrit' => round($myakrit, 0), 'fuvorot' => round($myuvorot, 0), 'fauvorot' => round($myauvorot, 0), 'bron1' => $user_dress[6], 'bron2' => $user_dress[7], 'bron3' => $user_dress[8], 'bron4' => $user_dress[9]); + return ['minu' => $mf['me']['udar'] + $bmfud + $weap_b, 'maxu' => $mf['me']['maxudar'] + $bmfud + $weap_b, 'fkrit' => round($mykrit, 0), 'fakrit' => round($myakrit, 0), 'fuvorot' => round($myuvorot, 0), 'fauvorot' => round($myauvorot, 0), 'bron1' => $user_dress[6], 'bron2' => $user_dress[7], 'bron3' => $user_dress[8], 'bron4' => $user_dress[9]]; } // одеть предмет @@ -247,54 +245,29 @@ function dressitem($id) } if ($item['type'] == 5) { - if (!$user['r1']) { - $slot1 = 'r1'; - } elseif (!$user['r2']) { - $slot1 = 'r2'; - } elseif (!$user['r3']) { - $slot1 = 'r3'; - } else { + if (!$user['r1']) $slot1 = 'r1'; + elseif (!$user['r2']) $slot1 = 'r2'; + elseif (!$user['r3']) $slot1 = 'r3'; + else { $slot1 = 'r1'; dropitem(5); } } elseif ($item['type'] == 12) { - if (!$user['m1']) { - $slot1 = 'm1'; - } elseif (!$user['m2']) { - $slot1 = 'm2'; - } elseif (!$user['m3']) { - $slot1 = 'm3'; - } elseif (!$user['m4']) { - $slot1 = 'm4'; - } elseif (!$user['m5']) { - $slot1 = 'm5'; - } elseif (!$user['m6']) { - $slot1 = 'm6'; - } elseif (!$user['m7']) { - $slot1 = 'm7'; - } elseif (!$user['m8']) { - $slot1 = 'm8'; - } elseif (!$user['m9']) { - $slot1 = 'm9'; - } elseif (!$user['m10']) { - $slot1 = 'm10'; - } else { + if (!$user['m1']) $slot1 = 'm1'; + elseif (!$user['m2']) $slot1 = 'm2'; + elseif (!$user['m3']) $slot1 = 'm3'; + elseif (!$user['m4']) $slot1 = 'm4'; + elseif (!$user['m5']) $slot1 = 'm5'; + elseif (!$user['m6']) $slot1 = 'm6'; + elseif (!$user['m7']) $slot1 = 'm7'; + elseif (!$user['m8']) $slot1 = 'm8'; + elseif (!$user['m9']) $slot1 = 'm9'; + elseif (!$user['m10']) $slot1 = 'm10'; + else { $slot1 = 'm1'; dropitem(12); } - } else { - dropitem($item['type']); - } - $al = '(1 = 1)'; - if ($item['nalign'] > 0) { - if ($item['nalign'] == 1.1) { - if (($user['align'] == 6 || ($user['align'] > 1 && $user['align'] < 2))) { - $al = '(1 = 1)'; - } else { - $al = '(1 = 2)'; - } - } - } + } else dropitem($item['type']); if (!($item['type'] == 12 && $user['level'] < 4)) { if (db::c()->query('UPDATE `users` AS `u`, `inventory` AS `i` SET `u`.?f = ?i, `i`.`dressed` = 1, `u`.`sila` = `u`.`sila` + `i`.`gsila`, `u`.`lovk` = `u`.`lovk` + `i`.`glovk`, `u`.`inta` = `u`.`inta` + `i`.`ginta`, `u`.`intel` = `u`.`intel` + `i`.`gintel`, `u`.`maxhp` = `u`.`maxhp` + `i`.`ghp`, `u`.`noj` = `u`.`noj` + `i`.`gnoj`, `u`.`topor` = `u`.`topor` + `i`.`gtopor`, `u`.`dubina` = `u`.`dubina` + `i`.`gdubina`, `u`.`mec` = `u`.`mec` + `i`.`gmech`, `u`.`mfire` = `u`.`mfire` + `i`.`gfire`, `u`.`mwater` = `u`.`mwater` + `i`.`gwater`, `u`.`mair` = `u`.`mair` + `i`.`gair`, `u`.`mearth` = `u`.`mearth` + `i`.`gearth`, `u`.`mlight` = `u`.`mlight` + `i`.`glight`, `u`.`mgray` = `u`.`mgray` + `i`.`ggray`, `u`.`mdark` = `u`.`mdark` + `i`.`gdark`, `u`.`ubron1` = `u`.`ubron1` + `i`.`bron1`, `u`.`ubron2` = `u`.`ubron2` + `i`.`bron2`, `u`.`ubron3` = `u`.`ubron3` + `i`.`bron3`, `u`.`ubron4` = `u`.`ubron4` + `i`.`bron4`, `u`.`fkrit` = `u`.`fkrit` + `i`.`mfkrit`, `u`.`fakrit` = `u`.`fakrit` + `i`.`mfakrit`, `u`.`fuvorot` = `u`.`fuvorot` + `i`.`mfuvorot`, `u`.`fauvorot` = `u`.`fauvorot` + `i`.`mfauvorot`, `u`.`uminu` = `u`.`uminu` + `i`.`minu`, `u`.`umaxu` = `u`.`umaxu` + `i`.`maxu` WHERE `i`.`needident` = 0 AND `i`.`id` = ?i AND `i`.`dressed` = 0 AND `i`.owner = ?i AND (20 + `u`.`sila`) >= `i`.`nsila` AND (20 + `u`.`lovk`) >= `i`.`nlovk` AND (20 + `u`.`inta`) >= `i`.`ninta` AND `u`.`vinos` >= `i`.`nvinos` AND (20 + `u`.`intel`) >= `i`.`nintel` AND `u`.`mudra` >= `i`.`nmudra` AND `u`.`level` >= `i`.`nlevel` AND (("?s" OR (?i = `i`.`nalign`)) OR (`i`.`nalign` = 0)) AND `u`.`noj` >= `i`.`nnoj` AND `u`.`topor` >= `i`.`ntopor` AND `u`.`dubina` >= `i`.`ndubina` AND `u`.`mec` >= `i`.`nmech` AND `u`.`mfire` >= `i`.`nfire` AND `u`.`mwater` >= `i`.`nwater` AND `u`.`mair` >= `i`.`nair` AND `u`.`mearth` >= `i`.`nearth` AND `u`.`mlight` >= `i`.`nlight` AND `u`.`mgray` >= `i`.`ngray` AND `u`.`mdark` >= `i`.`ndark` AND `i`.`setsale` = 0 AND `u`.`id` = ?i', $slot1, $id, $id, $user['id'], $al, $user['align'], $user['id'])) @@ -305,6 +278,7 @@ function dressitem($id) /** * Отображение персонажа в main.php + * * @param $id */ function showpersinv($id) @@ -324,18 +298,9 @@ function showpersinv($id) } ?>
- .gif"> - - [] - target=_blank>Инф. о <?= $user['login'] ?> - + + - - - - 3) { ?> @@ -1588,7 +1553,7 @@ if (input::get('edit')) { } else err('Ошибка: запрещённые символы!'); } - if (!in_array(input::get('mZeAjax'), array('mZeInventory', 'mZeFilter'))): ?> + if (!in_array(input::get('mZeAjax'), ['mZeInventory', 'mZeFilter'])): ?> @@ -1789,7 +1754,7 @@ if (input::get('edit')) { $add_bron = sum_bron($user['id']); $var_brons = bron_ads($mf['bron1'], $mf['bron2'], $mf['bron3'], $mf['bron4'], $add_bron); } else { - $var_brons = array('a1' => 0, 'a2' => 0, 'a3' => 0, 'a4' => 0); + $var_brons = ['a1' => 0, 'a2' => 0, 'a3' => 0, 'a4' => 0]; } ?> @@ -2113,7 +2078,7 @@ if (input::get('edit')) {
- +
- -
- +