intcast($_SESSION['uid']); } else { $statuslogged = "Log in"; $statusloggedurl = "../login/"; $uid = $db->intcast($_SESSION['uid']); } if(isset($_REQUEST['profileid'])) { $pid = str_replace('@','',$_REQUEST['profileid']); $profile = $db->clean($pid,'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; if($uid < 1) { header("Location: ../"); exit; } // photo editor if(isset($_POST['photo-editor-result'])) { if($_SESSION['token'] == $db->clean($_POST['csrf'],'encode')) { // update database with css. $stmt = $mysqli->prepare("UPDATE profile SET headerfilter = ? WHERE id = ?"); $headerfilter = $db->clean($_POST['photo-editor-result'],'encode'); $userid = $uid; $stmt->bind_param("si", $headerfilter, $userid); $stmt->execute(); } } // get database information on profile. $timeline = $db->query("SELECT * FROM timeline WHERE uid = ".$db->intcast($uid)." ORDER BY tid DESC"); $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(); $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)."'"); // 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; } ?> css($profile[0]["bodycolor"],$profile[0]["textcolor"],$profile[0]["background"]); } else { echo $social->css($profile[0]["bodycolor"],$profile[0]["textcolor"],false); } } } ?>
" />
close(); ?>