diff --git a/functions.php b/functions.php index f2ed1fd..c1c6f86 100644 --- a/functions.php +++ b/functions.php @@ -11,7 +11,7 @@ require_once 'config.php'; * Класс-заглушка для работы глобальных переменных в функциях. * Возвращает массив данных таблицы users. */ -$user = (new users_row($_SESSION['uid']))->result(); +if (isset($_SESSION['uid'])) $user = (new users_row($_SESSION['uid']))->result(); if (isset($user['id']) && $user['block'] == 1) { die(); @@ -572,7 +572,8 @@ function level_up($uid) } ######## FIXME ВЕЧНЫЕ 12-ТКИ!!!!!!!!!!!! -$in_user = db::c()->query('SELECT `id`, `exp`, `nextup`, `level` FROM `users` WHERE `id` = ?i', $_SESSION['uid'])->fetch_assoc(); +if (isset($_SESSION['uid'])) + $in_user = db::c()->query('SELECT `id`, `exp`, `nextup`, `level` FROM `users` WHERE `id` = ?i', $_SESSION['uid'])->fetch_assoc(); if (isset($in_user['id']) && ($in_user['exp'] >= $in_user['nextup']) && $in_user['level'] < 13) { level_up($in_user['id']); }