profile.php dynamisch Beiträge anzeigen (unvollständig

This commit is contained in:
2026-05-29 16:00:31 +02:00
parent 52a34cd9b4
commit 88c369de32
3 changed files with 63 additions and 13 deletions
@@ -0,0 +1,34 @@
<?php
/*
* Controller für die Liste der eigenen Beiträge eines Nutzers auf der eigenen Profilseite
*/
session_start();
require_once 'php/model/Article.php';
require_once 'php/model/ArticleManager.php';
if (isset($_GET["id"])){
try {
$articleManager = ArticleManager::getInstance();
$article = $articleManager->getArticle($_GET["id"]);
if($article != null){
$title = $article->getTitle();
$content = $article->getContent();
$category = $article->getCategory();
$author = $article->getAuthor();
$tags = $article->getTags();
$creationDate = $article->getCreationDate();
}else{
$_SESSION["message"] = "article_not_found";
echo "article_not_found";
}
} catch (Exception $e){
$_SESSION["message"] = "internal_error";
echo "Fehler aufgetreten: " . $e->getMessage();
}
}else{
$_SESSION["message"] = "article_not_found";
echo "article_not_found";
}
?>