From 29928887e733f3bc2c2baaf06dafd495a006753b Mon Sep 17 00:00:00 2001 From: Minteck Date: Fri, 3 Mar 2023 07:04:02 +0100 Subject: Updated 18 files and added 10 files (automated) --- includes/assets.inc | 8 ++++---- includes/external/school/index.js | 2 +- includes/functions.inc | 26 +++++++++++++++----------- includes/homepage.inc | 12 ++++++++++-- includes/member.inc | 4 ++-- includes/pages.json | 10 ++++++++++ includes/sysbanner.inc | 32 -------------------------------- includes/titlebar.inc | 2 +- includes/travelling.inc | 33 +++++++++++++++++++-------------- 9 files changed, 62 insertions(+), 67 deletions(-) (limited to 'includes') diff --git a/includes/assets.inc b/includes/assets.inc index b64c821..3f2d652 100644 --- a/includes/assets.inc +++ b/includes/assets.inc @@ -68,12 +68,12 @@ function downloadAssets($system, $path = null) { } else { $url = "../assets/uploads/pt.png"; } - echo(" /heads/$id.webp\n"); - exec("convert -resize 64x64 \"" . $url . "\" ../assets/heads/" . $id . ".webp"); + echo(" /heads/$id.png\n"); + exec("convert \"" . $url . "\" ../assets/heads/" . $id . ".png"); if (file_exists("../assets/ponies/" . $member["id"] . ".png")) { - echo(" /bodies/$id.webp\n"); - exec("convert -resize 128x128 \"" . "../assets/ponies/" . $member["id"] . ".png" . "\" ../assets/bodies/" . $id . ".webp"); + echo(" /bodies/$id.png\n"); + exec("convert \"" . "../assets/ponies/" . $member["id"] . ".png" . "\" ../assets/bodies/" . $id . ".png"); } } } diff --git a/includes/external/school/index.js b/includes/external/school/index.js index ad601d6..c8f053c 100644 --- a/includes/external/school/index.js +++ b/includes/external/school/index.js @@ -196,5 +196,5 @@ async function display(offset) { } console.log(json); - require('fs').writeFileSync("../includes/data/school.json", JSON.stringify(json)); + require('fs').writeFileSync("../../data/school.json", JSON.stringify(json)); })() \ No newline at end of file diff --git a/includes/functions.inc b/includes/functions.inc index 1d467a0..e9024d1 100644 --- a/includes/functions.inc +++ b/includes/functions.inc @@ -53,10 +53,18 @@ if (!function_exists("getAsset")) { $id = $id1; } - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/" . $type . "/" . $id . ".webp")) { - return "/assets/" . $type . "/" . $id . ".webp"; + if ($type === "bodies" || $type === "heads") { + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/" . $type . "/" . $id . ".png")) { + return "/assets/" . $type . "/" . $id . ".png"; + } else { + return "/error/nofile/?s=$systemID&m=$memberID&t=$type"; + } } else { - return "/error/nofile/?s=$systemID&m=$memberID&t=$type"; + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/" . $type . "/" . $id . ".webp")) { + return "/assets/" . $type . "/" . $id . ".webp"; + } else { + return "/error/nofile/?s=$systemID&m=$memberID&t=$type"; + } } } else { return "/error/nosys/?s=$systemID&m=$memberID&t=$type"; @@ -266,8 +274,7 @@ if (!function_exists("getMemberWithoutSystem")) { if (!function_exists("showMembersFromList")) { function showMembersFromList(array $list) { foreach ($list as $member) { if ($member['name'] !== "unknown" && $member['name'] !== "fusion") { - echo(' -
+ echo('
' . ($member['display_name'] ?? $member['name']) . '
' . (isset($member['travelling']) && $member['travelling'] ? "+" . ($member['proxy_tags'][0]['prefix'] ?? " ") : ($member['proxy_tags'][0]['prefix'] ?? " ")) . '
@@ -302,14 +309,11 @@ if (!function_exists("showSystem")) { $global = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . (isset($app["other"]) && $id === $app["other"]["id"] ? "other" : $id) . "/general.json"), true); if ($hideTitle) { - echo(' -
'); + echo('
'); } else { - echo(' -
'); + echo('
'); } - if (!$hideTitle) echo(' - + if (!$hideTitle) echo('

' . $name . '
'); diff --git a/includes/homepage.inc b/includes/homepage.inc index c078e89..900d8f1 100644 --- a/includes/homepage.inc +++ b/includes/homepage.inc @@ -4,6 +4,7 @@ global $app; global $travelling; function newHomepage($id, $page, $title) { + global $travelling; $system = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $id . "/general.json"), true); ?> @@ -17,10 +18,17 @@ function newHomepage($id, $page, $title) { diff --git a/includes/member.inc b/includes/member.inc index 8d03285..b98d0f5 100644 --- a/includes/member.inc +++ b/includes/member.inc @@ -104,9 +104,9 @@ if ($memberData["name"] === "fusion") {
- (edit: metadata, page) + (edit: metadata, pony town, page) - (edit: metadata, public, private) + (edit: metadata, pony town, public, private)
diff --git a/includes/pages.json b/includes/pages.json index f2326c0..2a7bbe6 100644 --- a/includes/pages.json +++ b/includes/pages.json @@ -239,6 +239,16 @@ "limited": false, "rail": true }, + "ponytown": { + "name": { + "en": "Pony Town uploader", + "fr": "Pony Town uploader" + }, + "short": null, + "admin": true, + "limited": true, + "rail": true + }, "profiles": { "name": { "en": "Profile scores", diff --git a/includes/sysbanner.inc b/includes/sysbanner.inc index 2ca3ee8..763c961 100644 --- a/includes/sysbanner.inc +++ b/includes/sysbanner.inc @@ -21,30 +21,6 @@ $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pa

- @@ -117,12 +93,4 @@ $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pa - -
\ No newline at end of file diff --git a/includes/titlebar.inc b/includes/titlebar.inc index a6ccd67..e941179 100644 --- a/includes/titlebar.inc +++ b/includes/titlebar.inc @@ -571,7 +571,7 @@ if ($isLowerLoggedIn || $isLoggedIn) { $linksList = $links[isset($links[$actionsProfile]) ? $actionsProfile : "default"]; -?> +?> $link): if (!(isset($link["show"]) && !$link["show"])): ?>hrefonclick="" title="" data-bs-toggle="tooltip" class="title-bar-action tooltip-nohelp">" class="dropdown-icon" alt="" style="width:24px;vertical-align: middle;"> diff --git a/includes/travelling.inc b/includes/travelling.inc index 4487956..0d1696a 100644 --- a/includes/travelling.inc +++ b/includes/travelling.inc @@ -39,19 +39,24 @@ foreach ($members as $member) { function withTravelers(array $members, string $system): array { global $travelling; - - return [ - ...array_map(function ($i) use ($system) { - $i['system'] = $system; - return $i; - }, array_filter($members, function ($i) use ($travelling) { - return !(isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling'] && (!isset($travelling[$i['id']]['equestria']) || !$travelling[$i['id']]['equestria'])); - })), - ...array_filter(array_map(function ($i) use ($system) { - $i['system'] = $system === "gdapd" ? "ynmuc" : "gdapd"; - return $i; - }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($system === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true)), function ($i) use ($travelling) { - return isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling'] && (!isset($travelling[$i['id']]['equestria']) || !$travelling[$i['id']]['equestria']); - }) + global $app; + + if ($system === $app["other"]["id"]) { + return $members; + } else { + return [ + ...array_map(function ($i) use ($system) { + $i['system'] = $system; + return $i; + }, array_filter($members, function ($i) use ($travelling) { + return !(isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling'] && (!isset($travelling[$i['id']]['equestria']) || !$travelling[$i['id']]['equestria'])); + })), + ...array_filter(array_map(function ($i) use ($system) { + $i['system'] = $system === "gdapd" ? "ynmuc" : "gdapd"; + return $i; + }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($system === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true)), function ($i) use ($travelling) { + return isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling'] && (!isset($travelling[$i['id']]['equestria']) || !$travelling[$i['id']]['equestria']); + }) ]; + } } \ No newline at end of file -- cgit