summaryrefslogtreecommitdiff
path: root/pages/nicknames.inc
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2023-02-23 19:34:56 +0100
committerMinteck <contact@minteck.org>2023-02-23 19:34:56 +0100
commit3d1cd02f27518f1a04374c7c8320cd5d82ede6e9 (patch)
tree75be5fba4368472fb11c8015aee026b2b9a71888 /pages/nicknames.inc
parent8cc1f13c17fa2fb5a4410542d39e650e02945634 (diff)
downloadpluralconnect-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 'pages/nicknames.inc')
-rw-r--r--pages/nicknames.inc115
1 files changed, 0 insertions, 115 deletions
diff --git a/pages/nicknames.inc b/pages/nicknames.inc
deleted file mode 100644
index 2799703..0000000
--- a/pages/nicknames.inc
+++ /dev/null
@@ -1,115 +0,0 @@
-<?php
-
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
-
-$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" => [
- getAsset($member['system'], $member["id"], "heads"),
- getAsset($otherMember['system'], $otherMember["id"], "heads")
- ]
- ];
- }
-}
-
-$nicknames = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/nicknames/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.inc'; ?>