diff options
Diffstat (limited to 'includes/util/score.inc')
-rw-r--r-- | includes/util/score.inc | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/includes/util/score.inc b/includes/util/score.inc index 57c7a75..ad3c8e4 100644 --- a/includes/util/score.inc +++ b/includes/util/score.inc @@ -1,6 +1,9 @@ <?php function scoreOrder($members, $system, $useDominant = false) { + global $isLowerLoggedIn; + global $isLoggedIn; + $ordered = []; foreach ($members as $member) { if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_starts_with($member["name"], "smol") && !str_ends_with($member["name"], "-travelling") && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json")) { @@ -34,7 +37,10 @@ function scoreOrder($members, $system, $useDominant = false) { $member["_system"] = $member["system"] = $systemID; $member["_metadata"] = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); $member["_score"] = $hsl[0]; - $ordered[] = $member; + + if (!isset($member["_metadata"]["private"]) || !$member["_metadata"]["private"] || $isLoggedIn || $isLowerLoggedIn) { + $ordered[] = $member; + } } } @@ -71,7 +77,10 @@ function scoreOrderGlobal() { $member["_system"] = "gdapd"; $member["system"] = "gdapd"; $member["_metadata"] = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); - $ordered[] = $member; + + if (!isset($member["_metadata"]["private"]) || !$member["_metadata"]["private"] || $isLoggedIn || $isLowerLoggedIn) { + $ordered[] = $member; + } } } @@ -96,7 +105,10 @@ function scoreOrderGlobal() { $member["_system"] = "ynmuc"; $member["system"] = "ynmuc"; $member["_metadata"] = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); - $ordered[] = $member; + + if (!isset($member["_metadata"]["private"]) || !$member["_metadata"]["private"] || $isLoggedIn || $isLowerLoggedIn) { + $ordered[] = $member; + } } } |