aboutsummaryrefslogtreecommitdiff
path: root/templates/single.inc.php
diff options
context:
space:
mode:
authorArno Richter <oelna@oelna.de>2022-12-13 23:45:48 +0100
committerArno Richter <oelna@oelna.de>2022-12-13 23:45:48 +0100
commita2efa08d3529758b67db5b8687f8df43de63f1d0 (patch)
treefe1543c9bc8f82a95e84693932556b6cbec99383 /templates/single.inc.php
parent67b51e9f905c568444741eaad0eb5d82df7f09c8 (diff)
downloadmicroblog-a2efa08d3529758b67db5b8687f8df43de63f1d0.tar.gz
microblog-a2efa08d3529758b67db5b8687f8df43de63f1d0.tar.bz2
microblog-a2efa08d3529758b67db5b8687f8df43de63f1d0.zip
display edit times of posts. add a config option to disable.
Diffstat (limited to 'templates/single.inc.php')
-rw-r--r--templates/single.inc.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/templates/single.inc.php b/templates/single.inc.php
index cd01127..29184d4 100644
--- a/templates/single.inc.php
+++ b/templates/single.inc.php
@@ -86,7 +86,12 @@
$datetime = date_format($date, 'Y-m-d H:i:s');
$formatted_time = date_format($date, 'M d Y H:i');
?>
- <span class="post-timestamp"><time datetime="<?= $datetime ?>" data-unix-time="<?= $post['post_timestamp'] ?>"><?= $formatted_time ?></time></span>
+ <span class="post-timestamp">
+ <time class="published" datetime="<?= $datetime ?>" data-unix-time="<?= $post['post_timestamp'] ?>"><?= $formatted_time ?></time>
+ <?php if(is_numeric($post['post_edited']) && $config['show_edits']): ?>
+ <time class="modified" datetime="<?= gmdate('Y-m-d\TH:i:s\Z', $post['post_edited']) ?>" data-unix-time="<?= $post['post_edited'] ?>">Edited on <?= date('M d Y H:i', $post['post_edited']) ?></time>
+ <?php endif; ?>
+ </span>
<nav class="post-meta">
<?php if($config['logged_in']): ?><ul>
<?php if(is_numeric($post['post_deleted'])): ?>