From ec9b4aa51bf8e9ee93cc7bb4bc845d6fffaf8a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Thu, 22 Feb 2024 18:00:30 +0100 Subject: [PATCH] Fix articles --- pages/news/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/news/index.php b/pages/news/index.php index 164b122..ec4b164 100644 --- a/pages/news/index.php +++ b/pages/news/index.php @@ -15,13 +15,14 @@ if($articles_tmp['Status'] == "Success"){ } $articleTemplate = file_get_contents($routerConfig["template_dir"] . "newsArticle.html"); +$output = str_replace("__TEMPLATE_FOR_ARTICLE_CONTENT__", $articleTemplate, $output); foreach ($articles as $article){ $articleTitle = htmlspecialchars($article["Title"]); $articleBody = htmlspecialchars($article["Body"]); $articleFileList = $article["FileList"]; $articleWrittenBy = $article["WrittenBy"]; $articleWrittenAt = htmlspecialchars($article["WrittenAt"]); - $articleWrittenByName = htmlspecialchars($article["Nickname"]); + $articleWrittenByName = htmlspecialchars($article["WrittenByName"]); $articleTemplate = str_replace("__TEMPLATE_ARTICLE_TITLE__", $articleTitle, $articleTemplate); $articleTemplate = str_replace("__TEMPLATE_ARTICLE_AUTHOR__", $articleWrittenByName, $articleTemplate); @@ -31,7 +32,6 @@ foreach ($articles as $article){ $articles_out .= $articleTemplate; } -$output = str_replace("__TEMPLATE_FOR_ARTICLE_CONTENT__", $articleTemplate, $output); $output = str_replace("__TEMPLATE__ARTICLES_HERE__", $articles_out, $output); return [