diff options
author | Minteck <contact@minteck.org> | 2022-11-11 23:47:49 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-11-11 23:47:49 +0100 |
commit | 209356b8ade1920b50d1d3a1a5e121c6623d167b (patch) | |
tree | 5301396987d1510f715a0b1c24754873af19e1dc /includes/refresh.php | |
parent | 2c4ae43e688a9873e86211ea0e7aeb9ba770dd77 (diff) | |
download | pluralconnect-209356b8ade1920b50d1d3a1a5e121c6623d167b.tar.gz pluralconnect-209356b8ade1920b50d1d3a1a5e121c6623d167b.tar.bz2 pluralconnect-209356b8ade1920b50d1d3a1a5e121c6623d167b.zip |
Update
Diffstat (limited to 'includes/refresh.php')
-rw-r--r-- | includes/refresh.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/includes/refresh.php b/includes/refresh.php index ff8d1eb..fefebb2 100644 --- a/includes/refresh.php +++ b/includes/refresh.php @@ -41,6 +41,8 @@ foreach ($deletable as $item) { } $times["docs_cleanup"] = microtime(true) - $currentOpStart; +require_once "./cleanup.inc"; + $currentOpStart = microtime(true); $version = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/version.json"), true); @@ -193,7 +195,9 @@ foreach (json_decode(file_get_contents("./data/gdapd/members.json"), true) as $m if (isset($member['avatar_url'])) { echo(" Profile picture\n"); - exec("convert -resize 128x128 -quality 50 \"" . $member['avatar_url'] . "\" \"./data/images/pf-gdapd-" . $member['id'] . ".webp\""); + file_put_contents("/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION), file_get_contents($member['avatar_url'])); + exec("convert -resize 128x128 -quality 50 \"" . "/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION) . "\" \"./data/images/pf-gdapd-" . $member['id'] . ".webp\""); + unlink("/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION)); } echo(" Pony Town character\n"); @@ -211,7 +215,9 @@ foreach (json_decode(file_get_contents("./data/ynmuc/members.json"), true) as $m if (isset($member['avatar_url'])) { echo(" Profile picture\n"); - exec("convert -resize 128x128 -quality 50 \"" . $member['avatar_url'] . "\" \"./data/images/pf-ynmuc-" . $member['id'] . ".webp\""); + file_put_contents("/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION), file_get_contents($member['avatar_url'])); + exec("convert -resize 128x128 -quality 50 \"" . "/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION) . "\" \"./data/images/pf-ynmuc-" . $member['id'] . ".webp\""); + unlink("/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION)); } echo(" Pony Town character\n"); |