diff --git a/sections/questions/questions.php b/sections/questions/questions.php index 974b1722..5c28c68f 100644 --- a/sections/questions/questions.php +++ b/sections/questions/questions.php @@ -72,12 +72,7 @@ Delete - -
- Ignore + Ignore - Answer diff --git a/sections/questions/take_ask_question.php b/sections/questions/take_ask_question.php index 0426c94a..3d0ace3d 100644 --- a/sections/questions/take_ask_question.php +++ b/sections/questions/take_ask_question.php @@ -4,7 +4,8 @@ authorize(); $DB->query("SELECT COUNT(1) FROM user_questions WHERE UserID = '$LoggedUser[ID]'"); -if ($DB->record_count() >= MAX_QUESTIONS) { +list($Results) = $DB->next_record(); +if ($Results >= MAX_QUESTIONS) { error("You have asked too many questions for the time being."); } diff --git a/sections/questions/take_ignore_question.php b/sections/questions/take_ignore_question.php index a1cc6516..7b94a15f 100644 --- a/sections/questions/take_ignore_question.php +++ b/sections/questions/take_ignore_question.php @@ -1,9 +1,10 @@ +authorize(); if (!check_perms("users_mod")) { error(404); } -$ID = $_POST['question_id']; +$ID = $_POST['id']; if (!is_number($ID)) { error(404); @@ -15,4 +16,3 @@ VALUES ('$ID', '$LoggedUser[ID]')"); -header("Location: questions.php"); diff --git a/static/functions/questions.js b/static/functions/questions.js index 4fbb2461..a55a0527 100644 --- a/static/functions/questions.js +++ b/static/functions/questions.js @@ -44,5 +44,22 @@ $(document).ready(function() { respDiv.toggle(); } }); + + $(".ignore_link").click(function(e) { + e.preventDefault(); + var id = this.id; + $.ajax({ + type : "POST", + url : "questions.php?action=take_ignore_question", + data : { + "auth" : authkey, + "id" : id + } + }).done(function() { + $("#question" + id).remove(); + $("#answer" + id).remove(); + $("#responses_for_" + id).remove(); + }); + }); });