diff options
author | RaindropsSys <contact@minteck.org> | 2023-03-25 16:01:48 +0100 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-03-25 16:01:48 +0100 |
commit | bbf526b19c9831349a3b836f83b63363e6b33609 (patch) | |
tree | d75c5b9bcfbd73f642017c294807a997711ef479 /includes | |
parent | 609dc69c1332813c3a367e184663e498c4f559ff (diff) | |
download | pluralconnect-bbf526b19c9831349a3b836f83b63363e6b33609.tar.gz pluralconnect-bbf526b19c9831349a3b836f83b63363e6b33609.tar.bz2 pluralconnect-bbf526b19c9831349a3b836f83b63363e6b33609.zip |
Updated 7 files (automated)
Diffstat (limited to 'includes')
-rw-r--r-- | includes/components/pane.inc | 1 | ||||
-rw-r--r-- | includes/flags.json | 1 | ||||
-rw-r--r-- | includes/fragments/member.inc | 102 | ||||
-rw-r--r-- | includes/util/score.inc | 18 | ||||
-rw-r--r-- | includes/util/short.inc | 3 |
5 files changed, 103 insertions, 22 deletions
diff --git a/includes/components/pane.inc b/includes/components/pane.inc index 8a18407..eb735f5 100644 --- a/includes/components/pane.inc +++ b/includes/components/pane.inc @@ -114,6 +114,7 @@ foreach ($list as $color) { padding: 10px; display: block; border-bottom: 1px solid rgba(255, 255, 255, .25); + height: 47px; } .login-link-clickable { diff --git a/includes/flags.json b/includes/flags.json index 2b3f558..4c789da 100644 --- a/includes/flags.json +++ b/includes/flags.json @@ -20,6 +20,7 @@ "less_frequent": "!!Fronts less frequently", "not_fronting": "!!Doesn't front evenly", "persecutor": "!!Persecutor", + "private": "Hide from public listings", "pacifier": "Sleeps with pacifier", "other": "Having sex with %other%", "other2": "Potentially having sex with %other%", diff --git a/includes/fragments/member.inc b/includes/fragments/member.inc index 1d9530c..f1169c8 100644 --- a/includes/fragments/member.inc +++ b/includes/fragments/member.inc @@ -1,4 +1,6 @@ -<?php global $system; global $systemCommonName; global $systemID; global $member; global $memberData; global $memberCommonName; global $memberID; global $lang; global $pages; global $app; +<?php global $system; global $systemCommonName; global $systemID; global $member; global $memberData; global $memberCommonName; global $memberID; global $lang; global $pages; global $app; global $isLoggedIn; global $isLowerLoggedIn; + +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; if ($memberData["name"] === "fusion") { $title = ($memberCommonName === "fusion" ? $lang["member"]["merge"] : $memberCommonName); @@ -6,6 +8,14 @@ if ($memberData["name"] === "fusion") { $title = $memberCommonName . " ยท " . $systemCommonName; } +if ($memberData["name"] !== "unknown" && $memberData["name"] !== "fusion") { + $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json"), true)); + + if ($metadata["private"] && !$isLoggedIn && !$isLowerLoggedIn) { + peh_error("Page not found: " . strip_tags($member), 404); + } +} + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; $travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json"), true); @@ -141,26 +151,82 @@ if ($memberData["name"] === "fusion") { </li> <li><b>Date added:</b> <?= date('l j F Y', strtotime($memberData["created"])) ?> (<?= timeAgo($memberData["created"]) ?>, <code><?= $memberData["created"] ?></code>)</li> <li><b>Pronouns:</b> <?= $memberData['pronouns'] ?></li> - <li><b>Pronouns usage:</b> <ul><?php - - foreach (getMemberPronouns($memberData['pronouns']) as $type => $usage) { - if (is_string($usage) && $type !== "color") { - echo("<li><b>" . $type . ":</b> " . $usage . "</li>"); - } - } - - ?></ul></li> <li><b>Color:</b> <span style="border:1px solid rgba(255, 255, 255, .5);background-color:#<?= $memberData["color"] ?? "ffffff" ?>;display:inline-block;width:16px;height:16px;border-radius:5px;vertical-align: middle;filter: invert(1) hue-rotate(180deg);"></span> <span style="vertical-align: middle;"><code>#<?= $memberData["color"] ?? "ffffff" ?></code></span> - <li><b>Bitset:</b><?php if (isset($metadata["bitset"])): ?> <code><?= str_repeat("0", 48 - strlen(decbin($metadata["bitset"]))) . decbin($metadata["bitset"]) ?></code> (0x<?= str_repeat("0", 12 - strlen(dechex($metadata["bitset"]))) . dechex($metadata["bitset"]) ?>, <?= $metadata["bitset"] ?>)</li><?php else: ?> <span class="text-warning" style="filter:invert(1) hue-rotate(180deg);">Not using bitset; please update.</span><?php endif; ?> <li><b>Reduced name:</b> <?= getMiniName($memberData["display_name"] ?? $member["name"]) ?></li> - <li><b>Shared memory access:</b> <code><?= $metadata["shared_memory"] ?></code> (<?= $metadata["shared_memory"] === 2 ? "Full direct access" : ($metadata["shared_memory"] === 0 ? "No direct access" : "Partial direct access") ?>)</li> - <li><b>Protector:</b> <code><?= $metadata["protector"] ? "1" : "0" ?></code> (<?= $metadata["protector"] ? "Yes" : "No" ?>)</li> - <li><b>Little:</b> <code><?= $metadata["little"] ?></code> (<?= $metadata["little"] === 2 ? "Is a little" : ($metadata["little"] === 1 ? "Is an age regressor" : ($metadata["little"] === 3 ? "Not a little, but younger" : "No")) ?>)</li> - <li><b>Relations count:</b> <code><?= count($metadata["marefriends"]) + count($metadata["sisters"]) ?></code></li> - <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/score.inc"; ?> <li> - <b>Score breakdown:</b> <code>-</code> - <ul><li>-</ul></li> + <b>Metadata:</b> + <ul> + <?php foreach (parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$memberID.json"), true)) as $name => $value): ?> + <li> + <b><?= $name ?></b>: <?php + + if (is_bool($value)) { + echo($value ? "true" : "false"); + } else if (is_numeric($value)) { + echo((string)$value); + } else if (is_string($value)) { + echo("\"$value\""); + } else if (is_null($value)) { + echo("null"); + } else if (is_array($value) && array_keys($value) !== array_keys(array_keys($value))) { // Is associative ?> + <ul> + <?php foreach ($value as $name2 => $value2): ?> + <li> + <b><?= $name2 ?></b>: <?php + + if (is_bool($value2)) { + echo($value2 ? "true" : "false"); + } else if (is_numeric($value2)) { + echo((string)$value2); + } else if (is_string($value2)) { + echo("\"$value2\""); + } else if (is_null($value2)) { + echo("null"); + } else if (is_array($value2)) { + echo("Array"); + } else { + var_dump($value2); + } + + ?> + </li> + <?php endforeach; ?> + </ul><?php + } else if (is_array($value) && array_keys($value) === array_keys(array_keys($value))) { // Is indexes ?> + <ul> + <?php foreach ($value as $value2): ?> + <li> + <?php + + if (is_bool($value2)) { + echo($value2 ? "true" : "false"); + } else if (is_numeric($value2)) { + echo((string)$value2); + } else if (is_string($value2)) { + echo("\"$value2\""); + } else if (is_null($value2)) { + echo("null"); + } else if (is_array($value2)) { + echo("Array"); + } else { + var_dump($value2); + } + + ?> + </li> + <?php endforeach; ?> + </ul><?php + } else if (is_array($value) && count($value) === 0) { + echo("[]"); + } else { + var_dump($value); + } + + ?> + </li> + <?php endforeach; ?> + </ul> + </li> </ul> </div> </details> diff --git a/includes/util/score.inc b/includes/util/score.inc index 57c7a75..ad3c8e4 100644 --- a/includes/util/score.inc +++ b/includes/util/score.inc @@ -1,6 +1,9 @@ <?php function scoreOrder($members, $system, $useDominant = false) { + global $isLowerLoggedIn; + global $isLoggedIn; + $ordered = []; foreach ($members as $member) { if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_starts_with($member["name"], "smol") && !str_ends_with($member["name"], "-travelling") && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json")) { @@ -34,7 +37,10 @@ function scoreOrder($members, $system, $useDominant = false) { $member["_system"] = $member["system"] = $systemID; $member["_metadata"] = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); $member["_score"] = $hsl[0]; - $ordered[] = $member; + + if (!isset($member["_metadata"]["private"]) || !$member["_metadata"]["private"] || $isLoggedIn || $isLowerLoggedIn) { + $ordered[] = $member; + } } } @@ -71,7 +77,10 @@ function scoreOrderGlobal() { $member["_system"] = "gdapd"; $member["system"] = "gdapd"; $member["_metadata"] = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); - $ordered[] = $member; + + if (!isset($member["_metadata"]["private"]) || !$member["_metadata"]["private"] || $isLoggedIn || $isLowerLoggedIn) { + $ordered[] = $member; + } } } @@ -96,7 +105,10 @@ function scoreOrderGlobal() { $member["_system"] = "ynmuc"; $member["system"] = "ynmuc"; $member["_metadata"] = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); - $ordered[] = $member; + + if (!isset($member["_metadata"]["private"]) || !$member["_metadata"]["private"] || $isLoggedIn || $isLowerLoggedIn) { + $ordered[] = $member; + } } } diff --git a/includes/util/short.inc b/includes/util/short.inc index 39e42b0..c226e3b 100644 --- a/includes/util/short.inc +++ b/includes/util/short.inc @@ -12,13 +12,14 @@ $list = [ "rd" => "/raindrops", "cb" => "/cloudburst", "minty" => "/cloudydreams", + "violetdawn" => "/sandydawn", "twilight" => "/twi", "luna" => "/princessluna", "cloudy" => "/cloudydreams", "zipp" => "/zippstorm", "babs" => "/babsseed", "frost" => "/frostcrystals", - "violet" => "/violetdawn" + "violet" => "/sandydawn" ]; foreach ($members as $member) { |