diff --git a/includes/functions.php b/includes/functions.php index 863704c0..cc5d6c99 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -801,13 +801,23 @@ function validateMac($mac) { // @return boolean function getNightmode() { - if (isset($_COOKIE['theme']) && $_COOKIE['theme'] == 'lightsout.php') { + if (isset($_COOKIE['theme']) && $_COOKIE['theme'] == 'dark.css') { return true; } else { return false; } } - + +// Sets data-bs-theme +// @return string +function setTheme() +{ + if (getNightmode()) { + echo 'data-bs-theme="dark"'; + } else { + echo 'data-bs-theme="light"'; + } +} // search array for matching string and return only first matching group function preg_only_match($pat,$haystack) { diff --git a/includes/navbar.php b/includes/navbar.php index 03966396..50050239 100755 --- a/includes/navbar.php +++ b/includes/navbar.php @@ -7,8 +7,8 @@