From 46251292b5c8b431de66aeff473594ccec60e04c Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Thu, 20 Jul 2023 18:29:09 +0200 Subject: Updated 19 files and added 26 files (automated) --- includes/fragments/evening.inc | 245 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 245 insertions(+) create mode 100644 includes/fragments/evening.inc (limited to 'includes/fragments/evening.inc') diff --git a/includes/fragments/evening.inc b/includes/fragments/evening.inc new file mode 100644 index 0000000..851b69f --- /dev/null +++ b/includes/fragments/evening.inc @@ -0,0 +1,245 @@ + 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"; + }))) + ]; global $pages; global $lang; global $use2023UI; global $ignored; ?> + + + +
+
+ +

Evening schedule

+ +

Evening schedule

+ + + +
+ 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".

+
+
    + 0) $times[] = getLastFronted($members, $id); + } + foreach ($a[1] as $id) { + if (getLastFronted($members, $id) > 0) $times[] = getLastFronted($members, $id); + } + + $timeA = time() - min($times); + $times = []; + + foreach ($b[0] as $id) { + if (getLastFronted($members, $id) > 0) $times[] = getLastFronted($members, $id); + } + foreach ($b[1] as $id) { + if (getLastFronted($members, $id) > 0) $times[] = getLastFronted($members, $id); + } + + $timeB = time() - min($times); + + return $timeB - $timeA; + }); $pairs = array_values($pairs); foreach ($pairs as $pair): $times = []; ?> +
  • + + "> + + with + + "> + + () +
  • + +
+
+ + = 1686787200): ?> + +
+ +

+ +
+
+
+ + ">">
+ +
+
+
+
+ + ">">
+ +
+
+
+ 0) $times[] = getLastFronted($members, $id); + } + foreach ($pair[1] as $id) { + if (getLastFronted($members, $id) > 0) $times[] = getLastFronted($members, $id); + } + + $time = time() - min($times); + echo(timeAgo(time() - $time)); + + ?> +
+
+ + " class="btn btn-outline-secondary">Unlock + + " class="btn btn-outline-primary">Lock +    + + ">Unignore + + ">Ignore + +
+
+ " : "" ?> + +
+
+ \ No newline at end of file -- cgit