Timeline bugfixes

This commit is contained in:
daisuke
2021-03-27 12:04:26 -06:00
parent ed37590c5f
commit 5b558b6df6
5 changed files with 34 additions and 10 deletions

View File

@ -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 = "<a class='link ldr uname' style='font-size:12px;' href='?user=" . $post['account']['id'] . "'>" . emojify($post['account']['display_name'], $post['account']['emojis'], 10) . "</a>";
$user = "<a class='link ldr uname' style='font-size:12px;' href='?user=" . $post['account']['id'] . "'>" . (empty($post['account']['display_name']) ? $post['account']['acct'] : emojify($post['account']['display_name'], $post['account']['emojis'], 10)) . "</a>";
$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("/<(?=[^>]*(?:<|$))/","&lt;",$content);
@ -1007,7 +1008,11 @@ function processText($elem) {
//$result = preg_replace("/(?<!=\")(\b[\w]+:\/\/[\w-?&;#~=\.\/\@]+[\w\/])/", "<a target=\"_blank\" class='external' style='color:navy;' href=\"$1\">$1</a>", $result);
$result = emojify($result, $elem['emojis']);
$result = preg_replace("/#([A-Za-z0-9\/\.]*)/", "<a class='ldr' href=\"./?tag=$1\"><b>#$1</b></a>", $result);
if ($logedin){
$result = preg_replace("/#([A-Za-z0-9\/\.]*)/", "<a class='ldr' href=\"./?tag=$1\"><b>#$1</b></a>", $result);
} else {
$result = preg_replace("/#([A-Za-z0-9\/\.]*)/", "<b>#$1</b>", $result);
}
return $result;
}