X-Git-Url: https://jfr.im/git/irc/unrealircd/unrealircd-webpanel.git/blobdiff_plain/2751c89de179262a3a8f068df53daad5512c0dab..c06c1713af2db485d55a91073bbc5b63b6aa8c0b:/users/index.php diff --git a/users/index.php b/users/index.php index ceea6e9..2e8cf75 100644 --- a/users/index.php +++ b/users/index.php @@ -1,7 +1,7 @@ Nick - Country + Country Host / IP - Account - Usermodes ℹ️ + Account + Usermodes ℹ️ Oper Secure Connected to - Reputation ℹ️ + Rep. ℹ️ @@ -200,12 +200,18 @@ Click on a username to view more information. echo ""; $isBot = (strpos($user->user->modes, "B") !== false) ? ' Bot' : ""; echo "id."\">$user->name$isBot"; - echo "".(isset($user->geoip->country_code) ? ' '.$user->geoip->country_code : "").""; - echo "".htmlspecialchars($user->hostname)." (".($user->hostname == $user->ip ? 'the same' : htmlspecialchars($user->ip ?? "None")).")"; + echo "".(isset($user->geoip->country_code) ? ' '.$user->geoip->country_code : "").""; + if ($user->hostname == $user->ip) + $hostip = $user->ip; + else if ($user->ip == null) + $hostip = $user->hostname; + else + $hostip = $user->hostname . " (".$user->ip.")"; + echo "".htmlspecialchars($hostip).""; $account = (isset($user->user->account)) ? "user->account."\">".htmlspecialchars($user->user->account)."" : 'None'; - echo "".$account.""; + echo "".$account.""; $modes = (isset($user->user->modes)) ? "+" . $user->user->modes : ""; - echo "".$modes.""; + echo "".$modes.""; $oper = (isset($user->user->operlogin)) ? $user->user->operlogin." ".$user->user->operclass."" : ""; if (!strlen($oper)) $oper = (strpos($user->user->modes, "S") !== false) ? 'Services Bot' : ""; @@ -216,7 +222,7 @@ Click on a username to view more information. $secure = ""; echo "".$secure.""; echo "id, 0, 3)."\">".$user->user->servername.""; - echo "".$user->user->reputation.""; + echo "".$user->user->reputation.""; echo ""; $currentNumberUsers++; if (isset($user->user->account)) @@ -374,14 +380,67 @@ Click on a username to view more information. function resize_check() { var width = window.innerWidth; - var elements = document.querySelectorAll('.hostname, .opercol, .uplinkcol, .securecol'); - var show = ''; - if (width < 900) - show = 'none'; + var show_elements = ''; + var hide_elements = ''; + if (width < 500) + { + show_elements = ''; + hide_elements = '.hostname, .opercol, .uplinkcol, .securecol, .umodescol, .countrycol'; + } else + if (width < 600) + { + 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 = ''; + } - for (let i = 0; i < elements.length; i++) - elements[i].style.display = show; + if (show_elements != '') + { + show_elements=document.querySelectorAll(show_elements); + for (let i = 0; i < show_elements.length; i++) + show_elements[i].style.display = ''; + } + if (hide_elements != '') + { + hide_elements=document.querySelectorAll(hide_elements); + for (let i = 0; i < hide_elements.length; i++) + hide_elements[i].style.display = 'none'; + } } resize_check(); window.addEventListener('resize', function() { @@ -417,4 +476,4 @@ Click on a username to view more information. }); - +