Reviewänderungen
This commit is contained in:
@@ -24,6 +24,11 @@ if (isset($_GET["id"])) {
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!--
|
||||
Seite: Anzeige für Beiträge
|
||||
Funktion: Stellt einen übergebenen Beitrag dar.
|
||||
-->
|
||||
<!-- Hauptcontainer für die Beitragsansicht (Ausschließlich der Content-Bereich) -->
|
||||
|
||||
<main class="article-view-container">
|
||||
<?php if (isset($_SESSION["message"]) && $_SESSION["message"] == "internal_error"): ?>
|
||||
@@ -32,8 +37,30 @@ if (isset($_GET["id"])) {
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($_SESSION["message"]) && $_SESSION["message"] == "missing_id"): ?>
|
||||
<p class="alert-message is-error">
|
||||
Es ist ein Fehler aufgetreten. Die ID konnte nicht ausgelesen werden. Bitte versuche es erneut.
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($_SESSION["message"]) && $_SESSION["message"] == "missing_parameters"): ?>
|
||||
<p class="alert-message is-error">
|
||||
Jeder Beitrag muss einen Titel, Kategorie und Inhalt besitzen.
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<?php if (isset($_SESSION["message"]) && $_SESSION["message"] == "article_updated"): ?>
|
||||
<p class="alert-message is-success">
|
||||
Dein Beitrag wurde erfolgreich bearbeitet!
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
unset($_SESSION["message"]);
|
||||
?>
|
||||
|
||||
<?php unset($_SESSION["message"]); ?>
|
||||
|
||||
<!-- Metadaten & Titel -->
|
||||
|
||||
<div class="article-view-top-section">
|
||||
<?php if (isset($category) && !empty($category)): ?>
|
||||
<span class="article-view-category"><?php echo htmlspecialchars($category); ?></span>
|
||||
@@ -52,13 +79,18 @@ if (isset($_GET["id"])) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Beitrags-Inhalt -->
|
||||
|
||||
<div class="article-view-content">
|
||||
<?php if (isset($content)): ?>
|
||||
<!-- nl2br für Zeilenumbrüche -->
|
||||
<div class="article-view-body">
|
||||
<?php echo nl2br(htmlspecialchars($content)); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<!-- Beitrags-Endbereich (Tags) -->
|
||||
|
||||
|
||||
<?php if (isset($tags) && !empty($tags)): ?>
|
||||
<div class="article-view-bottom-section">
|
||||
@@ -66,6 +98,7 @@ if (isset($_GET["id"])) {
|
||||
|
||||
<div class="article-view-tags-list">
|
||||
<?php
|
||||
// Falls $tags ein String ist (z.B. "Web, CSS"), in ein Array umwandeln
|
||||
$tagArray = is_array($tags) ? $tags : explode(',', $tags);
|
||||
|
||||
foreach ($tagArray as $tag):
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
/* Container für den gesamten articleikel */
|
||||
.article-view-container {
|
||||
box-sizing: border-box;
|
||||
max-width: 900px;
|
||||
max-width: 900px; /* Angenehme Lesebreite für längere Texte */
|
||||
margin: 3rem auto;
|
||||
padding: 0 2rem;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
||||
@@ -105,7 +105,7 @@
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* Responsive Anpassungen unter 760px */
|
||||
/* Responsive Anpassungen unter 760px (für z.B. Smarticlephones) */
|
||||
@media (max-width: 760px) {
|
||||
.article-view-container {
|
||||
margin: 1.5rem auto;
|
||||
|
||||
@@ -52,6 +52,7 @@ if ($pfad === "deleteAccount") {
|
||||
<link rel="stylesheet" href="css/showArticle.css">
|
||||
<link rel="stylesheet" href="css/message.css">
|
||||
|
||||
<script src="js/paginator.js" async></script>
|
||||
<script src="js/comments.js" defer></script>
|
||||
|
||||
<title>EduForge</title>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
|
||||
header("Content-Type: application/json");
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ class DatabaseCommentManager implements CommentManagerDAO
|
||||
}
|
||||
|
||||
} catch (PDOException $e) {
|
||||
throw new RuntimeException("Kommentardatenbank konnte nicht erstellt werden.");
|
||||
throw new RuntimeException("internal_error");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ class DatabaseCommentManager implements CommentManagerDAO
|
||||
return $db;
|
||||
|
||||
} catch (PDOException $e) {
|
||||
throw new RuntimeException("Verbindung zur Kommentardatenbank fehlgeschlagen.");
|
||||
throw new RuntimeException("internal_error");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ class DatabaseCommentManager implements CommentManagerDAO
|
||||
return intval($db->lastInsertId());
|
||||
|
||||
} catch (PDOException $e) {
|
||||
throw new RuntimeException("Kommentar konnte nicht gespeichert werden.");
|
||||
throw new RuntimeException("internal_error");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ class DatabaseCommentManager implements CommentManagerDAO
|
||||
return $this->mapRowsToComments($command);
|
||||
|
||||
} catch (PDOException $e) {
|
||||
throw new RuntimeException("Kommentare konnten nicht geladen werden.");
|
||||
throw new RuntimeException("internal_error");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ class DatabaseCommentManager implements CommentManagerDAO
|
||||
return $this->mapRowsToComments($command);
|
||||
|
||||
} catch (PDOException $e) {
|
||||
throw new RuntimeException("Kommentare konnten nicht geladen werden.");
|
||||
throw new RuntimeException("internal_error");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user