/* MESSAGE POST-IT */ print '<div id="post_it"></div>'; require_once 'request.php'; /* DEFINE VARS */ $sess = getSessionUser($user, $user_id); $get = getUser($user); $post = getAllPosts(); $profile = 'all'; $fulltag = ''; /* WHICH POSTS TO SHOW*/ if (isset($_GET['profile'])) { $profile = preg_replace("/[^a-zA-Z0-9@#]/", "", $_GET['profile']); if ($profile == 'all') { $post = getAllPosts(); } elseif ($profile == 'at' . $sess['username']) { $post = findAt($sess['username']); } elseif (!$profile == getUser($profile)) { print '<div class="post_it"><h3>'; print "There's no user with that name..."; print '</h3><button type="button" id="hide_btn" class="button">close</button></div>'; } else { $post = getUserPosts($profile); $get = getUser($profile); } } /* CREATE TAGS */ if (isset($_GET['tag'])) { $tag = preg_replace('#[^a-z0-9_-å-ä-ö-Å-Ä-Ö-]#i', '', $_GET["tag"]); $fulltag = "#" . $tag; $post = findHashtag($fulltag); }
$following = getFollowers($get['user_id']); if (count($following) == 0) { print "None, follow " . $get['username'] . "!"; } else { print '<div id="online_container">'; foreach ($following as $following) { print '<div class="whos_online">'; print '<a href="profile.php?profile=' . $following['username'] . '" title="' . $following['username'] . '">' . getProfilePic($following['user_id'], '50px') . '</a>'; print '</div>'; } print '</div>'; } print '</div>'; print '</div>'; if ($sess['user_id'] == $get['user_id']) { print '<br><a href="profile.php?profile=at' . $sess['username'] . '">See where you have been mentioned</a><br>'; print '<a href="edit.php">Edit your settings</a>'; } print '</div>'; print '<div id="wrapper">'; if ($post == getAllPosts() || $post == getUserPosts($profile)) { require_once 'post.php'; } else { if ($post == findAt($sess['username'])) { require_once 'atpost.php'; } else { require_once 'tagpost.php'; } } print '</div>'; require_once 'footer.php';