id; $name = $row->name; $classes = $row->classes; $grade = $row->grade; $image = $row->image_url; $teacher = $row->teacher; if($_COOKIE["IB_ID"]==$_GET['user']){ $accountOwner = true; }else{ $accountOwner = false; } if($id == NULL){ msg("User doesn't exist."); header('Location: https://ib.lukeogburn.com/forum/'); } ?>
href=&type=forum>POSTS href=&type=saved>SAVED
\n"; } if($accountOwner){ if(verifyUser("admin")){ $admin = "

Admin Portal

"; } echo "

Logout

Account Settings

Report Site Issue

$admin
"; } ?>
0?$_GET["page"]:1; $start = $limit * ($page - 1); //setting amount of posts allowed on page if($_GET["type"]=="saved"){ //Getting the saved posts conn(); $stop = $limit+1; $stmt = $conn->prepare("SELECT * FROM bookmarks WHERE user_id = :uid ORDER BY unused_id DESC LIMIT $start,$stop"); $stmt->bindParam(":uid", $_GET["user"]); $stmt->execute(); $row = $stmt->fetchAll(); $count = $stmt->rowCount(); $row = array_slice($row, 0, $limit); foreach($row as $thing){ $stmt = $conn->prepare("SELECT * FROM forums WHERE post_id = :pid"); $stmt->bindParam(":pid", $thing["post_id"]); $stmt->execute(); $post = $stmt->fetchAll(); makePost($post[0]); } if($count == 0){ $referer = $accountOwner?"your":getUserInfo($_GET["user"])->name."'s"; echo "

This is where ".$referer." saved posts would be

"; } }else{ //Getting user's posts conn(); $stop = $limit+1; $stmt = $conn->prepare("SELECT * FROM forums WHERE poster_id = :pid ORDER BY date DESC LIMIT $start,$stop"); $stmt->bindParam(":pid", $_GET["user"]); $stmt->execute(); $row = $stmt->fetchAll(); $count = $stmt->rowCount(); $row = array_slice($row, 0, $limit); foreach($row as $post){ makePost($post); } } //Getting how many posts the user has made $stmt = $conn->prepare("SELECT COUNT(*) FROM forums WHERE poster_id = :id"); $stmt->bindParam(":id", $_GET["user"]); $stmt->execute(); $numOfPosts = $postCount = $stmt->fetchColumn(0); $numOfPosts = $numOfPosts==1?"$numOfPosts Post":"$numOfPosts Posts"; if($postCount == 0 && $_GET["type"]!="saved"){ $referer = $accountOwner?"your":getUserInfo($_GET["user"])->name."'s"; echo "

This is where ".$referer." posts would be

"; } //Page arrows echo "
"; $user = $_GET["user"]; $type = $_GET["type"]; echo $page!=1?"":"
"; echo $count>$limit?"":"
"; echo "
"; ?>
\n"; } if($accountOwner){ if(verifyUser("admin")){ $admin = "

Admin Portal

"; } echo "
"; } ?>