" : ""); if ($logedin && $rel[0]['following']) { $profile['top'] .= "Lists  "; } if ($logedin) { if ($rel[0]['following']) { $label = " Following"; $class = "unfollow"; } else { if ($info['locked']) { if ($rel[0]['requested']) { $label = " Follow Requested"; $class = "unfollow"; } else { $label = " Request Follow"; $class = "follow"; } } else { $label = " Follow"; $class = "follow"; } } $profile['top'] .= "$label"; } $profile['top'] .= "" . (in_array($info['id'], $user_settings['nsfw']) ? "NSFW " : "NSFW ") . ""; if ($logedin) { $profile['bottom'] = " " . ($info['locked'] ? " Locked" : "") . " " . ($rel[0]['followed_by'] ? " Follows You" : "") . " " . ($rel[0]['blocking'] ? " Blocked" : "") . " " . ($rel[0]['muting'] ? " Muted" : "") . " "; } else { $profile['bottom'] = ""; } $profile['avatar'] = $info['avatar']; $profile['name'] = emojify($info['display_name'], $info['emojis'], 40); $profile['acct'] = $info['acct']; $profile['url'] = $info['url']; $profile['note'] = emojify(trim($info['note']) , $info['emojis']); $profile['statuses'] = $info['statuses_count']; $profile['following'] = $info['following_count']; $profile['followers'] = $info['followers_count']; foreach ($profile as $key => $value) { $template = str_replace(":$key:", $value, $template); } echo $template; } elseif (!isset($_GET['next']) && !isset($_GET['since'])) { echo "
"; } if ((!isset($thread[0]['id']) && !empty($thread)) || !is_array($thread)) { echo "
Error loading the timeline. " . json_encode($thread) . "
"; } else { $e = 0; foreach ($thread as $elem) { $post = array(); $post['pid'] = $elem['id']; $post['replyto'] = ""; $post['rt'] = ""; if ($elem['reblog'] != null) { $post['name'] = "" . emojify($elem['reblog']['account']['display_name'], $elem['reblog']['account']['emojis'], 15) . ""; $post['replyto'] = "" . ($elem['reblog']['in_reply_to_id'] ? " " : "") . ""; //$post['rt'] = "[ by " . emojify($elem['account']['display_name'],$elem['account']['emojis'],15) . " ]"; $post['rt'] = "[ by " . emojify($elem['account']['display_name'], $elem['account']['emojis'], 15) . "@" . explode("@", $elem['account']['acct']) [0] . " ]"; $elem = $elem['reblog']; } else { $post['name'] = "" . emojify($elem['account']['display_name'], $elem['account']['emojis'], 20) . " (" . $elem['account']['acct'] . ") "; $post['replyto'] = "" . ($elem['in_reply_to_id'] ? " " : "") . ""; } if (in_array($elem["account"]['id'], $user_settings['nsfw'])) { $elem['sensitive'] = true; } if ($user_settings['explicit'] == "hide" && $elem['sensitive'] == true && $tl['mode'] != "thread") { continue; } if (@in_array($elem["pleroma"]['conversation_id'], $user_settings['hide'])) { continue; } $json['id'] = $elem['id']; $json['scope'] = $elem['visibility']; if ($logedin) { $pos['mentions'] = ""; $array = $elem["mentions"]; $json['mentions'] = ($user_settings['acct'] == $elem["account"]['acct'] ? "" : "@" . $elem["account"]['acct']) . " "; if (!empty($array)) { foreach ($array as $mnt) { if ($mnt['acct'] != $user_settings['acct']) { $json['mentions'] .= "@" . $mnt['acct'] . " "; } } } } $post['json'] = json_encode($json); $post['menu'] = ""; $post['text'] = processText($elem); $post['spoiler'] = (empty($elem['spoiler_text']) ? "" : "" . $elem['spoiler_text'] . "
"); $post['media'] = ""; $urls = get_urls(strip_tags($elem['content'], '

')); if (!empty($urls)) { foreach ($urls as $url) { parse_str(parse_url($url, PHP_URL_QUERY) , $my_array_of_vars); if (isset($my_array_of_vars['v'])) { $post['media'] = ""; } } } if (!empty($elem['media_attachments'])) { if ($user_settings['attach'] != "off"){ $images = count($elem['media_attachments']); $class = ($images === 1 ? "" : ($images > 4 ? "class='smaller'" : "class='small'")); foreach ($elem['media_attachments'] as $file) { $ext = explode(".", $file['url']); $ext = end($ext); $ext = explode("?", $ext) [0]; if ($ext == 'mp4' || $ext == 'webm') { $post['media'] .= "
"; } elseif ($ext == 'mp3' || $ext == 'ogg') { $post['media'] .= "
"; } else { if ($elem['sensitive'] == true && $user_settings['explicit'] != 'off') { $post['media'] .= "
"; } else { //$post['media'] .= "
"; $post['media'] .= "
"; } } } } else { $post['text'] .= "

\n"; foreach ($elem['media_attachments'] as $file) { $post['text'] .= "See attachment ".($elem['sensitive'] == true ? "(NSFW)" : "")."
\n"; } } } $public = ""; $private = ""; $unlisted = ""; $direct = ""; $post['footer'] = "
" . date("d/m/y H:i", strtotime($elem['created_at'])) . " - " . $$elem['visibility'] . "
" . ($logedin ? "
" : "") . "
" . $elem['favourites_count'] . "
" . $elem['reblogs_count'] . "
" . $elem['replies_count'] . "
"; $post['form'] = ($tl['mode'] == 'thread' && $logedin ? str_replace(array( ":id:", ":content:" ) , array( $elem['id'], $json['mentions'] ) , file_get_contents("templates/replyform.txt")) : ""); $post['ancestors'] = " "; $post['descendants'] = " "; if ($tl['mode'] == 'thread') { foreach ($replies as $e) { if ($e['mode'] == 'ancestor') { $post['ancestors'] .= render_reply($e['content']); } else { $post['descendants'] .= render_reply($e['content']); } } } $post['style'] = ""; //($tl['mode'] == "single" ? "display:none;" : ""); $post['id'] = $elem['id']; $post['avatar'] = $elem['account']['avatar']; $post['notes'] = ""; if ($notes) { foreach ($notes as $note) { $post['notes'] .= "
" . ($note[0] == "fav" ? "" : "") . "
"; } } if ((empty($elem['media_attachments']) && $post['media'] == "") || (!(empty($elem['media_attachments']) && $post['media'] == "") && $user_settings['attach'] == "off")) { $post['template'] = file_get_contents("templates/textpost.txt"); } else { $post['template'] = file_get_contents("templates/post.txt"); } foreach ($post as $key => $value) { $post['template'] = str_replace(":$key:", $value, $post['template']); } echo $post['template']; unset($post); $e++; } if ((!isset($_GET['next']) || (isset($_GET['next']) && !isset($_GET['ajax']))) && !isset($_GET['since']) && !isset($_GET['thread'])) { $query = http_build_query(array_filter(array( 'user' => (isset($tl['user']) ? $tl['user'] : false) , 'mode' => $tl['mode'] ))); echo "
Load More Posts
"; } } ?>