From 8a1a313dca892781ebed06ea937cf9fc8f833ed3 Mon Sep 17 00:00:00 2001 From: "Igor Barkov [iwork]" Date: Thu, 1 Nov 2018 12:10:02 +0200 Subject: [PATCH] Forum cleanup --- forum.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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; }