diff --git a/include/functions.php b/include/functions.php index e49f361..891f9d3 100644 --- a/include/functions.php +++ b/include/functions.php @@ -553,7 +553,7 @@ function timeline($query) { $notes = ""; $hq = array(); - $hq['limit'] = 30; + $hq['limit'] = 10; $hq['only_media'] = ($query['text'] == "off" ? 'true' : 'false'); if ($query['next']){ $hq['max_id'] = $query['next']; @@ -858,7 +858,7 @@ function getnotif($id = false, $max = false) { if (!isset($post["type"])){ break; } - $user = "" . emojify($post['account']['display_name'], $post['account']['emojis'], 10) . ""; + $user = "" . (empty($post['account']['display_name']) ? $post['account']['acct'] : emojify($post['account']['display_name'], $post['account']['emojis'], 10)) . ""; $preview = ""; $buttons = ""; $media = ""; @@ -964,6 +964,7 @@ function getnotif($id = false, $max = false) { function processText($elem) { global $user_settings; + global $logedin; require_once "vendor/simple_html_dom.php"; $content = trim(html_entity_decode($elem['content'],ENT_QUOTES)); $content = preg_replace("/<(?=[^>]*(?:<|$))/","<",$content); @@ -1007,7 +1008,11 @@ function processText($elem) { //$result = preg_replace("/(?$1", $result); $result = emojify($result, $elem['emojis']); - $result = preg_replace("/#([A-Za-z0-9\/\.]*)/", "#$1", $result); + if ($logedin){ + $result = preg_replace("/#([A-Za-z0-9\/\.]*)/", "#$1", $result); + } else { + $result = preg_replace("/#([A-Za-z0-9\/\.]*)/", "#$1", $result); + } return $result; } diff --git a/js/scripts.js b/js/scripts.js index 4fd2326..4c6f394 100644 --- a/js/scripts.js +++ b/js/scripts.js @@ -462,6 +462,9 @@ $('body').on('click', '.loadmore', function() { }); function newPosts() { + + var url = window.location.href; + var thread = getUrlParameter('thread'); if (typeof thread !== 'undefined') { return false; @@ -485,6 +488,11 @@ function newPosts() { } $.get("index.php?ajax=1&since=" + id + "" + pageMode, function(data) { + + if (window.location.href !== url){ + return false; + } + if (data) { var scroll = $(window).scrollTop(); if (scroll > 1000) { diff --git a/layout/footer.php b/layout/footer.php index 9502df5..7f18b46 100644 --- a/layout/footer.php +++ b/layout/footer.php @@ -38,6 +38,10 @@ $query = http_build_query(array_filter(array( return false; } $.get("action.php?a=true¬es=" + thread, function(data) { + thread = getUrlParameter('thread'); + if (typeof thread == 'undefined') { + return false; + } $( ".post_notes" ).html(data); }); }, 15000); diff --git a/layout/header.php b/layout/header.php index e766e5d..7cf98cf 100644 --- a/layout/header.php +++ b/layout/header.php @@ -84,7 +84,7 @@ if ($logedin) {