diff --git a/forum.php b/forum.php index a495fae..2e2629b 100644 --- a/forum.php +++ b/forum.php @@ -2,8 +2,10 @@ session_start(); include('config.php'); -$user = db::c()->query('SELECT * FROM `users` WHERE `id` = ?i', $_SESSION['uid'])->fetch_assoc(); -$sleep = db::c()->query('SELECT `id` FROM `effects` WHERE `owner` = ?i AND `time` > ?i AND `type` = 3', $user['id'], time())->fetch_assoc(); +if (!empty($_SESSION['uid'])) { + $user = db::c()->query('SELECT * FROM `users` WHERE `id` = ?i', $_SESSION['uid'])->fetch_assoc(); + $sleep = db::c()->query('SELECT `id` FROM `effects` WHERE `owner` = ?i AND `time` > ?i AND `type` = 3', $user['id'], time())->fetch_assoc(); +} else $user = $sleep = []; if (!isset($_GET['page'])) { $ps = 0; @@ -14,7 +16,7 @@ if (!isset($_GET['page'])) { $isModerator = false; $isAdmin = false; -if (($user['align'] >= 1.7 && $user['align'] < 2)) { +if (($user['align'] >= 1.1 && $user['align'] < 2)) { $isModerator = true; }