From 089d94ff3a34ef022015bf28db0427497acc67ea Mon Sep 17 00:00:00 2001 From: Minteck Date: Sat, 28 Jan 2023 20:31:04 +0100 Subject: Updated 7 files and renamed 2 files (automated) --- includes/banner.inc | 25 +++++++++++++++++++++++++ includes/bitset.inc | 3 +++ includes/details.inc | 4 ++-- includes/fullbanner.inc | 2 +- includes/metadata.inc | 4 ++++ 5 files changed, 35 insertions(+), 3 deletions(-) (limited to 'includes') diff --git a/includes/banner.inc b/includes/banner.inc index cbae0b2..341b4e7 100644 --- a/includes/banner.inc +++ b/includes/banner.inc @@ -59,6 +59,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { "regression" => null, "median" => null, "marefriends" => [], + "sexfriends" => [], "sisters" => [], "caretakers" => [] ]); @@ -235,6 +236,29 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { ]; } + $sexfriends = null; + + if ($isLoggedIn) { + $sexfriends = []; + foreach ($metadata["sexfriends"] as $marefriend) { + $mfSystem = explode("/", $marefriend)[0]; + $mfMemberID = explode("/", $marefriend)[1]; + $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem/members.json"), true), function ($item) use ($mfMemberID) { + return $item["id"] === $mfMemberID; + }); + sort($mfMember); + $mfMember = $mfMember[0]; + + $sexfriends[] = [ + "id" => $marefriend, + "link" => "/" . ($mfMember["name"]), + "icon" => getAsset($mfSystem, $mfMemberID, "heads"), + "name" => getMiniName($mfMember["display_name"] ?? $mfMember["name"]), + "full_name" => $mfMember["display_name"] ?? $mfMember["name"] + ]; + } + } + $sisters = []; foreach ($metadata["sisters"] as $marefriend) { $mfSystem = explode("/", $marefriend)[0]; @@ -488,6 +512,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { 'system' => $systemData, 'relations' => [ 'marefriends' => $marefriends ?? [], + 'sexfriends' => $sexfriends ?? null, 'sisters' => $sisters ?? [], 'caretakers' => $caretakers ?? [] ] diff --git a/includes/bitset.inc b/includes/bitset.inc index 955d953..f8ac366 100644 --- a/includes/bitset.inc +++ b/includes/bitset.inc @@ -10,6 +10,7 @@ function parseBitset ($bitset) { $lessFrequent = substr($bin, 14, 1) !== "0"; $sexuallyActive = substr($bin, 13, 1) !== "0"; $leader = substr($bin, 11, 1) !== "0"; + $sexualFeatures = substr($bin, 12, 1) !== "0"; $persecutor = substr($bin, 10, 1) !== "0"; $protector = substr($bin, 29, 1) !== "0"; $fictive = substr($bin, 30, 1) !== "0"; @@ -71,6 +72,7 @@ function parseBitset ($bitset) { 'fictive' => $fictive, 'little' => $little, 'not_talking' => false, + 'sexual_features' => $sexualFeatures, 'host' => false, 'robot' => $robot, 'magic' => 0, @@ -105,6 +107,7 @@ function parseMetadata ($metadata) { if (isset($metadata)) { if ($metadata["bitset"]) { $m = parseBitset($metadata["bitset"]); + $m["sexfriends"] = $metadata["sexfriends"] ?? []; $m["marefriends"] = $metadata["marefriends"] ?? []; $m["bitset"] = $metadata["bitset"] ?? 0; $m["sisters"] = $metadata["sisters"] ?? []; diff --git a/includes/details.inc b/includes/details.inc index 6002acd..985f2b0 100644 --- a/includes/details.inc +++ b/includes/details.inc @@ -72,7 +72,7 @@
; margin-left: -20px; margin-right: -20px;"> - = 16 && $metadata["little"] === 0) || (!isset($age) && $metadata["little"] === 0)): ?> + = 16 && $metadata["little"] === 0) || (!isset($age) && $metadata["little"] === 0)) || $metadata["sexual_features"]): ?>
Sexual consent:
@@ -108,7 +108,7 @@ grid-template-columns: 2fr 1fr 1fr; } -
This member is too young to have a sexual relationship.
+
This member is too young to be in a sexual relationship.
diff --git a/includes/fullbanner.inc b/includes/fullbanner.inc index c50ad5f..30bdf3e 100644 --- a/includes/fullbanner.inc +++ b/includes/fullbanner.inc @@ -11,7 +11,7 @@
- +
diff --git a/includes/metadata.inc b/includes/metadata.inc index 078984d..7bc82ef 100644 --- a/includes/metadata.inc +++ b/includes/metadata.inc @@ -21,6 +21,10 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member ยท Edit... ">

+

+ Sexfriends (full IDs, comma-separated):
+ "> +

Marefriends (full IDs, comma-separated):
"> -- cgit