Rewrite some stuff

This commit is contained in:
2024-04-26 20:24:09 +02:00
parent c5b5cc9722
commit 154cff0372
6 changed files with 8 additions and 8 deletions

View File

@@ -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();