72 lines
2.2 KiB
PHP
72 lines
2.2 KiB
PHP
<!--
|
|
Seite: Anzeige für Beiträge
|
|
Funktion: Stellt einen übergebenen Beitrag dar.
|
|
-->
|
|
|
|
<?php
|
|
include_once 'php/controller/showArticle-controller.php';
|
|
?>
|
|
<!--<main>
|
|
|
|
<h1><?php if (isset($title)) {echo $title;} ?></h1>
|
|
|
|
<p>
|
|
<?php if (isset($content)) {echo $content;} ?>
|
|
</p>
|
|
|
|
</main>-->
|
|
|
|
<!-- Hauptcontainer für die Beitragsansicht (Ausschließlich der Content-Bereich) -->
|
|
<main class="art-view-container">
|
|
|
|
<!-- Artikel-Kopfdaten (Metadaten & Titel) -->
|
|
<div class="art-view-top-section">
|
|
|
|
<?php if (isset($category) && !empty($category)): ?>
|
|
<span class="art-view-category"><?php echo htmlspecialchars($category); ?></span>
|
|
<?php endif; ?>
|
|
|
|
<h1 class="art-view-title">
|
|
<?php if (isset($title)) { echo htmlspecialchars($title); } ?>
|
|
</h1>
|
|
|
|
<div class="art-view-meta">
|
|
<?php if (isset($author) && !empty($author)): ?>
|
|
<span class="art-view-author">Von: <strong><?php echo htmlspecialchars($author); ?></strong></span>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- Artikel-Inhalt -->
|
|
<div class="art-view-content">
|
|
<?php if (isset($content)): ?>
|
|
<!-- nl2br für Zeilenumbrüche -->
|
|
<div class="art-view-body"><?php echo nl2br(htmlspecialchars($content)); ?></div>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<!-- Artikel-Endbereich (Tags) -->
|
|
<?php if (isset($tags) && !empty($tags)): ?>
|
|
<div class="art-view-bottom-section">
|
|
<div class="art-view-tags-label">Tags:</div>
|
|
<div class="art-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):
|
|
$trimmedTag = trim($tag);
|
|
if (!empty($trimmedTag)):
|
|
?>
|
|
<span class="art-view-tag-item"><?php echo htmlspecialchars($trimmedTag); ?></span>
|
|
<?php
|
|
endif;
|
|
endforeach;
|
|
?>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
</main>
|
|
|