diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 4022b664..74e92d0b 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -1,5 +1,8 @@ CHANGE LOG +2015-10-27 by newman +Paginate ask the staff + 2015-10-24 by newman Implement locked accounts and site options. Locked accounts is an intermediary between enabled and disabled, and is presented on a user's staff tools. It limits the user to navigating to only the locked page and staffpm. Site options eliminates the need to hardcode values that may change in the future. diff --git a/sections/questions/questions.php b/sections/questions/questions.php index 24f772fb..7448ebdc 100644 --- a/sections/questions/questions.php +++ b/sections/questions/questions.php @@ -3,6 +3,8 @@ error(404); } Text::$TOC = true; +define('QUESTIONS_PER_PAGE', 25); +list($Page, $Limit) = Format::page_limit(QUESTIONS_PER_PAGE); $DB->query(" SELECT @@ -28,7 +30,8 @@ FROM staff_answers AS sq WHERE sq.UserID = '$LoggedUser[ID]' ) - ORDER BY uq.Date DESC"); + ORDER BY uq.Date DESC + LIMIT $Limit"); $Questions = $DB->to_array(); $DB->query(" @@ -37,8 +40,13 @@ list($TotalQuestions) = $DB->next_record(); View::show_header('Ask the Staff', 'questions,bbcode'); - -?> +if ($TotalQuestions > QUESTIONS_PER_PAGE) { ?> +