From eb7405f92bd01ab59a056ff5df6d2f1d6b30f0ce Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Thu, 13 Apr 2023 22:07:44 +0200 Subject: Updated 13 files and added 2 files (automated) --- includes/components/details.inc | 13 +---- includes/components/planner.inc | 6 ++- includes/fragments/member.inc | 103 +++++++++++++++++++++++++++++++++++++++- includes/fragments/metadata.inc | 25 +++++----- includes/jobs/UpdateAssets.php | 4 +- includes/util/banner.inc | 24 +++++++++- 6 files changed, 144 insertions(+), 31 deletions(-) (limited to 'includes') diff --git a/includes/components/details.inc b/includes/components/details.inc index 6a9f241..7b02808 100644 --- a/includes/components/details.inc +++ b/includes/components/details.inc @@ -1,5 +1,5 @@ -
" style="grid-template-columns: repeat(4, 1fr); background-color: ; margin-left: -20px; margin-right: -20px;"> +
" style="grid-template-columns: repeat(3, 1fr); background-color: ; margin-left: -20px; margin-right: -20px;">

- -
-
- - - - - - -
- +
Primary interest:
diff --git a/includes/components/planner.inc b/includes/components/planner.inc index 9be9cb7..aed4e56 100644 --- a/includes/components/planner.inc +++ b/includes/components/planner.inc @@ -520,7 +520,9 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis document.getElementById("associated-results").innerHTML = ""; for (let pony of availablePonies) { - document.getElementById("associated-results").innerHTML += document.getElementById("list-pony-" + pony).outerHTML; + if (document.getElementById("list-pony-" + pony)) { + document.getElementById("associated-results").innerHTML += document.getElementById("list-pony-" + pony).outerHTML; + } } document.getElementById("list").style.display = "none"; @@ -970,7 +972,7 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis document.getElementById("search-results").innerHTML = ""; for (let result of results) { - document.getElementById("search-results").innerHTML += document.getElementById("list-pony-" + result.id).outerHTML; + if (document.getElementById("list-pony-" + result.id)) document.getElementById("search-results").innerHTML += document.getElementById("list-pony-" + result.id).outerHTML; } console.log(results); diff --git a/includes/fragments/member.inc b/includes/fragments/member.inc index f1169c8..6fbf3ad 100644 --- a/includes/fragments/member.inc +++ b/includes/fragments/member.inc @@ -2,6 +2,8 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; +if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/designs")) mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/designs"); + if ($memberData["name"] === "fusion") { $title = ($memberCommonName === "fusion" ? $lang["member"]["merge"] : $memberCommonName); } else { @@ -48,12 +50,34 @@ if ($memberData["name"] === "fusion") { } } +if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/designs/" . $memberID . ".json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/designs/" . $memberID . ".json", json_encode([ + "_main" => [ + "name" => "Main", + "note" => "Everyday appearance", + "image" => null + ] +])); + +if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/ponies/" . $memberID . ".png")) { + $designs = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/designs/" . $memberID . ".json"), true); + $designs["_main"]["image"] = base64_encode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/assets/ponies/" . $memberData["id"] . ".png")); +} + ?>
;position: fixed;background-image: url('');background-size: cover;background-position: center; top: 0;">
">
+ +
; padding-bottom: 0 !important;"> + +
+
+ $design): if (isset($design)): ?> +
+
+ " style="height: 208px;"> +
+
+ " id="design--name">
" id="design--note"> +
+
+ + +
+ +
+
+
+
@@ -98,7 +200,6 @@ if ($memberData["name"] === "fusion") {
-
value="batpony">Bat pony +
@@ -110,25 +112,14 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member Caretakers (full IDs, comma-separated)
">

- - -
- -

Technical details

-

- Primary interest (keep it short)
- "> + Friends (full IDs, comma-separated)
+ ">

-

- Member code
- "> -

-
-

Age information

+

Age and interests

Birth date (use January 1st for none, fixed age takes priority over birth year if applicable)
@@ -138,6 +129,12 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member Age (for ponies with fixed age, takes priority over birth year)
">

+ +

+ Primary interest (keep it short)
+ "> +

+
diff --git a/includes/jobs/UpdateAssets.php b/includes/jobs/UpdateAssets.php index 0c05686..2b5bba2 100644 --- a/includes/jobs/UpdateAssets.php +++ b/includes/jobs/UpdateAssets.php @@ -48,7 +48,7 @@ function downloadAssets($system, $path = null) { $id = preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", $general["uuid"]) . preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", $member["uuid"]); if ($options["type"] === "members") { - echo("Downloading member assets\n"); + echo("Downloading member assets (" . ($member["display_name"] ?? $member["name"]) . ", " . $member["id"] . ")\n"); if (isset($member["avatar_url"])) { echo(" /avatars/$id.webp\n"); file_put_contents("/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION), file_get_contents($member['avatar_url'])); @@ -79,7 +79,7 @@ function downloadAssets($system, $path = null) { } if ($options["type"] === "ponytown") { - echo("Downloading Pony Town assets\n"); + echo("Downloading Pony Town assets (" . ($member["display_name"] ?? $member["name"]) . ", " . $member["id"] . ")\n"); if (file_exists("" . $_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $member["name"] . ".png")) { $url = "" . $_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $member["name"] . ".png"; } else { diff --git a/includes/util/banner.inc b/includes/util/banner.inc index 947e5c6..0db683f 100644 --- a/includes/util/banner.inc +++ b/includes/util/banner.inc @@ -132,6 +132,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { "batpony" => $metadata["robot"] ? "Robot Poney chauve souris" : (!$metadata["plush"] ? "Poney chauve souris" : "Poney chauve souris en peluche"), "unicorn" => $metadata["robot"] ? "Robot licorne" : (!$metadata["plush"] ? "Licorne" : "Licorne en peluche"), "changeling" => "Changelin", + "merpony" => "Poney sirène", default => $species . "_" . $metadata["robot"] }; } else { @@ -143,6 +144,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { "batpony" => $metadata["robot"] ? "Robot bat pony" : (!$metadata["plush"] ? "Bat pony" : "Bat pony plush"), "unicorn" => $metadata["robot"] ? "Robot unicorn" : (!$metadata["plush"] ? "Unicorn" : "Unicorn plush"), "changeling" => "Changeling", + "merpony" => "Merpony", default => $species . "_" . $metadata["robot"] }; } @@ -242,6 +244,25 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { ]; } + $friends = []; + foreach ($metadata["friends"] ?? [] 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]; + + if (!($mfSystem === $app["other"]["id"] && !$isLoggedIn && !$isLowerLoggedIn)) $friends[] = [ + "id" => $marefriend, + "link" => "/" . ($mfMember["name"]), + "icon" => getAsset($mfSystem, $mfMemberID, "heads"), + "name" => $mfMember["display_name"] ?? $mfMember["name"], + "full_name" => $mfMember["display_name"] ?? $mfMember["name"] + ]; + } + $caretakers = null; if ($metadata["little"] >= 2) { @@ -479,7 +500,8 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { 'marefriends' => $marefriends ?? [], 'sexfriends' => $sexfriends ?? null, 'sisters' => $sisters ?? [], - 'caretakers' => $caretakers ?? [] + 'caretakers' => $caretakers ?? [], + 'friends' => $friends ?? [] ] ]; } \ No newline at end of file -- cgit