diff options
author | Minteck <contact@minteck.org> | 2023-02-22 10:29:48 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2023-02-22 10:29:48 +0100 |
commit | bf2558253637537c2d57765e557bdc0e164c58ee (patch) | |
tree | 9c50b253090001183ba574cc073d13f74e273758 /pages/byfront.inc | |
parent | 005bbb3c5b211dbb52cf8dcedac505f8a683cf42 (diff) | |
download | pluralconnect-bf2558253637537c2d57765e557bdc0e164c58ee.tar.gz pluralconnect-bf2558253637537c2d57765e557bdc0e164c58ee.tar.bz2 pluralconnect-bf2558253637537c2d57765e557bdc0e164c58ee.zip |
Updated 23 files, added assets/uploads/pt-princesscelestia.png and renamed assets/uploads/pt-luna.png (automated)
Diffstat (limited to 'pages/byfront.inc')
-rw-r--r-- | pages/byfront.inc | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/pages/byfront.inc b/pages/byfront.inc index 88da2f5..93fe3d5 100644 --- a/pages/byfront.inc +++ b/pages/byfront.inc @@ -90,12 +90,35 @@ $travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includ }))) ]; 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()): ?> - <div class="relation" style="background-color:<?php if ($member["_metadata"]["less_frequent"] || $member["_metadata"]["persecutor"]): ?><?php if ($member["_lastFronted"] > time() - (86400 * 21)): ?>rgba(255, 255, 255, .1)<?php else: ?><?php if ($member["_lastFronted"] > time() - (86400 * 37)): ?>rgba(255, 227, 0, 0.17)<?php else: ?>rgba(255,55,55,0.17)<?php endif; ?>;<?php endif; ?><?php else: ?><?php if ($member["_lastFronted"] > time() - (86400 * 21)): ?>rgba(255, 255, 255, .1)<?php else: ?><?php if ($member["_lastFronted"] > time() - (86400 * 30)): ?>rgba(255, 227, 0, 0.17)<?php else: ?>rgba(255,55,55,0.17)<?php endif; ?>;<?php endif; ?><?php endif; ?>;margin-bottom:10px;padding:10px;border-radius:10px;display:grid;grid-template-columns: 1fr 2fr max-content;<?php if ($travelling[$member['id']]["travelling"]): ?>opacity: 0.75;<?php endif; ?>"> + }); $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): ?> + <div class="relation" style="background-color:<?php if ($member["_metadata"]["less_frequent"] || $member["_metadata"]["persecutor"]): ?><?php if ($member["_lastFronted"] > time() - (86400 * 21)): ?>rgba(255, 255, 255, .1)<?php else: ?><?php if ($member["_lastFronted"] > time() - (86400 * 37)): ?>rgba(255, 227, 0, 0.17)rgba(128,54,54,0.17)<?php endif; ?>;<?php endif; ?><?php else: ?><?php if ($member["_lastFronted"] > time() - (86400 * 21)): ?>rgba(255, 255, 255, .1)<?php else: ?><?php if ($member["_lastFronted"] > time() - (86400 * 30)): ?>rgba(255, 227, 0, 0.17)<?php else: ?>rgba(255,55,55,0.17)<?php endif; ?>;<?php endif; ?><?php endif; ?>;margin-bottom:10px;padding:10px;border-radius:10px;display:grid;grid-template-columns: 1fr 2fr max-content;<?php if ($travelling[$member['id']]["travelling"]): ?>opacity: 0.75;<?php endif; ?><?php if (isset($member["_metadata"]["not_fronting"]) && $member["_metadata"]["not_fronting"]): ?>background-color:rgba(255, 255, 255, .1) !important;<?php endif; ?>"> <a class="relation-intro" style="background-color:rgba(255, 255, 255, .05);border-right:1px solid rgba(255, 255, 255, .1);margin:-10px;padding:10px;border-top-left-radius:10px;border-bottom-left-radius:10px;color: white;display:flex;align-items:center;text-decoration: none;" href="/<?= $member["name"] ?>"> <img src="<?= getAsset($member['system'], $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> <span style="display: inline-block;margin-left: auto;"> - <?php if ($member["_metadata"]["less_frequent"]): ?> + <?php if ($member["_metadata"]["not_fronting"]): ?> + <span class="badge bg-info rounded-pill text-black">No</span> + <?php endif; ?> + <?php if ($member["_metadata"]["less_frequent"] && !(isset($member["_metadata"]["not_fronting"]) && $member["_metadata"]["not_fronting"])): ?> <span class="badge bg-success rounded-pill">Less</span> <?php endif; ?> <?php if ($member["_metadata"]["persecutor"]): ?> @@ -121,7 +144,7 @@ $travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includ <?php endif; ?> </div> </div> - <?php endif; endforeach; ?> + <?php endif; endif; endforeach; ?> <style> @media (max-width: 991px) { |