diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/flags.json | 2 | ||||
-rw-r--r-- | includes/fragments/metadata.inc | 6 | ||||
-rw-r--r-- | includes/jobs/PKFronters.php | 2 | ||||
-rw-r--r-- | includes/jobs/RefreshCache.php | 2 | ||||
-rw-r--r-- | includes/jobs/UpdateAssets.php | 14 | ||||
-rw-r--r-- | includes/jobs/UpdateContactMethods.php | 2 | ||||
-rw-r--r-- | includes/util/banner.inc | 2 |
7 files changed, 17 insertions, 13 deletions
diff --git a/includes/flags.json b/includes/flags.json index 0aed68e..6855dc5 100644 --- a/includes/flags.json +++ b/includes/flags.json @@ -9,7 +9,7 @@ "leader": "Leader", "fictive": "!!Equestrian", "fictive2": "Fictive (Celeste)", - "sexual_features": "Enable sexual features (for ponies below 16)", + "sexual_features": "Enable sexual features (for ponies below 15)", "sexually_active": "!!Preemptive sexual consent", "robot": "!!Robot", "plush": "!!Plush", diff --git a/includes/fragments/metadata.inc b/includes/fragments/metadata.inc index 962e3a0..69ea5a3 100644 --- a/includes/fragments/metadata.inc +++ b/includes/fragments/metadata.inc @@ -91,8 +91,9 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member <option <?= $metadata["species"][0] === "batpony" ? "selected" : "" ?> value="batpony">Bat pony</option> <option <?= $metadata["species"][0] === "crystal" ? "selected" : "" ?> value="crystal">Crystal pony</option> <option <?= $metadata["species"][0] === "changeling" ? "selected" : "" ?> value="changeling">Changeling</option> - <option <?= $metadata["species"][0] === "human" ? "selected" : "" ?> value="human">Human</option> <option <?= $metadata["species"][0] === "merpony" ? "selected" : "" ?> value="merpony">Merpony</option> + <option <?= $metadata["species"][0] === "kirin" ? "selected" : "" ?> value="kirin">Kirin</option> + <option <?= $metadata["species"][0] === "human" ? "selected" : "" ?> value="human">Human</option> </select> <select class="tooltip-nohelp form-select" style='display:inline-block;filter:invert(1) hue-rotate(180deg);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");' name="species[1]"> <option <?= !isset($metadata["species"][1]) || $metadata["species"][1] === "" ? "selected" : "" ?> value="">None</option> @@ -103,8 +104,9 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member <option <?= ($metadata["species"][1] ?? "") === "batpony" ? "selected" : "" ?> value="batpony">Bat pony</option> <option <?= ($metadata["species"][1] ?? "") === "crystal" ? "selected" : "" ?> value="crystal">Crystal pony</option> <option <?= ($metadata["species"][1] ?? "") === "changeling" ? "selected" : "" ?> value="changeling">Changeling</option> - <option <?= ($metadata["species"][1] ?? "") === "human" ? "selected" : "" ?> value="human">Human</option> <option <?= ($metadata["species"][1] ?? "") === "merpony" ? "selected" : "" ?> value="merpony">Merpony</option> + <option <?= ($metadata["species"][1] ?? "") === "kirin" ? "selected" : "" ?> value="kirin">Kirin</option> + <option <?= ($metadata["species"][1] ?? "") === "human" ? "selected" : "" ?> value="human">Human</option> </select> </div> </div> diff --git a/includes/jobs/PKFronters.php b/includes/jobs/PKFronters.php index 3c669d5..1f54908 100644 --- a/includes/jobs/PKFronters.php +++ b/includes/jobs/PKFronters.php @@ -42,4 +42,4 @@ if (trim($data) !== "" && $data !== false && json_last_error() === JSON_ERROR_NO } chdir($_SERVER['DOCUMENT_ROOT'] . "/includes/external/matrix"); -exec("node index.js " . ($system === "gdapd" ? "raindrops" : ($system === "ynmuc" ? "cloudburst" : "other")));
\ No newline at end of file +exec("nice 19 node index.js " . ($system === "gdapd" ? "raindrops" : ($system === "ynmuc" ? "cloudburst" : "other")));
\ No newline at end of file diff --git a/includes/jobs/RefreshCache.php b/includes/jobs/RefreshCache.php index 092b644..b2545af 100644 --- a/includes/jobs/RefreshCache.php +++ b/includes/jobs/RefreshCache.php @@ -22,7 +22,7 @@ $urls = [ foreach ($urls as $url) { echo(" " . $url . "\n"); - exec("curl -k -H 'Host: ponies.equestria.horse' https://localhost" . $url); + exec("nice 19 curl -k -H 'Host: ponies.equestria.horse' https://localhost" . $url); } echo("Refreshed cache\n");
\ No newline at end of file diff --git a/includes/jobs/UpdateAssets.php b/includes/jobs/UpdateAssets.php index fdc0a30..330a66c 100644 --- a/includes/jobs/UpdateAssets.php +++ b/includes/jobs/UpdateAssets.php @@ -29,7 +29,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"]); echo(" /avatars/$id.webp\n"); file_put_contents("/tmp/img." . pathinfo($general['avatar_url'], PATHINFO_EXTENSION), file_get_contents($general['avatar_url'])); - exec("convert -resize 512x512 \"" . "/tmp/img." . pathinfo($general['avatar_url'], PATHINFO_EXTENSION) . "\" " . $_SERVER['DOCUMENT_ROOT'] . "/assets/avatars/" . $id . ".webp"); + exec("nice 19 convert -resize 512x512 \"" . "/tmp/img." . pathinfo($general['avatar_url'], PATHINFO_EXTENSION) . "\" " . $_SERVER['DOCUMENT_ROOT'] . "/assets/avatars/" . $id . ".webp"); unlink("/tmp/img." . pathinfo($general['avatar_url'], PATHINFO_EXTENSION)); } @@ -37,7 +37,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"]); echo(" /banners/$id.webp\n"); file_put_contents("/tmp/img." . pathinfo($general['banner'], PATHINFO_EXTENSION), file_get_contents($general['banner'])); - exec("convert -resize 2048x2048 \"" . "/tmp/img." . pathinfo($general['banner'], PATHINFO_EXTENSION) ."\" " . $_SERVER['DOCUMENT_ROOT'] . "/assets/banners/" . $id . ".webp"); + exec("nice 19 convert -resize 2048x2048 \"" . "/tmp/img." . pathinfo($general['banner'], PATHINFO_EXTENSION) ."\" " . $_SERVER['DOCUMENT_ROOT'] . "/assets/banners/" . $id . ".webp"); unlink("/tmp/img." . pathinfo($general['banner'], PATHINFO_EXTENSION)); } } @@ -52,7 +52,7 @@ function downloadAssets($system, $path = null) { 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'])); - exec("convert -resize 512x512 \"" . "/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION) . "\" " . $_SERVER['DOCUMENT_ROOT'] . "/assets/avatars/" . $id . ".webp"); + exec("nice 19 convert -resize 512x512 \"" . "/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION) . "\" " . $_SERVER['DOCUMENT_ROOT'] . "/assets/avatars/" . $id . ".webp"); unlink("/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION)); } @@ -60,7 +60,7 @@ function downloadAssets($system, $path = null) { if (isset($member["banner"])) { file_put_contents("/tmp/img." . pathinfo($member['banner'], PATHINFO_EXTENSION), file_get_contents($member['banner'])); - exec("convert -resize 2048x2048 \"" . "/tmp/img." . pathinfo($member['banner'], PATHINFO_EXTENSION) . "\" " . $_SERVER['DOCUMENT_ROOT'] . "/assets/banners/" . $id . ".webp"); + exec("nice 19 convert -resize 2048x2048 \"" . "/tmp/img." . pathinfo($member['banner'], PATHINFO_EXTENSION) . "\" " . $_SERVER['DOCUMENT_ROOT'] . "/assets/banners/" . $id . ".webp"); unlink("/tmp/img." . pathinfo($member['banner'], PATHINFO_EXTENSION)); } else { $img = imagecreate(2048, 1024); @@ -73,7 +73,7 @@ function downloadAssets($system, $path = null) { imagejpeg($img, "/tmp/img.jpeg", 100); imagedestroy($img); - exec("convert -resize 2048x2048 \"/tmp/img.jpeg\" " . $_SERVER['DOCUMENT_ROOT'] . "/assets/banners/" . $id . ".webp"); + exec("nice 19 convert -resize 2048x2048 \"/tmp/img.jpeg\" " . $_SERVER['DOCUMENT_ROOT'] . "/assets/banners/" . $id . ".webp"); unlink("/tmp/img.jpeg"); } } @@ -86,11 +86,11 @@ function downloadAssets($system, $path = null) { $url = "" . $_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt.png"; } echo(" /heads/$id.png\n"); - exec("convert \"" . $url . "\" " . $_SERVER['DOCUMENT_ROOT'] . "/assets/heads/" . $id . ".png"); + exec("nice 19 convert \"" . $url . "\" " . $_SERVER['DOCUMENT_ROOT'] . "/assets/heads/" . $id . ".png"); if (file_exists("" . $_SERVER['DOCUMENT_ROOT'] . "/assets/ponies/" . $member["id"] . ".png")) { echo(" /bodies/$id.png\n"); - exec("convert \"" . "" . $_SERVER['DOCUMENT_ROOT'] . "/assets/ponies/" . $member["id"] . ".png" . "\" " . $_SERVER['DOCUMENT_ROOT'] . "/assets/bodies/" . $id . ".png"); + exec("nice 19 convert \"" . "" . $_SERVER['DOCUMENT_ROOT'] . "/assets/ponies/" . $member["id"] . ".png" . "\" " . $_SERVER['DOCUMENT_ROOT'] . "/assets/bodies/" . $id . ".png"); } } } diff --git a/includes/jobs/UpdateContactMethods.php b/includes/jobs/UpdateContactMethods.php index 1341791..ab1c1d9 100644 --- a/includes/jobs/UpdateContactMethods.php +++ b/includes/jobs/UpdateContactMethods.php @@ -39,7 +39,7 @@ foreach ($methods as $name => $method) { $return = []; $cmd = "cd \"$_SERVER[DOCUMENT_ROOT]/includes/external/addressbook\" && node \"$_SERVER[DOCUMENT_ROOT]/includes/external/addressbook/$name.js\" \"" . str_replace('"', "''", $contacts[$id][$name]) . "\""; - exec($cmd, $return); + exec("nice 19 " . $cmd, $return); $json = trim(implode("\n", $return)); $cache[$name][$contacts[$id][$name]] = [ diff --git a/includes/util/banner.inc b/includes/util/banner.inc index 1f4d7fd..dfda86d 100644 --- a/includes/util/banner.inc +++ b/includes/util/banner.inc @@ -133,6 +133,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { "unicorn" => $metadata["robot"] ? "Robot licorne" : (!$metadata["plush"] ? "Licorne" : "Licorne en peluche"), "changeling" => "Changelin", "merpony" => "Poney sirène", + "kirin" => "Kirin", default => $species . "_" . $metadata["robot"] }; } else { @@ -146,6 +147,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { "changeling" => "Changeling", "human" => "Human", "merpony" => "Merpony", + "kirin" => "Kirin", default => $species . "_" . $metadata["robot"] }; } |