diff options
author | RaindropsSys <contact@minteck.org> | 2023-03-25 16:01:48 +0100 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-03-25 16:01:48 +0100 |
commit | bbf526b19c9831349a3b836f83b63363e6b33609 (patch) | |
tree | d75c5b9bcfbd73f642017c294807a997711ef479 /includes/util/score.inc | |
parent | 609dc69c1332813c3a367e184663e498c4f559ff (diff) | |
download | pluralconnect-bbf526b19c9831349a3b836f83b63363e6b33609.tar.gz pluralconnect-bbf526b19c9831349a3b836f83b63363e6b33609.tar.bz2 pluralconnect-bbf526b19c9831349a3b836f83b63363e6b33609.zip |
Updated 7 files (automated)
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; + } } } |