intcast($_REQUEST['uid']); $statusid = $db->intcast($_REQUEST['status']); } else { $statuslogged = "Log in"; $statusloggedurl = "../login/"; header("Location: ../"); exit; } if(isset($_REQUEST['profileid'])) { $profile = $db->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 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'); } $timeline = $db->select('timeline','*','tid',$statusid); $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 = '".$db->intcast($uid)."'"); $stats_following = $db->query("SELECT COUNT(*) AS following FROM friends where fid = '".$db->intcast($uid)."'"); // count number of times from timeline $numberoftimelines = $db->intcast(count($timeline)); if($numberoftimelines < 1) { $numberoftimelines = 0; } ?>
css($profile[0]["bodycolor"],$profile[0]["textcolor"]); } } ?>