diff options
author | Minteck <contact@minteck.org> | 2023-01-28 20:31:04 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2023-01-28 20:31:04 +0100 |
commit | 089d94ff3a34ef022015bf28db0427497acc67ea (patch) | |
tree | 2b7db486ba3cd7ebdd728599bb5af99eafe9bde4 | |
parent | 9b2f05228357a34a3c0f2950782835dfeb35086e (diff) | |
download | pluralconnect-089d94ff3a34ef022015bf28db0427497acc67ea.tar.gz pluralconnect-089d94ff3a34ef022015bf28db0427497acc67ea.tar.bz2 pluralconnect-089d94ff3a34ef022015bf28db0427497acc67ea.zip |
Updated 7 files and renamed 2 files (automated)
-rw-r--r-- | assets/logo/banner.js (renamed from app/banner.js) | 60 | ||||
-rw-r--r-- | assets/uploads/pt-opalinearcana.png (renamed from assets/uploads/pt-opaline.png) | bin | 4472 -> 4472 bytes | |||
-rw-r--r-- | includes/banner.inc | 25 | ||||
-rw-r--r-- | includes/bitset.inc | 3 | ||||
-rw-r--r-- | includes/details.inc | 4 | ||||
-rw-r--r-- | includes/fullbanner.inc | 2 | ||||
-rw-r--r-- | includes/metadata.inc | 4 | ||||
-rw-r--r-- | pages/bitset.inc | 13 | ||||
-rw-r--r-- | pages/metadata.inc | 7 |
9 files changed, 72 insertions, 46 deletions
diff --git a/app/banner.js b/assets/logo/banner.js index 5ddb2d2..076e8ce 100644 --- a/app/banner.js +++ b/assets/logo/banner.js @@ -55,8 +55,8 @@ function timeAgo(time) { } } -async function refreshBanner(offline, french) { - if (!offline) offline = false; +async function refreshBanner(_, french) { + offline = false; if (!french) french = false; window.bannerFrench = french; @@ -68,37 +68,11 @@ async function refreshBanner(offline, french) { data['last_fronted']['relative'] = timeAgo(currentMemberData.last_fronted.timestamp * 1000); } - if (offline) { - let images = JSON.parse(await localforage.getItem("images")); - - index = 0; - for (let species of data['species']) { - data['species'][index]["icon_offline"] = images.misc.species[species['id']]; - index++; - } - - index = 0; - for (let relation of data['relations']['marefriends']) { - data['relations']['marefriends'][index]["icon_offline"] = images.ponytown[relation['id'].split("/")[0]][relation['id'].split("/")[1]]; - index++; - } - - index = 0; - for (let relation of data['relations']['sisters']) { - data['relations']['sisters'][index]["icon_offline"] = images.ponytown[relation['id'].split("/")[0]][relation['id'].split("/")[1]]; - index++; - } - - if (data['relations']['caretakers']) { - index = 0; - for (let relation of data['relations']['caretakers']) { - data['relations']['caretakers'][index]["icon_offline"] = images.ponytown[relation['id'].split("/")[0]][relation['id'].split("/")[1]]; - index++; - } - } - - data['system']['icon_offline'] = images.misc.systems[data['system']['icon']]; - } + let active = 0; + if (data['relations']['marefriends'] && data['relations']['marefriends'].length > 0) active++; + if (data['relations']['caretakers'] && data['relations']['caretakers'].length > 0) active++; + if (data['relations']['sexfriends'] && data['relations']['sexfriends'].length > 0) active++; + if (data['relations']['sisters'] && data['relations']['sisters'].length > 0) active++; document.getElementById("member-banner").innerHTML = ` @@ -175,22 +149,28 @@ async function refreshBanner(offline, french) { ` : ''} </div> ${data['id'] !== "unknown" && data['id'] !== "fusion" ? ` - <div style="display:grid;grid-template-columns: repeat(${data["little"] ? "3" : "2"}, 1fr);margin-top:5px;" id="member-relations"> - <span> + <div style="display:grid;grid-template-columns: repeat(${active}, 1fr);margin-top:5px;" id="member-relations"> + ${data['relations']['sexfriends'] && data['relations']['sexfriends'].length > 0 ? `<span> + <b>${french ? (data['relations']['sexfriends'].length > 1 ? 'Rel. sexuelles ' : 'Rel. sexuelle ') : `Sexfriend${data['relations']['sexfriends'].length > 1 ? 's' : ''}`}: </b>${data['relations']['sexfriends'].length > 1 ? '<span class="list-separator-mobile"><br></span>' : ''} + ${data['relations']['sexfriends'].map(relation => ` + <a title="${relation['name']}" data-bs-toggle="tooltip" class="member-link tooltip-nohelp" href="${relation['link']}"><img src="${offline ? relation['icon_offline'] : `${relation['icon']}`}" style="width:24px;"></a>`).join(``)} + ${data['relations']['sexfriends'].length === 0 ? '-' : ''} + </span>` : ``} + ${data['relations']['marefriends'] && data['relations']['marefriends'].length > 0 ? `<span> <b>${french ? (data['relations']['marefriends'].length > 1 ? 'Copines ' : 'Copine ') : `Marefriend${data['relations']['marefriends'].length > 1 ? 's' : ''}`}: </b>${data['relations']['marefriends'].length > 1 ? '<span class="list-separator-mobile"><br></span>' : ''} ${data['relations']['marefriends'].map(relation => ` <a title="${relation['name']}" data-bs-toggle="tooltip" class="member-link tooltip-nohelp" href="${relation['link']}"><img src="${offline ? relation['icon_offline'] : `${relation['icon']}`}" style="width:24px;"></a>`).join(``)} ${data['relations']['marefriends'].length === 0 ? '-' : ''} - </span> - <span> + </span>` : ``} + ${data['relations']['sisters'] && data['relations']['sisters'].length > 0 ? `<span> <b>${french ? (data['relations']['sisters'].length > 1 ? 'Sœurs ' : 'Sœur ') : `Sister${data['relations']['sisters'].length > 1 ? 's' : ''}`}: </b>${data['relations']['sisters'].length > 1 ? '<span class="list-separator-mobile"><br></span>' : ''} ${data['relations']['sisters'].map(relation => ` <a title="${relation['name']}" data-bs-toggle="tooltip" class="member-link tooltip-nohelp" href="${relation['link']}"><img src="${offline ? relation['icon_offline'] : `${relation['icon']}`}" style="width:24px;"></a>`).join(``)} ${data['relations']['sisters'].length === 0 ? '-' : ''} - </span> - ${data['little'] ? ` + </span>` : ``} + ${data['relations']['caretakers'] && data['relations']['caretakers'].length > 0 ? ` <span> - <b>${french ? (data['relations']['sisters'].length > 1 ? 'Gardiens ' : 'Gardien ') : `Caretaker${data['relations']['caretakers'].length > 1 ? 's' : ''}`}: </b>${data['relations']['caretakers'].length > 1 ? '<span class="list-separator-mobile"><br></span>' : ''} + <b>${french ? (data['relations']['caretakers'].length > 1 ? 'Gardiens ' : 'Gardien ') : `Caretaker${data['relations']['caretakers'].length > 1 ? 's' : ''}`}: </b>${data['relations']['caretakers'].length > 1 ? '<span class="list-separator-mobile"><br></span>' : ''} ${data['relations']['caretakers'].map(relation => ` <a title="${relation['name']}" data-bs-toggle="tooltip" class="member-link tooltip-nohelp" href="${relation['link']}"><img src="${offline ? relation['icon_offline'] : `${relation['icon']}`}" style="width:24px;"></a>`).join(``)} ${data['relations']['caretakers'].length === 0 ? '-' : ''} diff --git a/assets/uploads/pt-opaline.png b/assets/uploads/pt-opalinearcana.png Binary files differindex 261f40d..261f40d 100644 --- a/assets/uploads/pt-opaline.png +++ b/assets/uploads/pt-opalinearcana.png 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> diff --git a/pages/bitset.inc b/pages/bitset.inc index a777b60..309bab8 100644 --- a/pages/bitset.inc +++ b/pages/bitset.inc @@ -46,7 +46,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; <div data-bs-toggle="tooltip" title="Value reserved for future use" id="binary-bit-10" class="font-monospace tooltip-nohelp text-muted" style="text-align: center;cursor: pointer;">0</div> <div data-bs-toggle="tooltip" title="Persecutor" id="binary-bit-11" class="font-monospace tooltip-nohelp" style="color:#197387;text-align: center;cursor: pointer;">0</div> <div data-bs-toggle="tooltip" title="Leader" id="binary-bit-12" class="font-monospace tooltip-nohelp" style="text-align: center;cursor: pointer;color:#877e19;">0</div> - <div data-bs-toggle="tooltip" title="Value reserved for future use" id="binary-bit-13" class="text-muted font-monospace tooltip-nohelp" style="text-align: center;cursor: pointer;">0</div> + <div data-bs-toggle="tooltip" title="Enable sexual features" id="binary-bit-13" class="font-monospace tooltip-nohelp" style="text-align: center;cursor: pointer;">0</div> <div data-bs-toggle="tooltip" title="Preemptive sexual consent" id="binary-bit-14" class="font-monospace tooltip-nohelp" style="color: rgb(59,196,46);text-align: center;cursor: pointer;">0</div> <div data-bs-toggle="tooltip" title="Fronts less frequently" id="binary-bit-15" class="font-monospace tooltip-nohelp" style="color: #198754;text-align: center;cursor: pointer;">0</div> <div data-bs-toggle="tooltip" title="Non verbal in real life" id="binary-bit-16" class="font-monospace tooltip-nohelp" style="color: #20c997;text-align: center;cursor: pointer;">0</div> @@ -164,6 +164,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; let polyamorous2 = binString.substring(19, 20) !== "0"; let alignment1 = binString.substring(20, 24); let alignment2 = binString.substring(25 + 16, 29 + 16); + let sexualFeatures = binString.substring(12, 13) !== "0"; document.getElementById("value-0").value = sharedMemory; document.getElementById("value-1").value = little; @@ -183,6 +184,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; document.getElementById("value-23").checked = polyamorous2; document.getElementById("value-24").value = alignment1; document.getElementById("value-25").value = alignment2; + document.getElementById("value-26").checked = sexualFeatures; setColors(); } @@ -242,6 +244,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; let val23 = document.getElementById("value-23").checked; let val24 = document.getElementById("value-24").value; let val25 = document.getElementById("value-25").value; + let val26 = document.getElementById("value-26").checked; let val0bin = parseInt(val0).toString(2); val0bin = val0bin.length === 1 ? "0" + val0bin : val0bin; @@ -261,7 +264,6 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; let val7bin = "0"; let val8bin = "0"; let val15bin = "0"; - let val19bin = "0"; let val5bin = val5 ? "1" : "0"; let val6bin = val6 ? "1" : "0"; @@ -274,8 +276,9 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; let val21bin = val21 ? "1" : "0"; let val22bin = val22 ? "1" : "0"; let val23bin = val23 ? "1" : "0"; + let val26bin = val26 ? "1" : "0"; - let bin = "0000000000" + val21bin + val20bin + val19bin + val18bin + val17bin + val16bin + val11bin + val22bin + val23bin + val24bin + val0bin + val4bin + val1bin + val5bin + val6bin + val7bin + val8bin + val2bin + val3bin + val25bin + val9bin + val10bin + val15bin; + let bin = "0000000000" + val21bin + val20bin + val26bin + val18bin + val17bin + val16bin + val11bin + val22bin + val23bin + val24bin + val0bin + val4bin + val1bin + val5bin + val6bin + val7bin + val8bin + val2bin + val3bin + val25bin + val9bin + val10bin + val15bin; console.log(bin, parseInt(bin, 2)); @@ -404,6 +407,10 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; Fictive </label><br> <label style="margin-bottom:5px;"> + <input type="checkbox" id="value-26" onchange="updateFromSelection();"> + Enable sexual features (for littles/younger only) + </label><br> + <label style="margin-bottom:5px;"> <input type="checkbox" id="value-18" onchange="updateFromSelection();"> Preemptive sexual consent </label><br> diff --git a/pages/metadata.inc b/pages/metadata.inc index f3e48d7..870ca42 100644 --- a/pages/metadata.inc +++ b/pages/metadata.inc @@ -77,6 +77,12 @@ if ($member === null) { })); } + if (isset($_GET["sexfriends"])) { + $toUpdate["sexfriends"] = array_values(array_filter(array_map(function ($i) { return trim($i); }, explode(",", $_GET["sexfriends"])), function ($i) { + return !!preg_match("/^(ynmuc|gdapd)\/[a-z]{5}$/m", $i); + })); + } + if (isset($_GET["sisters"])) { $toUpdate["sisters"] = array_values(array_filter(array_map(function ($i) { return trim($i); }, explode(",", $_GET["sisters"])), function ($i) { return !!preg_match("/^(ynmuc|gdapd)\/[a-z]{5}$/m", $i); @@ -124,6 +130,7 @@ if ($member === null) { "bitset" => $metadata["bitset"] ?? 0, "regression" => $metadata["regression"] ?? null, "median" => $metadata["median"] ?? null, + "sexfriends" => $metadata["sexfriends"] ?? [], "marefriends" => $metadata["marefriends"] ?? [], "sisters" => $metadata["sisters"] ?? [], "caretakers" => $metadata["caretakers"] ?? [], |