summaryrefslogtreecommitdiff
path: root/pages/byfront.inc
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2024-01-13 16:12:11 +0100
committerRaindropsSys <raindrops@equestria.dev>2024-01-13 16:12:11 +0100
commit2b192b3840ac344c456b98304ea400f0af90da15 (patch)
tree081ba8cbc0add17f08c9b94fb4a830834d87c259 /pages/byfront.inc
parent2bfdb0ab2e366007269d1b77446f1581801e05dc (diff)
downloadpluralconnect-2b192b3840ac344c456b98304ea400f0af90da15.tar.gz
pluralconnect-2b192b3840ac344c456b98304ea400f0af90da15.tar.bz2
pluralconnect-2b192b3840ac344c456b98304ea400f0af90da15.zip
Updated 46 files and deleted 19 files (automated)
Diffstat (limited to 'pages/byfront.inc')
-rw-r--r--pages/byfront.inc43
1 files changed, 2 insertions, 41 deletions
diff --git a/pages/byfront.inc b/pages/byfront.inc
index beb9275..0974091 100644
--- a/pages/byfront.inc
+++ b/pages/byfront.inc
@@ -12,52 +12,13 @@ global $app; global $_PROFILE;
<h2>Members by last fronted</h2>
<select id="selected-system" class="form-select" style="margin-bottom: 20px;" onchange="refreshList()">
<option value="gdapd" <?= $_PROFILE["login"] === "raindrops" ? "select" : "" ?>>Raindrops System</option>
- <option value="hrbom" <?= $_PROFILE["login"] === "Moonwind" ? "select" : "" ?>>Moonglow</option>
- <option value="<?= $app["other"]["id"] ?>" <?= $_PROFILE["login"] !== "raindrops" && $_PROFILE["login"] !== "cloudburst" && $_PROFILE["login"] !== "Moonwind" ? "select" : "" ?>><?= $app["other"]["name"] ?></option>
- <option value="ynmuc" <?= $_PROFILE["login"] === "cloudburst" ? "select" : "" ?>>Cloudburst System</option>
+ <option value="hrbom" <?= $_PROFILE["login"] === "Moonglow" ? "select" : "" ?>>Moonglow</option>
+ <option value="<?= $app["other"]["id"] ?>" <?= $_PROFILE["login"] === $app["other"]["user"] ? "select" : "" ?>><?= $app["other"]["name"] ?></option>
<option value="">(all systems)</option>
</select>
<?php $members = [
...array_map(function ($i) {
- $system = "ynmuc";
- $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"] === "ynmuc";
- }))),
- ...array_map(function ($i) {
$system = "gdapd";
$i["_lastFronted"] = -1;
$id = $i["id"];