query("SELECT SQL_CALC_FOUND_ROWS rc.AuthorID, r.ID as RequestID, r.Title, rc.ID as PostID, rc.Body, rc.AddedTime, rc.EditedTime, rc.EditedUserID as EditorID FROM requests as r JOIN requests_comments as rc ON rc.RequestID = r.ID $ExtraJoin $Conditions GROUP BY rc.ID ORDER BY rc.AddedTime DESC LIMIT $Limit;"); $Count = $DB->record_count(); $DB->query("SELECT FOUND_ROWS()"); list($Results) = $DB->next_record(); $Pages=Format::get_pages($Page,$Results,$PerPage, 11); View::show_header($Title,'bbcode'); $DB->set_query_id($Comments); $Links = array(); $BaseLink = 'comments.php?action=requests' . (!$Self ? '&id='.$UserID : ''); if ($Mode != 'normal') { $Links[] = 'Display request comments you\'ve made'; } if ($Mode != 'created') { $Links[] = 'Display comments left on your requests'; } if ($Mode != 'voted') { $Links[] = 'Display comments left on requests you\'ve voted on'; } $Links = implode(' ', $Links); ?>