]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blobdiff - users/index.php
Move some PHP files from ./ to ./inc: common, connection, header, footer
[irc/unrealircd/unrealircd-webpanel.git] / users / index.php
index b172dcc2ff4d81748fad852fe762e9422defd402..2e8cf752fa8914fc1ad27bf0c02a3b495b8b153c 100644 (file)
@@ -1,7 +1,7 @@
 <?php
-require_once "../common.php";
-require_once "../connection.php";
-require_once "../header.php";
+require_once "../inc/common.php";
+require_once "../inc/connection.php";
+require_once "../inc/header.php";
 
 if (!empty($_GET))
 {
@@ -201,7 +201,13 @@ Click on a username to view more information.
                        $isBot = (strpos($user->user->modes, "B") !== false) ? ' <span class="badge rounded-pill badge-dark">Bot</span>' : "";
                        echo "<td><a href=\"details.php?nick=".$user->id."\">$user->name$isBot</a></td>";
                        echo "<td class=\"countrycol\">".(isset($user->geoip->country_code) ? '<img src="https://flagcdn.com/48x36/'.htmlspecialchars(strtolower($user->geoip->country_code)).'.png" width="20" height="15"> '.$user->geoip->country_code : "")."</td>";
-                       echo "<td class=\"hostname\">".htmlspecialchars($user->hostname)." (".($user->hostname == $user->ip ? 'the same' : htmlspecialchars($user->ip ?? "None")).")</td>";
+                       if ($user->hostname == $user->ip)
+                               $hostip = $user->ip;
+                       else if ($user->ip == null)
+                               $hostip = $user->hostname;
+                       else
+                               $hostip = $user->hostname . " (".$user->ip.")";
+                       echo "<td class=\"hostname\">".htmlspecialchars($hostip)."</td>";
                        $account = (isset($user->user->account)) ? "<a href=\"".get_config("base_url")."users/?account=".$user->user->account."\">".htmlspecialchars($user->user->account)."</a>" : '<span class="badge rounded-pill badge-primary">None</span>';
                        echo "<td class=\"accountcol\">".$account."</td>";
                        $modes = (isset($user->user->modes)) ? "+" . $user->user->modes : "<none>";
@@ -376,37 +382,50 @@ Click on a username to view more information.
                var width = window.innerWidth;
                var show_elements = '';
                var hide_elements = '';
-               //alert(width);
                if (width < 500)
                {
                        show_elements = '';
                        hide_elements = '.hostname, .opercol, .uplinkcol, .securecol, .umodescol, .countrycol';
                } else
+               if (width < 600)
                {
-                       if (width < 900)
-                       {
-                               show_elements = '.countrycol';
-                               hide_elements = '.hostname, .opercol, .uplinkcol, .securecol, .umodescol';
-                       } else if (width < 1000)
-                       {
-                               show_elements = '.securecol, .umodescol, .countrycol';
-                               hide_elements = '.hostname, .uplinkcol, .opercol';
-                       } else if (width < 1200)
-                       {
-                               show_elements = '.opercol, .securecol, .umodescol, .countrycol';
-                               hide_elements = '.hostname, .uplinkcol';
-                       } else if (width < 1550)
-                       {
-                               show_elements = '.opercol, .uplinkcol, .securecol, .umodescol, .countrycol';
-                               hide_elements = '.hostname';
-                       } else if (width < 1750)
-                       {
-                               show_elements = '.hostname, .opercol, .securecol, .umodescol, .countrycol';
-                               hide_elements = '.uplinkcol';
-                       } else {
-                               show_elements = '.hostname, .opercol, .uplinkcol, .securecol, .umodescol, .countrycol';
-                               hide_elements = '';
-                       }
+                       show_elements = '.countrycol';
+                       hide_elements = '.hostname, .opercol, .uplinkcol, .securecol, .umodescol';
+               } else
+               if (width < 700)
+               {
+                       show_elements = '.umodescol, .countrycol';
+                       hide_elements = '.hostname, .opercol, .uplinkcol, .securecol';
+               } else
+               if (width < 768)
+               {
+                       show_elements = '.securecol, .umodescol, .countrycol';
+                       hide_elements = '.hostname, .opercol, .uplinkcol';
+               } else
+               if (width < 875)
+               {
+                       // left nav kicks in at 768+ so need to drop one column between 768..875
+                       show_elements = '.umodescol, .countrycol';
+                       hide_elements = '.hostname, .opercol, .uplinkcol, .securecol';
+               } else if (width < 1000)
+               {
+                       show_elements = '.securecol, .umodescol, .countrycol';
+                       hide_elements = '.hostname, .uplinkcol, .opercol';
+               } else if (width < 1200)
+               {
+                       show_elements = '.opercol, .securecol, .umodescol, .countrycol';
+                       hide_elements = '.hostname, .uplinkcol';
+               } else if (width < 1550)
+               {
+                       show_elements = '.opercol, .uplinkcol, .securecol, .umodescol, .countrycol';
+                       hide_elements = '.hostname';
+               } else if (width < 1750)
+               {
+                       show_elements = '.hostname, .opercol, .securecol, .umodescol, .countrycol';
+                       hide_elements = '.uplinkcol';
+               } else {
+                       show_elements = '.hostname, .opercol, .uplinkcol, .securecol, .umodescol, .countrycol';
+                       hide_elements = '';
                }
 
                if (show_elements != '')
@@ -457,4 +476,4 @@ Click on a username to view more information.
 });
 </script>
 
-<?php require_once UPATH.'/footer.php'; ?>
+<?php require_once UPATH.'/inc/footer.php'; ?>