diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/loginform.inc.php | 2 | ||||
-rw-r--r-- | templates/postform.inc.php | 10 | ||||
-rw-r--r-- | templates/timeline.inc.php | 16 |
3 files changed, 5 insertions, 23 deletions
diff --git a/templates/loginform.inc.php b/templates/loginform.inc.php index de155e6..08896ce 100644 --- a/templates/loginform.inc.php +++ b/templates/loginform.inc.php @@ -4,7 +4,7 @@ // handle login if(isset($_POST['user']) && isset($_POST['pass'])) { if($_POST['user'] === $config['admin_user'] && $_POST['pass'] === $config['admin_pass']) { - $domain = ($_SERVER['HTTP_HOST'] != 'localhost') ? $_SERVER['HTTP_HOST'] : false; + $domain = ($_SERVER['SERVER_NAME'] != 'localhost') ? $_SERVER['HTTP_HOST'] : false; setcookie('microblog_login', sha1($config['url'].$config['admin_pass']), NOW+$config['cookie_life'], '/', $domain, false); header('Location: '.$config['url']); diff --git a/templates/postform.inc.php b/templates/postform.inc.php index 59579c1..63e3901 100644 --- a/templates/postform.inc.php +++ b/templates/postform.inc.php @@ -26,16 +26,6 @@ rebuild_feeds(); - if($config['activitypub'] == true) activitypub_notify_followers($id); - if($config['ping'] == true) ping_microblog(); - if($config['crosspost_to_twitter'] == true) { - $twitter_response = json_decode(twitter_post_status($_POST['content']), true); - - if(!empty($twitter_response['errors'])) { - $message['message'] .= ' (But crossposting to twitter failed!)'; - } - } - header('Location: '.$config['url']); die(); } diff --git a/templates/timeline.inc.php b/templates/timeline.inc.php index 61a889d..9295a71 100644 --- a/templates/timeline.inc.php +++ b/templates/timeline.inc.php @@ -15,10 +15,10 @@ // get posts $posts = db_select_posts(NOW, $config['posts_per_page'], 'desc', $offset); - if(empty($posts)) { - header('Location: '.$config['url']); - die(); - } + // if(empty($posts)) { + // header('Location: '.$config['url']); + // die(); + // } $title_suffix = ''; require(ROOT.DS.'snippets'.DS.'header.snippet.php'); @@ -47,14 +47,6 @@ </a> <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']): ?> <li><a href="<?= $config['url'] ?>/<?= $post['id'] ?>/edit">Edit</a></li> <li><a href="<?= $config['url'] ?>/<?= $post['id'] ?>/delete">Delete</a></li> |