summaryrefslogtreecommitdiff
path: root/includes/util/score.inc
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2023-11-17 23:25:29 +0100
committerRaindropsSys <raindrops@equestria.dev>2023-11-17 23:25:29 +0100
commit953ddd82e48dd206cef5ac94456549aed13b3ad5 (patch)
tree8f003106ee2e7f422e5a22d2ee04d0db302e66c0 /includes/util/score.inc
parent62a9199846b0c07c03218703b33e8385764f42d9 (diff)
downloadpluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.tar.gz
pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.tar.bz2
pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.zip
Updated 30 files and deleted 2976 files (automated)
Diffstat (limited to 'includes/util/score.inc')
-rw-r--r--includes/util/score.inc29
1 files changed, 29 insertions, 0 deletions
diff --git a/includes/util/score.inc b/includes/util/score.inc
index 9deacca..b70f866 100644
--- a/includes/util/score.inc
+++ b/includes/util/score.inc
@@ -56,6 +56,35 @@ function scoreOrderGlobal() {
global $isLoggedIn;
$ordered = [];
+
+ foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/hrbom/members.json"), true) 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")) {
+ if (isset($member["color"])) {
+ $rgb = [
+ hexdec(substr($member["color"], 0, 2)),
+ hexdec(substr($member["color"], 2, 2)),
+ hexdec(substr($member["color"], 4, 2))
+ ];
+ $hsl = rgbToHsl(
+ $rgb[0],
+ $rgb[1],
+ $rgb[2]
+ );
+ } else {
+ $rgb = [255, 255, 255];
+ $hsl = rgbToHsl(255, 255, 255);
+ }
+ $member["_score"] = $hsl[0];
+ $member["_system"] = "hrbom";
+ $member["system"] = "hrbom";
+ $member["_metadata"] = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true));
+
+ if (!isset($member["_metadata"]["private"]) || !$member["_metadata"]["private"] || $isLoggedIn || $isLowerLoggedIn) {
+ $ordered[] = $member;
+ }
+ }
+ }
+
foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true) 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")) {
if (isset($member["color"])) {