Remove use of $light, and check cookie directly.

This commit is contained in:
Darren 'Tadgy' Austin 2024-08-09 17:09:20 +01:00
commit 05b4613040
8 changed files with 6 additions and 13 deletions

View file

@ -1,5 +1,4 @@
</div>
<?php require ("includes/vars.php"); ?>
<?php require ("includes/bwbar.php"); ?>
<div id="copyright">
Slackware UK logo, design and code &copy; Darren 'Tadgy' Austin

View file

@ -1,6 +1,6 @@
<div id="bwbar">
<span class="bold">Mirror server bandwidth utilisation</span><br>
<?php if ($light) { ?>
<?php if ($_COOKIE['theme'] == "light") { ?>
<img src="/html/bwbar-light.png" title="<!--#include virtual='/html/bwbar.txt' -->" alt="Bandwidth graph measuring <!--#include virtual='/html/bwbar.txt' -->">
<?php } else { ?>
<img src="/html/bwbar-dark.png" title="<!--#include virtual='/html/bwbar.txt' -->" alt="Bandwidth graph measuring <!--#include virtual='/html/bwbar.txt' -->">

View file

@ -1,5 +1,5 @@
<div id="donatebuttons">
<?php if ($light) { ?>
<?php if ($_COOKIE['theme'] == "light") { ?>
<a href="https://www.patreon.com/slackwareUK" title="Patreon"><img src="/html/patreon-black.png" title="Patreon" alt="Patreon Logo"></a>
<a href="https://paypal.me/DonateToSlackwareUK" title="PayPal"><img src="/html/paypal-black.png" title="PayPal" alt="PayPal Logo"></a>
<?php } else { ?>

View file

@ -1,5 +1,5 @@
<head>
<?php if ($light) { ?>
<?php if ($_COOKIE['theme'] == "light") { ?>
<link rel="stylesheet" href="/html/light.css" type="text/css">
<?php } else { ?>
<link rel="stylesheet" href="/html/dark.css" type="text/css">

View file

@ -1,4 +1,4 @@
<?php if ($light) { ?>
<?php if ($_COOKIE['theme'] == "light") { ?>
<a href="/" title="Slackware UK"><img src="/html/slackwareuk-black.png" title="Slackware UK" alt="Slackware UK Logo"></a>
<?php } else { ?>
<a href="/" title="Slackware UK"><img src="/html/slackwareuk-white.png" title="Slackware UK" alt="Slackware UK Logo"></a>

View file

@ -3,7 +3,7 @@ is kindly sponsored by:
<a href="http://mailg.ukservers.com/c/eJxVjDkOwyAQAF8DJYLlLijS-B8LbGTLdhKBE5TfhzajKUdTk0fnNN8SSADplVETAGFUVqWCCmBiDETMyPfeqX2odVGeJ18TeQXag9W2uoAaCLyNeC9GZp-drfxI63W9OtM3Bst0jCH-Jy31b8d6bo_57weWfWCjGf0AmK0uIA" title="UK Servers"><img src="/html/ukservers.png" title="UK Servers" alt="UK Servers Logo"></a>
</div>
<!--
<?php if ($light) { ?>
<?php if ($_COOKIE['theme'] == "light") { ?>
<div class="sponsor">
<a href="http://www.uk2.net/" title="UK2"><img src="/html/uk2-black.png" title="UK2" alt="UK2 Logo"></a>
</div>

View file

@ -189,10 +189,4 @@
$description = "UK Slackware Linux and Slackware based project hosting & mirror service";
$keywords = "Slackware Linux, Slackware mirror, Slackware mirrors, Slackware hosting, Slackware, Slackware64, Slackware UK, Slackware64 UK";
}
if ($_COOKIE['theme'] == "light") {
$light = true;
} else {
$light = false;
}
?>

View file

@ -7,7 +7,7 @@
"httponly" => true,
"samesite" => "Lax"
);
if (!$light) {
if ($_COOKIE['theme'] != "light") {
$theme = "light";
} else {
$theme = "dark";