clean($_REQUEST['profileid'],'encode'); $check = $db->select('profile','*','username',$profile); $profileid = $db->intcast($check[0]['id']); } else { $check = $db->select('profile','*','id',$uid); $profileid = $db->intcast($check[0]['id']); } if($profileid == $db->intcast($_SESSION['uid'])) { $followbutton = false; } else { $followbutton = true; } $uid = $profileid; // get database information on profile. //$profile = $db->select('profile','*','id',$uid); $timeline = $db->select('timeline','*','uid',$uid); $userprofile = []; $profile = []; $stmt = $mysqli->prepare("SELECT * FROM profile where id = ? LIMIT 1"); $params = array("s",$uid); foreach($params as $key => $value) $userprofile[$key] = &$params[$key]; call_user_func_array(array($stmt, 'bind_param'), $userprofile); $stmt->execute(); if($stmt->error) { echo $stmt->error; } $query = $stmt->get_result(); while($row = $query->fetch_array(MYSQLI_ASSOC)) { $profile[] = $row; } $stmt->close(); $stats_followers = $db->query("SELECT COUNT(*) AS followers FROM friends where uid = '".$uid."'"); $stats_following = $db->query("SELECT COUNT(*) AS following FROM friends where fid = '".$uid."'"); // 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'); } // count number of times from timeline $numberoftimelines = count($timeline); if($numberoftimelines < 1) { $numberoftimelines = 0; } ?>
close(); ?>