Update profile.php
This commit is contained in:
+37
-32
@@ -47,39 +47,44 @@ include_once 'php/controller/profileArticles-controller.php';
|
|||||||
<p class="alert-message is-error">
|
<p class="alert-message is-error">
|
||||||
Es ist ein Fehler beim Speichern aufgetreten. Bitte versuche es erneut.
|
Es ist ein Fehler beim Speichern aufgetreten. Bitte versuche es erneut.
|
||||||
</p>
|
</p>
|
||||||
<?php elseif(isset($userArticles) && count($userArticles) > 0): ?>
|
<?php elseif (isset($userArticles) && count($userArticles) > 0): ?>
|
||||||
<!-- Beispiel-Eintrag 1 (Wird später per PHP wiederholt) -->
|
|
||||||
<div class="article-item">
|
|
||||||
<div class="article-meta">
|
|
||||||
<?php foreach ($userArticles as $userArticle): ?>
|
|
||||||
<span class="article-date"><?php htmlspecialchars($userArticle->getTitle()); ?></span>
|
|
||||||
<span class="article-category"><?php echo htmlspecialchars($userArticle->getCategory()); ?></span>
|
|
||||||
</div>
|
|
||||||
<h3 class="article-title"><?php echo htmlspecialchars($userArticle->getTitle()); ?></h3>
|
|
||||||
<?php
|
|
||||||
$tags = $userArticle->getTags();
|
|
||||||
if (isset($tags) && !empty($tags)): ?>
|
|
||||||
<div class="article-view-bottom-section">
|
|
||||||
<div class="article-view-tags-label">Tags:</div>
|
|
||||||
<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):
|
|
||||||
$trimmedTag = trim($tag);
|
|
||||||
if (!empty($trimmedTag)):
|
|
||||||
?>
|
|
||||||
<span class="article-view-tag-item"><?php echo htmlspecialchars($trimmedTag); ?></span>
|
|
||||||
<?php
|
|
||||||
endif;
|
|
||||||
endforeach;
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
<a href="index.php?pfad=createArticle" class="edit-link-button">Bearbeiten</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<?php foreach ($userArticles as $userArticle): ?>
|
||||||
|
<!-- Ein einzelner Artikel-Eintrag -->
|
||||||
|
<div class="article-item">
|
||||||
|
<div class="article-meta">
|
||||||
|
<span class="article-date"><?php echo htmlspecialchars($userArticle->getCreationDate()); ?></span>
|
||||||
|
<span class="article-category"><?php echo htmlspecialchars($userArticle->getCategory()); ?></span>
|
||||||
|
</div>
|
||||||
|
<h3 class="article-title"><?php echo htmlspecialchars($userArticle->getTitle()); ?></h3>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$tags = $userArticle->getTags();
|
||||||
|
if (isset($tags) && !empty($tags)): ?>
|
||||||
|
<div class="article-view-bottom-section">
|
||||||
|
<div class="article-view-tags-label">Tags:</div>
|
||||||
|
<div class="article-view-tags-list">
|
||||||
|
<?php
|
||||||
|
$tagArray = is_array($tags) ? $tags : explode(',', $tags);
|
||||||
|
foreach ($tagArray as $tag):
|
||||||
|
$trimmedTag = trim($tag);
|
||||||
|
if (!empty($trimmedTag)):
|
||||||
|
?>
|
||||||
|
<span class="article-view-tag-item"><?php echo htmlspecialchars($trimmedTag); ?></span>
|
||||||
|
<?php
|
||||||
|
endif;
|
||||||
|
endforeach;
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
<a href="index.php?pfad=createArticle" class="edit-link-button">Bearbeiten</a>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
<?php else: ?>
|
||||||
|
<p>Noch keine Beiträge vorhanden.</p>
|
||||||
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user