(int)$User['UserID'], 'userName' => $User['Username'], 'bounty' => (int)$User['Bounty'] ); } reset($RequestVotes['Voters']); list($NumComments, $Page, $Thread) = Comments::load('requests', $RequestID, false); $JsonRequestComments = array(); foreach ($Thread as $Key => $Post) { list($PostID, $AuthorID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername) = array_values($Post); list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(Users::user_info($AuthorID)); $JsonRequestComments[] = array( 'postId' => (int)$PostID, 'authorId' => (int)$AuthorID, 'name' => $Username, 'donor' => ($Donor == 1), 'warned' => (bool)$Warned, 'enabled' => ($Enabled == 2 ? false : true), 'class' => Users::make_class_string($PermissionID), 'addedTime' => $AddedTime, 'avatar' => $Avatar, 'comment' => Text::full_format($Body), 'editedUserId' => (int)$EditedUserID, 'editedUsername' => $EditedUsername, 'editedTime' => $EditedTime ); } $JsonTags = array(); foreach ($Request['Tags'] as $Tag) { $JsonTags[] = $Tag; } json_die('success', array( 'requestId' => (int)$RequestID, 'requestorId' => (int)$Request['UserID'], 'requestorName' => $Requestor['Username'], 'isBookmarked' => Bookmarks::has_bookmarked('request', $RequestID), 'requestTax' => (float)$RequestTax, 'timeAdded' => $Request['TimeAdded'], 'canEdit' => (bool)$CanEdit, 'canVote' => (bool)$CanVote, 'minimumVote' => (int)$MinimumVote, 'voteCount' => (int)$VoteCount, 'lastVote' => $Request['LastVote'], 'topContributors' => $JsonTopContributors, 'totalBounty' => (int)$RequestVotes['TotalBounty'], 'categoryId' => (int)$CategoryID, 'categoryName' => $CategoryName, 'title' => $Request['Title'], 'year' => (int)$Request['Year'], 'image' => $Request['Image'], 'bbDescription' => $Request['Description'], 'description' => Text::full_format($Request['Description']), 'artists' => $JsonArtists, 'isFilled' => (bool)$IsFilled, 'fillerId' => (int)$Request['FillerID'], 'fillerName' => $Filler ? $Filler['Username'] : '', 'torrentId' => (int)$Request['TorrentID'], 'timeFilled' => $Request['TimeFilled'], 'tags' => $JsonTags, 'comments' => $JsonRequestComments, 'commentPage' => (int)$Page, 'commentPages' => (int)ceil($NumComments / TORRENT_COMMENTS_PER_PAGE) )); ?>