"POST", "logged_in" => true]); $FeedResults = Database::singleton()->run( "SELECT feed.*, users.username FROM feed INNER JOIN users ON users.id = feed.userId WHERE userId = :uid OR groupId IS NULL AND userId IN ( SELECT (CASE WHEN requesterId = :uid THEN receiverId ELSE requesterId END) FROM friends WHERE :uid IN (requesterId, receiverId) AND status = 1 ) OR groupId IN ( SELECT groups_members.GroupID FROM groups_members INNER JOIN groups_ranks ON groups_ranks.GroupID = groups_members.GroupID AND groups_ranks.Rank = groups_members.Rank WHERE groups_members.UserID = :uid AND groups_ranks.permissions LIKE '%\"CanViewGroupStatus\":true%' ) ORDER BY feed.id DESC LIMIT 15", [":uid" => SESSION["user"]["id"]] ); $feed = []; $news = []; /*$news[] = [ "header" => '

lol

', "message" => 'fucked your mom' ];*/ /*$news[] = [ "header" => '

this isn\'t dead!!!! (probably)

', "message" => "ive been more inclined to work on polygon now after like 4 months, so i guess development has resumed

2fa has been implemented, and next on the roadmap is the catalog system. so yeah, stay tuned for that" ];*/ /* $news[] = [ "header" => "", "img" => "https://media.discordapp.net/attachments/745025397749448814/835635922590629888/HDKolobok-256px-3.gif", // "message" => "What you know about KOLONBOK. ™ " "message" => "KOLONBOK. ™ Has fix 2009" ]; */ /* $news[] = [ "header" => "Groups have been released!", "img" => "/img/ProjectPolygon.png", "message" => "Groups have now been fully released, with more functionality than you could ever imagine. Groups don't cost anything to make, and you can join up to 20 of them.
If you haven't yet, come join the official group!" ]; */ /* $news[] = [ "header" => "", "img" => "https://media.discordapp.net/attachments/745025397749448814/835635922590629888/HDKolobok-256px-3.gif", "message" => "What you know about KOLONBOK. ™ " ]; */ while($row = $FeedResults->fetch(\PDO::FETCH_OBJ)) { $timestamp = timeSince($row->timestamp); if($row->groupId == NULL) { $feed[] = [ "userName" => $row->username, "img" => Thumbnails::GetAvatar($row->userId), "header" => "

userId}\">{$row->username} - {$timestamp}

", "message" => Polygon::FilterText($row->text) ]; } else { $GroupInfo = Groups::GetGroupInfo($row->groupId, true, true); $GroupInfo->name = htmlspecialchars($GroupInfo->name); $feed[] = [ "userName" => $GroupInfo->name, "img" => Thumbnails::GetAssetFromID($GroupInfo->emblem), "header" => "

id}\">{$GroupInfo->name} - posted by userId}\">{$row->username} - {$timestamp}

", "message" => Polygon::FilterText($row->text) ]; } } $FeedCount = $FeedResults->rowCount(); if($FeedCount < 15) { $feed[] = [ "userName" => "Your feed is currently empty!", "img" => "/img/feed/friends.png", "header" => "

Looks like your feed's empty

", "message" => "If you haven't made any friends yet, go make some!
If you already have some, why don't you kick off the discussion?" ]; if($FeedCount < 14) { $feed[] = [ "userName" => "Customize your character", "img" => "/img/feed/cart.png", "header" => "

Customize your character

", "message" => "Log in every day and earn 10 pizzas. Pizzas can be used to buy clothing in our catalog. You can also create your own clothing on the Build page." ]; } } API::respondCustom(["status" => 200, "success" => true, "message" => "OK", "feed" => $feed, "news" => $news]);