MEME
This commit is contained in:
parent
16f9dedce2
commit
99d4f076f9
@ -2,17 +2,17 @@
|
|||||||
|
|
||||||
require_once "lib/upload.php";
|
require_once "lib/upload.php";
|
||||||
|
|
||||||
function addMeme(string $title, string $memeText, int $imageID): bool
|
function addMeme(string $title, string $memeText, int $imageID): array
|
||||||
{
|
{
|
||||||
global $mysqli;
|
global $mysqli;
|
||||||
|
$output = ["Status" => "Fail"];
|
||||||
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($title), htmlspecialchars($memeText), $imageID);
|
$stmtMemeAdd->bind_param('issi', $_SESSION['ID'], htmlspecialchars($title), htmlspecialchars($memeText), $imageID);
|
||||||
$stmtMemeAdd->execute();
|
$stmtMemeAdd->execute();
|
||||||
return true;
|
$output["Status"] = "Success";
|
||||||
}
|
}
|
||||||
return false;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderMeme(string $title, string $textContent, string $createdAt, string $filePath, string $userNickname): string
|
function renderMeme(string $title, string $textContent, string $createdAt, string $filePath, string $userNickname): string
|
||||||
|
Loading…
Reference in New Issue
Block a user