From 6679588e43b0f694421d48e4ddb071972a127dca Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Sun, 11 Jun 2023 16:47:34 +0200 Subject: Updated 11 files and added 2 files (automated) --- pages/evening.inc | 262 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 262 insertions(+) create mode 100644 pages/evening.inc (limited to 'pages/evening.inc') diff --git a/pages/evening.inc b/pages/evening.inc new file mode 100644 index 0000000..6f9e7b8 --- /dev/null +++ b/pages/evening.inc @@ -0,0 +1,262 @@ + 0) { + $thisIndex = array_search($thisMember[0], $switches); + + $frontingStart = $thisMember[0]; + $frontingEnd = $switches[$thisIndex - 1]; + } + + if ($frontingEnd !== null && isset($frontingStart)) { + $i["_lastFronted"] = strtotime($frontingEnd["timestamp"]); + } + } + + return $i; + }, array_values(array_filter(scoreOrderGlobal(), function ($i) { + return $i["_system"] === "ynmuc"; + }))), + ...array_map(function ($i) { + $system = "gdapd"; + $i["_lastFronted"] = -1; + $id = $i["id"]; + $memberData = $i; + + $fronters = array_map(function ($item) { + return $item["id"]; + }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json"), true)["members"]); + + if (in_array($id, $fronters)) { + $i["_lastFronted"] = time(); + } else { + $switches = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/switches.json"), true); + + $thisMember = array_filter($switches, function ($item) use ($memberData) { + return in_array($memberData["id"], $item["members"]); + }); + + $thisMember = array_values($thisMember); + $frontingEnd = null; + + if (count($thisMember) > 0) { + $thisIndex = array_search($thisMember[0], $switches); + + $frontingStart = $thisMember[0]; + $frontingEnd = $switches[$thisIndex - 1]; + } + + if ($frontingEnd !== null && isset($frontingStart)) { + $i["_lastFronted"] = strtotime($frontingEnd["timestamp"]); + } + } + + return $i; + }, array_values(array_filter(scoreOrderGlobal(), function ($i) { + return $i["_system"] === "gdapd"; + }))) + ]; + + ?> + + + +
+
+
+

= 1686787200 ? "" : " (Beta)" ?>

+ +
+ The evening schedule will replace the fronting schedule starting June 15th. The fronting schedule page contains more information and shows the schedule up to that date. The evening schedule is experimental until then. +
+ +
+ +

Click on the "Ignore" button to mark an evening as ignored and shift the schedule one day after. You can revert this by clicking on "Unignore".

+
+
    + +
  • + + "> + + with + + "> + + () +
  • + +
+
+ + = 1686787200): ?> +

+
+
+
+ + ">">
+ +
+
+
+
+ + ">">
+ +
+
+
+ +
+
+ + Unignore + + Ignore + +
+
+ " : "" ?> + +
+
+ + + -- cgit