diff options
author | Minteck <contact@minteck.org> | 2022-10-10 20:51:39 +0200 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-10-10 20:51:39 +0200 |
commit | 108525534c28013cfe1897c30e4565f9893f3766 (patch) | |
tree | dd3e5132971f96ab5f05e7f3f8f6dbbf379a19bd /pages/nicknames.php | |
parent | 2162eaa06f7e4764eb3dcfe130ec2c711d0c62ab (diff) | |
download | pluralconnect-108525534c28013cfe1897c30e4565f9893f3766.tar.gz pluralconnect-108525534c28013cfe1897c30e4565f9893f3766.tar.bz2 pluralconnect-108525534c28013cfe1897c30e4565f9893f3766.zip |
Update
Diffstat (limited to 'pages/nicknames.php')
-rw-r--r-- | pages/nicknames.php | 115 |
1 files changed, 0 insertions, 115 deletions
diff --git a/pages/nicknames.php b/pages/nicknames.php deleted file mode 100644 index 4c06818..0000000 --- a/pages/nicknames.php +++ /dev/null @@ -1,115 +0,0 @@ -<?php - -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; - -$members = scoreOrderGlobal(); -$relations = []; - -foreach ($members as $member) { - foreach ([ - ...array_map(function ($i) { - $r = [ - "name" => $i - ]; - $r["type"] = "marefriends"; - return $r; - }, $member["_metadata"]["marefriends"] ?? []), - ...array_map(function ($i) { - $r = [ - "name" => $i - ]; - $r["type"] = "sisters"; - return $r; - }, $member["_metadata"]["sisters"] ?? []), - ...array_map(function ($i) { - $r = [ - "name" => $i - ]; - $r["type"] = "caretaking"; - return $r; - }, $member["_metadata"]["caretakers"] ?? []) - ] as $rel) { - $id = $rel["name"]; - $otherMember = getSystemMember(explode("/", $id)[0], explode("/", $id)[1]); - - $parts = [ - $member["id"], - $otherMember["id"] - ]; - - asort($parts); - - $relations[implode("-", $parts)] = [ - "id" => implode("", $parts), - "name" => getMiniName($member["display_name"] ?? $member["name"]) . " and " . getMiniName($otherMember["display_name"] ?? $otherMember["name"]), - "type" => $rel["type"], - "images" => [ - file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-$member[name].png") ? "/assets/uploads/pt-$member[name].png" : "/assets/uploads/pt.png", - file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-$otherMember[name].png") ? "/assets/uploads/pt-$otherMember[name].png" : "/assets/uploads/pt.png", - ] - ]; - } -} - -$nicknames = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/nicknames.json"), true); - -?> - -<br> -<div class="container"> - <div id="page-content"> - <h2>Relations nicknames</h2> - <?php foreach ($relations as $relation): ?> - <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 3fr;"> - <a class="relation-intro" title="<?= $relation["id"] ?>" data-bs-toggle="tooltip" 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;"> - <span style="vertical-align: middle;"><img src="<?= $relation["images"][0] ?>" style="width:24px;"><img src="<?= $relation["images"][1] ?>" style="width:24px;"></span> <span style="vertical-align: middle;"><?= $relation["name"] ?></span> - </a> - <div class="relation-item relation-item-marefriends" style="text-align:left;margin-left:10px;padding:0 20px;"> - <?php if (isset($nicknames[$relation["id"]])): ?> - "<?= implode('", "', $nicknames[$relation["id"]]) ?>" - <?php else: ?> - <span class="text-muted">No nickname for this relation</span> - <?php endif; ?> - </div> - </div> - <?php endforeach; ?> - </div> -</div> - -<style> - .relation-intro { - opacity: 1 !important; - } - - @media (max-width: 991px) { - .relation { - grid-template-columns: 1fr !important; - } - - .relation-intro { - text-align: center; - border-bottom-left-radius: 0 !important; - border-top-right-radius: 10px; - border-right: none !important; - border-bottom: 1px solid rgba(255, 255, 255, .1); - } - - .relation-item-marefriends { - margin-top: 20px !important; - text-align: center !important; - } - - .relation-item { - margin-top: 10px; - margin-left: 0 !important; - padding: 10px 0 !important; - } - } - - .relation-item { - text-align: center; - } -</style> - -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?> |