summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2023-01-28 20:31:04 +0100
committerMinteck <contact@minteck.org>2023-01-28 20:31:04 +0100
commit089d94ff3a34ef022015bf28db0427497acc67ea (patch)
tree2b7db486ba3cd7ebdd728599bb5af99eafe9bde4 /includes
parent9b2f05228357a34a3c0f2950782835dfeb35086e (diff)
downloadpluralconnect-089d94ff3a34ef022015bf28db0427497acc67ea.tar.gz
pluralconnect-089d94ff3a34ef022015bf28db0427497acc67ea.tar.bz2
pluralconnect-089d94ff3a34ef022015bf28db0427497acc67ea.zip
Updated 7 files and renamed 2 files (automated)
Diffstat (limited to 'includes')
-rw-r--r--includes/banner.inc25
-rw-r--r--includes/bitset.inc3
-rw-r--r--includes/details.inc4
-rw-r--r--includes/fullbanner.inc2
-rw-r--r--includes/metadata.inc4
5 files changed, 35 insertions, 3 deletions
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 @@
</div>
<?php if ($isLoggedIn): ?>
<div id="member-details-2" style="background-color: <?= isset($memberData["color"]) ? '#' . $memberData["color"] . "33" : "transparent" ?>; margin-left: -20px; margin-right: -20px;">
- <?php if ((isset($age) && $age >= 16 && $metadata["little"] === 0) || (!isset($age) && $metadata["little"] === 0)): ?>
+ <?php if (((isset($age) && $age >= 16 && $metadata["little"] === 0) || (!isset($age) && $metadata["little"] === 0)) || $metadata["sexual_features"]): ?>
<div>
<b>Sexual consent:</b><span class="member-small-separator"><br></span>
<?php if ($metadata["sexually_active"]): ?>
@@ -108,7 +108,7 @@
grid-template-columns: 2fr 1fr 1fr;
}
</style>
- <div style="display: flex; align-items: center; justify-content: center; height: 100%;opacity:.5;">This member is too young to have a sexual relationship.</div>
+ <div style="display: flex; align-items: center; justify-content: center; height: 100%;opacity:.5;">This member is too young to be in a sexual relationship.</div>
</div>
<?php endif; ?>
<div>
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 @@
<div id="member-banner"></div>
<?php endif; ?>
-<script src="/app/banner.js"></script><script>refreshBanner(false, <?= $lang["_french"] ? "true" : "false" ?>)</script>
+<script src="/assets/logo/banner.js"></script><script>refreshBanner(false, <?= $lang["_french"] ? "true" : "false" ?>)</script>
<br>
<?php global $isLoggedIn; if ($isLoggedIn && $memberData["name"] !== "unknown" && $memberData["name"] !== "fusion"): ?>
diff --git a/includes/metadata.inc b/includes/metadata.inc
index 078984d..7bc82ef 100644
--- a/includes/metadata.inc
+++ b/includes/metadata.inc
@@ -22,6 +22,10 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member
<input name="bitset" id="bitset-value" type="hidden" value="<?= $metadata["bitset"] ?>">
</p>
<p>
+ <b>Sexfriends (full IDs, comma-separated):</b><br>
+ <input name="sexfriends" class="form-control" style="filter: invert(1) hue-rotate(180deg);" type="text" value="<?= implode(", ", $metadata["sexfriends"]) ?>">
+ </p>
+ <p>
<b>Marefriends (full IDs, comma-separated):</b><br>
<input name="marefriends" class="form-control" style="filter: invert(1) hue-rotate(180deg);" type="text" value="<?= implode(", ", $metadata["marefriends"]) ?>">
</p>