]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/commitdiff
Take 3 try to fix navbar highlighting
authorValerie Pond <redacted>
Sun, 15 Jan 2023 22:07:05 +0000 (22:07 +0000)
committerValerie Pond <redacted>
Sun, 15 Jan 2023 22:07:05 +0000 (22:07 +0000)
header.php

index 86fd721a6ba7025414093a2965a064a22e86543a..44f1268ebf3c7b9e083aba4c7225e1693a95e783 100644 (file)
@@ -35,10 +35,14 @@ foreach ($pages as $name => $page)
 {
        $script = $_SERVER['SCRIPT_FILENAME'];
        $tok = split($script, "/");
-       if ((str_ends_with($script, BASE_URL . "index.php") && !strlen($tok[0])) || !strlen($page))
-       {
+       if (strlen($page) == 0) {
                $active_page = "";
        }
+       else if (str_ends_with($script, BASE_URL . "index.php") && BASE_URL != "/" && !strlen($tok[0]))
+       {
+               echo "2";
+               $active_page = $tok[0];
+       }
        else if (!str_ends_with($page, ".php"))
        {
                $script2 = rtrim($script, "/index.php");