<?php include 'config.php'; include 'header.php'; isLogin(); $user_details = R::findOne('user', ' twitter_name = ?', array(optional_param('u'))); $tweets = R::find('tweets', ' userid = ? ORDER BY id DESC', array($user_details['id'])); $following = R::findOne('following', 'userid = ? AND follows = ?', array($_SESSION['user_id'], $user_details->id)); if (empty($following)) { $current_user_follow_check = false; } else { $current_user_follow_check = true; } $profile_image = profilePicPath($user_details->id); ?> <div class="container-narrow"> <div class="jumbotron"> <div class="row"> <div class="span4"> <div class="well"> <div class="flex-module profile-summary js-profile-summary"> <a href="user.php?u=<?php echo $user_details['twitter_name']; ?> " class="account-summary account-summary-small js-nav" data-nav="profile"> <div class="content"> <div class="row"> <div class="span1"> <div class="account-group js-mini-current-user" data-user-id="47271576" data-screen-name="robinflyhigh"> <?php profilePic($user_details->id);
user.bio, tweets.tweets FROM tweets tweets INNER JOIN user user ON (tweets.userid = user.id) WHERE (tweets.userid = ' . $_SESSION['user_id'] . ' OR tweets.userid IN (SELECT following.follows FROM following following WHERE (following.userid = ' . $_SESSION['user_id'] . '))) ORDER BY tweets.id DESC '); foreach ($followers_tweet as $key => $ft) { $name = $ft['fullname']; $twitter_name = $ft['twitter_name']; $tweet = $ft['tweets']; $profile_image = profilePicPath($ft['id']); echo <<<OP \t\t\t\t\t\t<div class="media"> \t\t\t\t\t\t\t<a class="pull-left" href="user.php?u={$twitter_name}"> \t\t\t\t\t\t\t\t<img class="media-object" alt="64x64" style="width: 64px;" src="{$profile_image}"> \t\t\t\t\t\t\t</a> \t\t\t\t\t\t\t<div class="media-body"> \t\t\t\t\t\t\t\t<a href="user.php?u={$twitter_name}"> \t\t\t\t\t\t\t\t\t<h4 class="media-heading">{$name} | @{$twitter_name}</h4> \t\t\t\t\t\t\t\t</a> \t\t\t\t\t\t\t\t{$tweet} \t\t\t\t\t\t\t</div> \t\t\t\t\t\t</div> \t\t\t\t\t\t<hr> OP;
UNION SELECT DISTINCT user.id FROM following following INNER JOIN user user ON (following.userid = user.id) WHERE (following.follows = ' . $_SESSION['user_id'] . ') ) '); foreach ($other_user_data as $key => $oud) { $name = $oud['fullname']; $twitter_name = $oud['twitter_name']; $bio = $oud['bio']; $uid = $oud['id']; $profile_image = profilePicPath($oud['id']); $following = R::findOne('following', 'userid = ? AND follows = ?', array($_SESSION['user_id'], $uid)); if (empty($following)) { $current_user_follow_check = false; } else { $current_user_follow_check = true; } if ($current_user_follow_check) { $follow_button = '<p><button data-method="unfollow" data-userid=' . $uid . ' type="button" class="follow-unfollow btn-mini btn-primary pull-right">Unfollow</button></p>'; } else { $follow_button = '<p><button data-method="follow" data-userid=' . $uid . ' type="button" class="follow-unfollow btn-mini btn-warning pull-right">Follow</button></p>'; } echo <<<OP \t\t\t\t\t\t<div class="media"> \t\t\t\t\t\t\t<a class="pull-left" href="user.php?u={$twitter_name}"> \t\t\t\t\t\t<img class="media-object" data-src="" alt="64x64" style="width: 64px;" src="{$profile_image}">