]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blobdiff - header.php
Remove the 2's...
[irc/unrealircd/unrealircd-webpanel.git] / header.php
index 506cfe35ce794c5c7b3e5990dec42e3cc52aa273..4218b91ddc223754ccab984c5dbe9520a85c2533 100644 (file)
 <!-- Latest compiled JavaScript -->
 <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>
 
-<script src="js/unrealircd-admin.js"></script>
+<!-- Font Awesome icons -->
+<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css">
+
+<script src="<?php echo BASE_URL; ?>js/unrealircd-admin.js"></script>
 <title>UnrealIRCd Panel</title>
 <link rel="icon" type="image/x-icon" href="<?php echo BASE_URL; ?>img/favicon.ico">
 <link href="<?php echo BASE_URL; ?>css/unrealircd-admin.css" rel="stylesheet">
@@ -23,7 +26,7 @@
        <!-- Fixed navbar -->
        <nav class="navbar navbar-expand-sm navbar-dark bg-dark fixed-top">
                <ul class="nav navbar-nav">
-                       <a class="navbar-brand" href="index.php"><img src="<?php echo BASE_URL; ?>img/favicon.ico" height="25" width="25"> UnrealIRCd Admin Panel</a>
+                       <a class="navbar-brand" href="<?php echo BASE_URL; ?>/index.php"><img src="<?php echo BASE_URL; ?>img/favicon.ico" height="25" width="25"> UnrealIRCd Admin Panel</a>
 <?php
 
 $active_page = NULL;
@@ -31,10 +34,14 @@ $active_page = NULL;
 foreach ($pages as $name => $page)
 {
        $script = $_SERVER['SCRIPT_FILENAME'];
-       if (str_ends_with($script, BASE_URL . "index.php") || !strlen($page))
-       {
+       $tok = split($script, "/");
+       if (strlen($page) == 0) {
                $active_page = "";
        }
+       else if (str_ends_with($script, BASE_URL . "index.php") && BASE_URL != "/" && !strlen($tok[0]))
+       {
+               $active_page = $tok[0];
+       }
        else if (!str_ends_with($page, ".php"))
        {
                $script2 = rtrim($script, "/index.php");