aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/single.inc.php33
-rw-r--r--templates/timeline.inc.php2
2 files changed, 3 insertions, 32 deletions
diff --git a/templates/single.inc.php b/templates/single.inc.php
index 35c9244..a1344b0 100644
--- a/templates/single.inc.php
+++ b/templates/single.inc.php
@@ -22,12 +22,6 @@
rebuild_feeds();
- if($config['activitypub']) {
- // todo: send DELETE activity to followers
- // https://www.w3.org/TR/activitypub/#delete-activity-inbox
- activitypub_delete_post($_POST['id']);
- }
-
header('Location: '.$config['url']);
die();
}
@@ -80,12 +74,6 @@
} else {
rebuild_feeds();
- if($config['activitypub']) {
- // todo: send UPDATE activity to followers
- // https://www.w3.org/TR/activitypub/#update-activity-inbox
- activitypub_update_post($_POST['id']);
- }
-
header('Location: '.$config['url'].'/'.$_POST['id']);
die();
}
@@ -94,21 +82,12 @@
// load the actual post
$post = db_select_post($id);
- if(is_numeric($post['post_deleted'])) {
+ if(isset($post['post_deleted']) && is_numeric($post['post_deleted'])) {
if(!$config['logged_in']) {
header('Location: '.$config['url']);
}
}
- if($action == 'json') {
-
- $json = activitypub_activity_from_post($post, true);
-
- header('Content-Type: application/ld+json');
- echo($json);
- die();
- }
-
$title_suffix = 'entry #' . $id;
require(ROOT.DS.'snippets'.DS.'header.snippet.php');
@@ -116,7 +95,7 @@
<div class="wrap">
<?php require(ROOT.DS.'snippets'.DS.'nav.snippet.php'); ?>
<ul class="posts">
- <?php if(!empty($post)): ?>
+ <?php if($config['logged_in'] && !empty($post)): ?>
<li class="single-post" data-post-id="<?= $post['id'] ?>">
<?php if($action == 'edit'): ?>
<form action="" method="post" class="edit">
@@ -174,14 +153,6 @@
</span>
<nav class="post-meta">
<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']): ?>
<?php if(is_numeric($post['post_deleted'])): ?>
<li><a href="<?= $config['url'] ?>/<?= $post['id'] ?>/undelete" title="Restore">Deleted on <?= date('M d Y', $post['post_deleted']) ?></a></li>
diff --git a/templates/timeline.inc.php b/templates/timeline.inc.php
index 9295a71..bfeb7de 100644
--- a/templates/timeline.inc.php
+++ b/templates/timeline.inc.php
@@ -27,7 +27,7 @@
<div class="wrap">
<?php require(ROOT.DS.'snippets'.DS.'nav.snippet.php'); ?>
<ul class="posts">
- <?php if(!empty($posts)): ?>
+ <?php if($config['logged_in'] && !empty($posts)): ?>
<?php foreach($posts as $post): ?>
<li data-post-id="<?= $post['id'] ?>">
<?php