" : ""); if ($logedin && $rel[0]['following']) { $profile['top'] .= " "; } 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"; } /* The NSFW button is available even to non logged in users, the value is stored in a cookie */ $profile['top'] .= "" . (in_array($info['id'], $user_settings['nsfw']) ? "NSFW " : "NSFW ") . ""; /* display some indicators (blocked, muting, etc) for loged in users only */ if ($logedin) { $profile['bottom'] = " " . ($info['locked'] ? " Locked" : "") . " " . ($rel[0]['followed_by'] ? " Follows You" : "") . " " . ($rel[0]['blocking'] ? " Blocked" : "") . " " . ($rel[0]['muting'] ? " Muted" : "") . " "; } else { $profile['bottom'] = ""; } /* some values are processed from the profile and stored in the $profile array*/ $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']; /* now we replace the text of the index of $profile array with the contents of the index in the fetched template */ foreach ($profile as $key => $value) { $template = str_replace(":$key:", $value, $template); } echo $template; } elseif (!isset($_GET['next']) && !isset($_GET['since'])) { echo ""; } /* if the timeline array is empty or the content is not a post, we just display an error message. */ if ((!isset($thread[0]['id']) && !empty($thread)) || !is_array($thread)) { echo "