Remove globals

This commit is contained in:
Ivor Barhansky 2023-08-31 16:59:41 +03:00
parent be5779ff27
commit 3b4bbf3a6a
3 changed files with 7 additions and 4 deletions

View File

@ -583,6 +583,10 @@ class User
private function __construct()
{
if (empty($_SESSION['uid']) && empty($_COOKIE['login'])) {
return;
}
$user = !empty($_SESSION['uid']) ? $_SESSION['uid'] : $_COOKIE['login'];
$this->info = self::getInfo($user);
unset($user);
@ -2000,7 +2004,7 @@ class User
[$id]
);
}
$r = '';
if (
isset($inf['id']) &&
(
@ -5544,7 +5548,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
if (!isset($po['nodelete'])) {
$is1 .= ' <a onClick="top.drop(' . $pl['id'] . ',\'' . $pl['img'] . '\',\'' . $pl['name'] . '\',1,\'<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2><img src=\\\'' . Config::img() . '/i/items/' . $pl['img'] . '\\\'></td><td align=\\\'left\\\'>Предмет <strong>' . $pl['name'] . '</strong> будет утерян, вы уверены ?</td></tr></table>\',\'' . intval(
$_GET['otdel']
) . '\'); return false;" href="javascript:void(0);" title="Выкинуть предмет"><img src="' . Config::img() . '/i/clear.gif"></a>';
) . ' . Config::img() . ' / i / clear . gif"></a>';
}
}
}

View File

@ -953,7 +953,7 @@ from items_users left join items_main on items_main.id = item_id where inOdet !=
//Бонусы комплектов
$i = 0;
if (is_array($coms['new'])) {
if (!empty($coms['new']) && is_array($coms['new'])) {
while ($i <= count($coms['new'])) {
if (isset($coms['new'][$i])) {
//$coms[$i]['id'] - id комплекта, $j - кол-во предметов данного комплекта

View File

@ -429,7 +429,6 @@ elem.parentNode.removeChild(elem);
</script>";
if ($u->info['dnow'] > 0) {
$d = new Dungeon;
$d->start();
}
require_once('modules_data/_dialog.php');
} elseif (isset($_GET['inv']) && !isset($u->tfer['id']) && $trololo == 1) {