aboutsummaryrefslogtreecommitdiff
path: root/templates/single.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'templates/single.inc.php')
-rw-r--r--templates/single.inc.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/templates/single.inc.php b/templates/single.inc.php
index 64e7f6d..5514742 100644
--- a/templates/single.inc.php
+++ b/templates/single.inc.php
@@ -109,8 +109,8 @@
<?php
$attachments = db_get_attached_files($post['id']);
?>
- <?php if(!empty($attachments)): ?>
- <?php foreach($attachments as $a): ?>
+ <?php if(!empty($attachments) && !empty($attachments[$post['id']])): ?>
+ <?php foreach($attachments[$post['id']] as $a): ?>
<?php if(strpos($a['file_mime_type'], 'image') === 0): ?>
<?php
$abs = ROOT.DS.get_file_path($a);
@@ -142,7 +142,6 @@
$formatted_time = date_format($date, 'M d Y H:i');
$attachments = db_get_attached_files($post['id']);
- // var_dump($attachments);
?>
<span class="post-timestamp">
<time class="published" datetime="<?= $datetime ?>" data-unix-time="<?= $post['post_timestamp'] ?>"><?= $formatted_time ?></time>
@@ -161,9 +160,9 @@
</ul><?php endif; ?>
</nav>
<div class="post-content"><?= nl2br(autolink($post['post_content'])) ?></div>
- <?php if(!empty($attachments)): ?>
+ <?php if(!empty($attachments) && !empty($attachments[$post['id']])): ?>
<ul class="post-attachments">
- <?php foreach($attachments as $a): ?>
+ <?php foreach($attachments[$post['id']] as $a): ?>
<li>
<?php if(strpos($a['file_mime_type'], 'image') === 0): ?>
<?php