Test meme rendering

This commit is contained in:
Bruno Rybársky 2024-04-25 09:45:28 +02:00
parent 8f392da809
commit 9f1cfc2ed4

@ -5,7 +5,7 @@ function addMeme(string $memeText, int $imageID): bool
global $mysqli; global $mysqli;
if (isLoggedIn() && fileExists($imageID)) { if (isLoggedIn() && fileExists($imageID)) {
$stmtMemeAdd = $mysqli->prepare('INSERT INTO Memes (AuthorID, Title, TextContent, FileID) VALUES (?, ?, ?)'); $stmtMemeAdd = $mysqli->prepare('INSERT INTO Memes (AuthorID, Title, TextContent, FileID) VALUES (?, ?, ?, ?)');
$stmtMemeAdd->bind_param('issi', $_SESSION['ID'], htmlspecialchars($memeText), $imageID); $stmtMemeAdd->bind_param('issi', $_SESSION['ID'], htmlspecialchars($memeText), $imageID);
$stmtMemeAdd->execute(); $stmtMemeAdd->execute();
return true; return true;
@ -44,7 +44,7 @@ function renderMemeGallery(): string
// 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);
$meme_gallery_template = file_get_contents($routerConfig->template_dir . "meme_gallery.html"); $meme_gallery_template = file_get_contents($routerConfig['template_dir'] . 'meme_gallery.html');
// Fetch the results // Fetch the results
$memes_out = ''; $memes_out = '';