'; $toid = $db->intcast($_REQUEST['toid']); // login check if(isset($_SESSION['loggedin']) || $_SESSION['loggedin'] != '') { $uid = $db->intcast($_SESSION['uid']); } else { header("Location: ../"); exit; } // get and set a proper token for our instance. if(!isset($_SESSION['token']) || empty($_SESSION['token']) ) { $csrf = $db->getToken(); $_SESSION['token'] = $csrf; } else { $csrf = $db->clean($_SESSION['token'],'encode'); } $friend_list = ''; $selectfriends = $db->query("SELECT * FROM friends WHERE uid = '".$db->intcast($uid)."' and blk != '1' LIMIT 50"); $countfriends = count($selectfriends); if($countfriends >=1) { for($j=0; $j<$countfriends; $j++) { $userprofiles = $db->query("SELECT id,username,photo FROM profile WHERE id = '".$db->intcast($selectfriends[$j]['fid'])."'"); $count = count($userprofiles); if($count >=1) { for($i=0;$i<$count;$i++) { $active = ''; if($toid == $userprofiles[$i]['id']) { $active = '-active'; } $showbubblealert = 'messenger-image-follow-list'; $messages = []; $stmt = $mysqli->prepare("SELECT COUNT(message) FROM messenger where toid = ? AND uid = ? AND readit != ?"); $uid = $db->intcast($_SESSION['uid']); $readit = 1; $fromid = $userprofiles[$i]['id']; $stmt->bind_param("iii", $uid, $fromid, $readit); $stmt->execute(); $query = $stmt->get_result(); while($row = $query->fetch_array(MYSQLI_ASSOC)) { $messages[] = $row; } if($messages[0]["COUNT(message)"] >=1) { $showbubblealert = 'messenger-image-follow-list-new'; } $friend_list .= "
"; $friend_list .= "
"; $friend_list .= "clean($userprofiles[$i]['username'],'encode'))."\" title=\"".ucfirst($db->clean($userprofiles[$i]['username'],'encode'))."\" style=\"background:url('".$host.$db->clean($userprofiles[$i]['photo'],'encode')."') !important; background-size: cover!important;\">"; $friend_list .= "
".$db->clean($userprofiles[$i]['username'],'encode')."
"; $friend_list .= "
"; } } } } else { $friend_list .= "
No friends yet, start making new friends.
"; } $profile = $db->query("SELECT id,username,photo FROM profile WHERE id = '".$db->intcast($uid)."'"); ?> Twigpage - Social Timelines.