Kommentare im Profil anzeigen

This commit is contained in:
2026-06-15 23:55:10 +02:00
parent c4c299eed6
commit f4f6960b9d
4 changed files with 105 additions and 213 deletions
+36 -3
View File
@@ -93,7 +93,7 @@ $isEditMode = (isset($_GET["edit"]) && $_GET["edit"] === "1") || !empty($error);
<div class="container">
<?php include_once "includes/alertMessages.php"?>
<?php include_once "includes/alertMessages.php" ?>
<h2 class="section-title">Meine Beiträge</h2>
@@ -157,7 +157,9 @@ $isEditMode = (isset($_GET["edit"]) && $_GET["edit"] === "1") || !empty($error);
</a>
<form action="php/controller/deleteArticle-controller.php" method="POST">
<input type="hidden" name="id" value="<?php echo htmlspecialchars($userArticle->getID()); ?>">
<input type="hidden"
name="id"
value="<?php echo htmlspecialchars($userArticle->getID()); ?>">
<button type="submit"
class="button"
@@ -165,7 +167,6 @@ $isEditMode = (isset($_GET["edit"]) && $_GET["edit"] === "1") || !empty($error);
Löschen
</button>
</form>
</div>
<?php endforeach; ?>
@@ -180,9 +181,41 @@ $isEditMode = (isset($_GET["edit"]) && $_GET["edit"] === "1") || !empty($error);
</button>
<?php endif; ?>
</div>
<br>
<h2 class="section-title">Meine Kommentare</h2>
<div class="articles-list">
<?php if (isset($userComments) && count($userComments) > 0): ?>
<?php foreach ($userComments as $comment): ?>
<div class="article-item">
<div class="article-meta">
<span class="article-date">
<?php echo htmlspecialchars($comment->getCreated()); ?>
</span>
</div>
<p>
<?php echo nl2br(htmlspecialchars($comment->getContent())); ?>
</p>
<a href="index.php?pfad=showArticle&id=<?php echo htmlspecialchars($comment->getArticleId()); ?>"
class="edit-link-button">
Zum Beitrag
</a>
</div>
<?php endforeach; ?>
<?php else: ?>
<p>Du hast noch keine Kommentare geschrieben.</p>
<?php endif; ?>
<?php unset($_SESSION["message"]); ?>
</div>
</div>
</div>