diff --git a/assets/style.css b/assets/style.css index 9cdc376..9da1dc7 100644 --- a/assets/style.css +++ b/assets/style.css @@ -19,6 +19,8 @@ body { color: var(--primary-text); margin: 0; padding: 0; + min-height: 100vh; + min-width: 100vw; } nav { diff --git a/lib/account.php b/lib/account.php index fe8b4c2..91ce90e 100644 --- a/lib/account.php +++ b/lib/account.php @@ -88,7 +88,7 @@ function verifyPassword($userID, $password): bool function UpdateSession(){ global $mysqli; - $stmt = $mysqli->prepare("SELECT FirstName, LastName, Nickname, Email, MinecraftNick, PrivilegeLevel, LastLoginAt, LoginCount FROM Users WHERE ID = ? AND isActivated = 1"); + $stmt = $mysqli->prepare("SELECT FirstName, LastName, Nickname, Email, MinecraftNick, PrivilegeLevel, LastLoginAt, LoginCount, ClassID, FavoriteColor FROM Users WHERE ID = ? AND isActivated = 1"); $stmt->bind_param("i", $_SESSION["ID"]); $stmt->execute(); @@ -100,9 +100,11 @@ function UpdateSession(){ $email = ""; $minecraft_nickname = ""; $privilege_level = 0; + $class_id = 0; + $favorite_color = 0; $lastLoginAt = null; $loginCount = 0; - $stmt->bind_result($first_name, $last_name, $nickname, $email, $minecraft_nickname, $privilege_level, $lastLoginAt, $loginCount); + $stmt->bind_result($first_name, $last_name, $nickname, $email, $minecraft_nickname, $privilege_level, $lastLoginAt, $loginCount, $class_id, $favorite_color); $stmt->fetch(); $stmt->close(); @@ -112,6 +114,10 @@ function UpdateSession(){ $_SESSION["email"] = $email; $_SESSION["minecraft_nickname"] = $minecraft_nickname; $_SESSION["privilege_level"] = $privilege_level; + $_SESSION["lastLoginAt"] = $lastLoginAt; + $_SESSION["loginCount"] = $loginCount; + $_SESSION["class_id"] = $class_id; + $_SESSION["favorite_color"] = $favorite_color; } diff --git a/lib/page.php b/lib/page.php index 4db587a..9362ebd 100644 --- a/lib/page.php +++ b/lib/page.php @@ -112,6 +112,10 @@ function getPage($page_name = null): array|false|string $page_title = $page_name; } + if(isLoggedIn() && !empty($_SESSION["favorite_color"]) && is_int($_SESSION["favorite_color"]) && $_SESSION["favorite_color"] <= 4294967295){ + $dynastyle = dechex($_SESSION["favorite_color"]); + } + $navpages = generateNavigation(); $nav = str_replace("__NAV_PAGES__", $navpages, $nav); @@ -119,5 +123,6 @@ function getPage($page_name = null): array|false|string $out = $skeleton; $out = str_replace("__TEMPLATE__NAV__", $nav, $out); $out = str_replace("__TEMPLATE__PAGE__", $page, $out); + $out = str_replace("__TEMPLATE__DYNASTYLE__", $dynastyle, $out); return str_replace("__TEMPLATE_PAGE_TITLE__", $page_title, $out); } \ No newline at end of file diff --git a/templates/skeleton.html b/templates/skeleton.html index 5e2831d..a1f97c1 100644 --- a/templates/skeleton.html +++ b/templates/skeleton.html @@ -8,6 +8,9 @@ Adlerka __TEMPLATE_PAGE_TITLE__ + __TEMPLATE__NAV__