diff options
author | RaindropsSys <raindrops@equestria.dev> | 2024-03-29 22:05:35 +0100 |
---|---|---|
committer | RaindropsSys <raindrops@equestria.dev> | 2024-03-29 22:05:35 +0100 |
commit | 5860551daa0f60103ad24e93da29f401a653f144 (patch) | |
tree | 9ad97e04152a6edc11d5096c87880978df39086a /pages/byspecies.inc | |
parent | a51979ad60074db84af78a06d30fcb888ccb0b03 (diff) | |
download | pluralconnect-5860551daa0f60103ad24e93da29f401a653f144.tar.gz pluralconnect-5860551daa0f60103ad24e93da29f401a653f144.tar.bz2 pluralconnect-5860551daa0f60103ad24e93da29f401a653f144.zip |
Updated 20 files, added 6 files, deleted 144 files and renamed .idea/ponycule.iml (automated)
Diffstat (limited to 'pages/byspecies.inc')
-rw-r--r-- | pages/byspecies.inc | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/pages/byspecies.inc b/pages/byspecies.inc deleted file mode 100644 index 4a9ce66..0000000 --- a/pages/byspecies.inc +++ /dev/null @@ -1,97 +0,0 @@ -<?php global $system; global $systemCommonName; global $lang; global $pages; global $systemID; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:species"]["name"][$lang["_name"]]; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; global $travelling; global $isLowerLoggedIn; global $isLoggedIn; - -if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/species.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/species.json", "{}"); - -$cache = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/species.json"), true); - -function species(array $members, string $id, string $name) { global $systemID; global $travelling; ?> - <div class="relation" style="background-color:rgba(255, 255, 255, .1);margin-bottom:10px;padding:10px;border-radius:10px;display:grid;grid-template-columns: 1fr 4fr;"> - <div 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;text-decoration: none;"> - <img src="/assets/species/<?= $id ?>.png" style="width:24px;"><span class="species-name"> <?= $name ?></span> (<?= count($members) ?>) - </div> - - <div class="relation-item" style="margin-left:10px;padding:0 20px;"> - <?php if (count($members) > 0): ?> - <?php $index = 0; foreach ($members as $member): ?><a class="member-link" href="/<?= $member["name"] ?>"><img src="<?= getAsset($member["_system"], $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?></a><?php if ($index + 2 <= count($members)) echo('<span class="list-separator-desktop">, </span><span class="list-separator-mobile"><br></span>'); $index++; endforeach; ?> - <?php else: ?>-<?php endif; ?> - </div> - </div> -<?php } - -function page() { global $lang; - $members = scoreOrderGlobal(); - - $earth = []; - $pegasus = []; - $unicorn = []; - $alicorn = []; - $batpony = []; - $crystal = []; - $changeling = []; - $merpony = []; - $human = []; - $kirin = []; - $deer = []; - - foreach ($members as $member) { - foreach ($member["_metadata"]["species"] as $species) { - if ($species === "earth") $earth[] = $member; - if ($species === "pegasus") $pegasus[] = $member; - if ($species === "unicorn") $unicorn[] = $member; - if ($species === "alicorn") $alicorn[] = $member; - if ($species === "batpony") $batpony[] = $member; - if ($species === "crystal") $crystal[] = $member; - if ($species === "changeling") $changeling[] = $member; - if ($species === "human") $human[] = $member; - if ($species === "merpony") $merpony[] = $member; - if ($species === "kirin") $kirin[] = $member; - if ($species === "deer") $deer[] = $member; - } - } - - if (count($earth) > 0) species($earth, "earth", $lang["species"]["earth"][3]); - if (count($pegasus) > 0) species($pegasus, "pegasus", $lang["species"]["pegasus"][3]); - if (count($unicorn) > 0) species($unicorn, "unicorn", $lang["species"]["unicorn"][3]); - if (count($alicorn) > 0) species($alicorn, "alicorn", $lang["species"]["alicorn"][3]); - if (count($batpony) > 0) species($batpony, "batpony", $lang["species"]["batpony"][3]); - if (count($crystal) > 0) species($crystal, "crystal", $lang["species"]["crystal"][3]); - if (count($deer) > 0 ) species($deer, "deer", "Deers"); - if (count($kirin) > 0) species($kirin, "kirin", "Kirins"); - if (count($changeling) > 0) species($changeling, "changeling", "Changelings"); - if (count($merpony) > 0) species($merpony, "merpony", "Merponies"); - if (count($human) > 0) species($human, "human", "Humans"); -} - -?> - - <br> - <div class="container" id="page-content"> - <h2>Members by species</h2> - <?php if (!isset($cache["private"]) || !isset($cache["public"])) { - ob_start(); - $isLoggedInOldState = $isLoggedIn; - $isLowerLoggedInOldState = $isLowerLoggedIn; - $isLoggedIn = true; - $isLowerLoggedIn = true; - page(); - $isLoggedIn = $isLoggedInOldState; - $isLowerLoggedIn = $isLowerLoggedInOldState; - $cache["private"] = ob_get_contents(); - ob_end_clean(); - - ob_start(); - $isLoggedInOldState = $isLoggedIn; - $isLowerLoggedInOldState = $isLowerLoggedIn; - $isLoggedIn = false; - $isLowerLoggedIn = false; - page(); - $isLoggedIn = $isLoggedInOldState; - $isLowerLoggedIn = $isLowerLoggedInOldState; - $cache["public"] = ob_get_contents(); - ob_end_clean(); - } - - echo($isLoggedIn ? $cache["private"] : $cache["public"]); file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/species.json", json_encode($cache)); ?> - </div> - -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
\ No newline at end of file |