include(SERVER_ROOT.'/classes/text.class.php'); $Text = new TEXT(true); $UserID = $_GET['userid']; if (!is_number($UserID)) { error("No UserID"); } $Permissions = Permissions::get_permissions_for_user($UserID); if (!isset($Permissions['users_mod']) || !$Permissions['users_mod']) { error(404); } $UserInfo = Users::user_info($UserID); G::$DB->query(" SELECT u.Username, q.ID, q.Question, q.UserID, q.Date AS QuestionDate, a.Answer, a.Date AS AnswerDate, ( SELECT COUNT(1) FROM staff_answers WHERE QuestionID = q.ID AND UserID != '$UserID' ) AS Responses FROM user_questions AS q JOIN staff_answers AS a ON q.ID = a.QuestionID JOIN users_main AS u ON u.ID = q.UserID WHERE a.UserID = '$UserID' ORDER BY AnswerDate DESC"); $Questions = G::$DB->to_array(); View::show_header($UserInfo['Username'] . "'s answers", 'questions,bbcode'); ?>