This commit is contained in:
Bruno Rybársky 2024-04-25 23:40:27 +02:00
parent 5cee6d3044
commit 3074bfc502
2 changed files with 3 additions and 2 deletions

@ -37,7 +37,6 @@ function renderMemeGallery(): string
$stmtlist = $mysqli->prepare('SELECT Memes.ID, Memes.Title, Memes.TextContent, Memes.CreatedAt, Files.Path, Files.Type, Users.Nickname FROM Memes INNER JOIN Users ON Memes.AuthorID = Users.ID INNER JOIN Files ON Memes.FileID = Files.ID'); $stmtlist = $mysqli->prepare('SELECT Memes.ID, Memes.Title, Memes.TextContent, Memes.CreatedAt, Files.Path, Files.Type, Users.Nickname FROM Memes INNER JOIN Users ON Memes.AuthorID = Users.ID INNER JOIN Files ON Memes.FileID = Files.ID');
// Execute the prepared statement // Execute the prepared statement
$stmtlist->execute();
$memeID = 0; $memeID = 0;
$title = ""; $title = "";
$textContent = ""; $textContent = "";
@ -47,6 +46,8 @@ function renderMemeGallery(): string
$createdAt = ""; $createdAt = "";
// Bind the result variables // Bind the result variables
$stmtlist->bind_result($memeID, $title, $textContent, $createdAt, $filePath, $fileType, $userNickname); $stmtlist->bind_result($memeID, $title, $textContent, $createdAt, $filePath, $fileType, $userNickname);
$stmtlist->execute();
$stmtlist->fetch();
$meme_gallery_template = file_get_contents($routerConfig['template_dir'] . 'meme_gallery.html'); $meme_gallery_template = file_get_contents($routerConfig['template_dir'] . 'meme_gallery.html');

@ -19,7 +19,7 @@ $output = str_replace("__TEMPLATE_FOR_ARTICLE_CONTENT__", $articleTemplate, $out
foreach ($articles as $article){ foreach ($articles as $article){
$articleTitle = htmlspecialchars($article["Title"]); $articleTitle = htmlspecialchars($article["Title"]);
$articleBody = htmlspecialchars($article["Body"]); $articleBody = htmlspecialchars($article["Body"]);
$articleFileList = $article["FileList"]; //$articleFileList = $article["FileList"];
$articleWrittenBy = $article["WrittenBy"]; $articleWrittenBy = $article["WrittenBy"];
$articleWrittenAt = htmlspecialchars($article["WrittenAt"]); $articleWrittenAt = htmlspecialchars($article["WrittenAt"]);
$articleWrittenByName = htmlspecialchars($article["WrittenByName"]); $articleWrittenByName = htmlspecialchars($article["WrittenByName"]);