aboutsummaryrefslogtreecommitdiff
path: root/templates/timeline.inc.php
diff options
context:
space:
mode:
authorArno Richter <oelna@oelna.de>2023-08-16 14:52:58 +0200
committerArno Richter <oelna@oelna.de>2023-08-16 14:52:58 +0200
commit66c6658bac8b0e99b59e3b9f4eb285f38bcebcf5 (patch)
treefa54ab21d4c6122df124459030dd5c6af723f1af /templates/timeline.inc.php
parentff2858b6ea8f586daa95e51ae21315f86cc5ded5 (diff)
downloadmicroblog-66c6658bac8b0e99b59e3b9f4eb285f38bcebcf5.tar.gz
microblog-66c6658bac8b0e99b59e3b9f4eb285f38bcebcf5.tar.bz2
microblog-66c6658bac8b0e99b59e3b9f4eb285f38bcebcf5.zip
huge update to implement first version of activitypub support. closes #16. AP and subdir hosting are incompatible!
Diffstat (limited to 'templates/timeline.inc.php')
-rw-r--r--templates/timeline.inc.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/templates/timeline.inc.php b/templates/timeline.inc.php
index d07776d..61a889d 100644
--- a/templates/timeline.inc.php
+++ b/templates/timeline.inc.php
@@ -23,7 +23,7 @@
$title_suffix = '';
require(ROOT.DS.'snippets'.DS.'header.snippet.php');
-?><body>
+?><body ontouchstart="">
<div class="wrap">
<?php require(ROOT.DS.'snippets'.DS.'nav.snippet.php'); ?>
<ul class="posts">
@@ -46,10 +46,20 @@
<?php endif; ?>
</a>
<nav class="post-meta">
- <?php if($config['logged_in']): ?><ul>
+ <ul>
+ <?php if($config['activitypub']):
+ // todo: is it possible to retrieve this at the same time as post data?
+ $post_stats = activitypub_get_post_stats('both', $post['id']);
+ ?>
+ <li class="post-likes"><a href="<?= $config['url'] ?>/<?= $post['id'] ?>/likes" title="This post has been liked <?= $post_stats['like'] ?> times in the Fediverse"><span class="amount"><?= $post_stats['like'] ?></span><span class="word">Likes</span></a></li>
+ <li class="post-boosts"><a href="<?= $config['url'] ?>/<?= $post['id'] ?>/boosts" title="This post has been announced <?= $post_stats['announce'] ?> times in the Fediverse"><span class="amount"><?= $post_stats['announce'] ?></span><span class="word">Boosts</span></a></li>
+ <?php endif; ?>
+
+ <?php if($config['logged_in']): ?>
<li><a href="<?= $config['url'] ?>/<?= $post['id'] ?>/edit">Edit</a></li>
<li><a href="<?= $config['url'] ?>/<?= $post['id'] ?>/delete">Delete</a></li>
- </ul><?php endif; ?>
+ <?php endif; ?>
+ </ul>
</nav>
<div class="post-content"><?= nl2br(autolink($post['post_content'])) ?></div>
<?php if(!empty($attachments) && !empty($attachments[$post['id']])): ?>