From ec6016cd38fc5ce6455cace6ffbc703f78f31096 Mon Sep 17 00:00:00 2001 From: msquare Date: Tue, 15 Nov 2016 16:28:20 +0100 Subject: reduce complexity of menu and hints --- includes/pages/admin_questions.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'includes/pages/admin_questions.php') diff --git a/includes/pages/admin_questions.php b/includes/pages/admin_questions.php index 8c16255c..13614a66 100644 --- a/includes/pages/admin_questions.php +++ b/includes/pages/admin_questions.php @@ -4,18 +4,23 @@ function admin_questions_title() { return _("Answer questions"); } +/** + * Renders a hint for new questions to answer. + */ function admin_new_questions() { - global $privileges; + global $privileges, $page; - if (in_array("admin_questions", $privileges)) { - $new_messages = sql_num_query("SELECT * FROM `Questions` WHERE `AID` IS NULL"); - - if ($new_messages > 0) { - return info('' . _('There are unanswered questions!') . '', true); + if ($page != "admin_questions") { + if (in_array("admin_questions", $privileges)) { + $new_messages = sql_num_query("SELECT * FROM `Questions` WHERE `AID` IS NULL"); + + if ($new_messages > 0) { + return info('' . _('There are unanswered questions!') . '', true); + } } } - return ""; + return null; } function admin_questions() { -- cgit v1.2.3-54-g00ecf