Rewrite some stuff
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user