diff --git a/assets/script.js b/assets/script.js
index f4a20c6..36ec5f9 100644
--- a/assets/script.js
+++ b/assets/script.js
@@ -273,7 +273,7 @@ async function onPageLoad() {
if ("news" === currentSite && "index" === currentPage) {
await articleInit();
}
- if ("files" === currentSite && "index" === currentPage) {
+ if ("account" === currentSite && "files" === currentPage) {
await listFiles();
}
if ("memes" === currentSite && "create" === currentPage) {
diff --git a/lib/meme.php b/lib/meme.php
index 239ad9b..e790072 100644
--- a/lib/meme.php
+++ b/lib/meme.php
@@ -54,12 +54,15 @@ function renderMemeGallery(): string
// Fetch the results
$memes_out = '';
+ $meme_template = file_get_contents($routerConfig['template_dir'] . "meme.html");
while ($stmtlist->fetch()) {
if (str_starts_with($fileType, 'image')) {
- $memes_out .= renderMeme($memeID, $authorID, $title, $textContent, $createdAt, $filePath, $userNickname, file_get_contents($routerConfig['template_dir'] . "meme.html"));
+ $memes_out .= renderMeme($memeID, $authorID, $title, $textContent, $createdAt, $filePath, $userNickname, $meme_template);
}
}
+ $meme_add = isLoggedIn() ? file_get_contents($routerConfig['template_dir'] . 'meme_add.html') : '';
$meme_gallery_out = str_replace('__TEMPLATE_MEMES_HERE__', $memes_out, $meme_gallery_template);
+ $meme_gallery_out = str_replace('__TEMPLATE_MEME_ADD__', $meme_add, $meme_gallery_out);
// Close the statement
$stmtlist->close();
diff --git a/pages/files/upload.html b/pages/account/files.html
similarity index 75%
rename from pages/files/upload.html
rename to pages/account/files.html
index 45d4d31..dcc89c4 100644
--- a/pages/files/upload.html
+++ b/pages/account/files.html
@@ -1,5 +1,6 @@
-