30 lines
736 B
PHP
30 lines
736 B
PHP
<?php
|
|
|
|
session_start();
|
|
|
|
if (!isset($_SESSION['userAccreditation']) || !isset($_SESSION['userLevel'])) {
|
|
$_SESSION['userAccreditation'] = 0;
|
|
$_SESSION['userLevel'] = 0;
|
|
}
|
|
|
|
if (!isset($_COOKIE['theme'])) {
|
|
setcookie('theme', 0, time()+10*60*60);
|
|
$darkTheme = $darkThemes[0];
|
|
$lightTheme = $lightThemes[0];
|
|
}
|
|
|
|
if (isset($_GET['theme'])) {
|
|
$newTheme = (int)$_GET['theme'] % 2;
|
|
setcookie('theme', $newTheme); // % 2 => Number of different themes
|
|
$darkTheme = $darkThemes[$newTheme];
|
|
$lightTHeme = $lightThemes[$newTheme];
|
|
|
|
} else if (isset($_COOKIE['theme'])) {
|
|
$theme = (int)$_COOKIE['theme'] % 2;
|
|
$darkTheme = $darkThemes[$theme];
|
|
$lightTheme = $lightThemes[$theme];
|
|
}
|
|
|
|
$status = "";
|
|
|
|
?>
|