diff options
author | Minteck <contact@minteck.org> | 2023-02-23 19:34:56 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2023-02-23 19:34:56 +0100 |
commit | 3d1cd02f27518f1a04374c7c8320cd5d82ede6e9 (patch) | |
tree | 75be5fba4368472fb11c8015aee026b2b9a71888 /includes/system/species.inc | |
parent | 8cc1f13c17fa2fb5a4410542d39e650e02945634 (diff) | |
download | pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.gz pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.bz2 pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.zip |
Updated 40 files, added 37 files, deleted 1103 files and renamed 3905 files (automated)
Diffstat (limited to 'includes/system/species.inc')
-rw-r--r-- | includes/system/species.inc | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/includes/system/species.inc b/includes/system/species.inc deleted file mode 100644 index b5fdee6..0000000 --- a/includes/system/species.inc +++ /dev/null @@ -1,72 +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"]] . " ยท " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $travelling; - -$members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true); -$members = scoreOrder($members, $systemID); - -function species(array $members, string $id, string $name) { global $systemID; global $travelling; ?> - <?php - - $members = [ - ...array_map(function ($i) use ($systemID) { $i["_system"] = $systemID; return $i; },array_filter($members, function ($i) use ($systemID) { - global $travelling; - return !($travelling[$i['id']]['travelling'] || (isset($travelling[$i['id']]['equestria']) && $travelling[$i['id']]['equestria'])); - })), - ...array_map(function ($i) use ($systemID) { $i["_system"] = $systemID === "gdapd" ? "ynmuc" : "gdapd"; return $i; }, array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true), function ($i) use ($id, $systemID) { - global $travelling; - return $travelling[$i['id']]['travelling'] && !$travelling[$i['id']]['equestria'] && in_array($id, parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $i['id'] . ".json"), true))["species"]); - })) - ]; - - ?> - <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;"> <?= getMiniName($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 } - -?> - - <br> - <div class="container" id="page-content"> - <h2><?= str_replace("%1", $systemCommonName, $lang["species_compare"]["title"]) ?></h2> - <?php - - $earth = []; - $pegasus = []; - $unicorn = []; - $alicorn = []; - $batpony = []; - $crystal = []; - $changeling = []; - - 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; - } - } - - ?> - - <?php species($earth, "earth", $lang["species"]["earth"][3]); ?> - <?php species($pegasus, "pegasus", $lang["species"]["pegasus"][3]); ?> - <?php species($unicorn, "unicorn", $lang["species"]["unicorn"][3]); ?> - <?php species($alicorn, "alicorn", $lang["species"]["alicorn"][3]); ?> - <?php species($batpony, "batpony", $lang["species"]["batpony"][3]); ?> - <?php species($crystal, "crystal", $lang["species"]["crystal"][3]); ?> - <?php species($changeling, "changeling", "Changelings"); ?> - </div> - -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
\ No newline at end of file |