forked from Adleraci/adlerka.top
Fix user list
This commit is contained in:
@@ -8,8 +8,7 @@ function getNewsArticles() :array
|
||||
|
||||
$articles = [];
|
||||
if (isLoggedIn()) {
|
||||
$stmt = $mysqli->prepare("SELECT NewsArticles.ID, NewsArticles.WrittenAt, NewsArticles.WrittenBy, NewsArticles.Title, NewsArticles.Body, NewsArticles.FileList, Users.Nickname FROM NewsArticles INNER JOIN Users ON NewsArticles.WrittenBy = Users.ID; ");
|
||||
|
||||
$stmt = $mysqli->prepare("SELECT NewsArticles.ID, NewsArticles.WrittenAt, NewsArticles.WrittenBy, NewsArticles.Title, NewsArticles.Body, NewsArticles.FileList, Users.Nickname FROM NewsArticles INNER JOIN Users ON NewsArticles.WrittenBy = Users.ID;");
|
||||
$id = 0;
|
||||
$writtenAt = "";
|
||||
$writtenBy = 0;
|
||||
@@ -50,7 +49,7 @@ function addNewsArticle($title="Nazov", $body="Obsah") :array
|
||||
$output = ["Status" => "Fail"]; // Default Status is "Fail"
|
||||
if (isLoggedIn()) {
|
||||
$query = $mysqli->prepare("INSERT INTO NewsArticles (WrittenBy, Title, Body, FileList) VALUES (?, ?, ?, 0);");
|
||||
$query->bind_param("iss", $_SESSION["id"], htmlspecialchars($title), htmlspecialchars($body));
|
||||
$query->bind_param("iss", $_SESSION["ID"], htmlspecialchars($title), htmlspecialchars($body));
|
||||
$query->execute();
|
||||
if ($query->affected_rows > 0) {
|
||||
$output["Status"] = "Success";
|
||||
|
Reference in New Issue
Block a user