Members by last fronted
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";
})))
]; uasort($members, function ($a, $b) {
return $b["_lastFronted"] - $a["_lastFronted"];
}); $members = array_reverse($members); foreach ($members as $member): if ($member["_lastFronted"] !== -1 && $member["_lastFronted"] !== time()):
$metadata = $member["_metadata"];
if (!isset($metadata["birth"]["year"]) || $metadata["birth"]["age"] > 0) {
if ($metadata["birth"]["age"] === -1) {
$age = abs(log(0));
} elseif ($metadata["birth"]["age"] <= 0) {
$age = null;
} else {
$age = $metadata["birth"]["age"];
}
} else {
if ($metadata["birth"]["year"] <= 1900) {
$age = null;
} else {
$age = (int)date('Y') - $metadata["birth"]["year"] + (strtotime(date('Y') . "-" . $metadata["birth"]["date"]) <= time() ? 0 : -1);
}
}
if (isset($age) && $age > 0 && time() > 1677628800): ?>
time() - (86400 * 21)): ?>rgba(255, 255, 255, .1) time() - (86400 * 37)): ?>rgba(255, 227, 0, 0.17)rgba(128,54,54,0.17); time() - (86400 * 21)): ?>rgba(255, 255, 255, .1) time() - (86400 * 30)): ?>rgba(255, 227, 0, 0.17)rgba(255,55,55,0.17);;margin-bottom:10px;padding:10px;border-radius:10px;display:grid;grid-template-columns: 1fr 2fr max-content;opacity: 0.75;background-color:rgba(255, 255, 255, .1) !important;">
">
" style="width:24px;"> = $member["display_name"] ?? $member["name"] ?>
No
Less
Persecutor
Memory
Travelling
Must front
Never fronted
Last fronted = timeAgo($member["_lastFronted"]) ?> (= date('l j F Y', $member["_lastFronted"]) ?>)