Empty commit

This commit is contained in:
Git 2013-10-28 08:01:14 +00:00
parent c87186d11a
commit c1b5e99afc
4 changed files with 22 additions and 9 deletions

View File

@ -72,12 +72,7 @@
</form>
<a href="#" onclick="if (confirm('Are you sure?') == true) { $('#delete_<?=$Question['ID']?>').raw().submit(); } return false;" class="brackets">Delete</a>
-
<form class="hidden" id="ignore_<?=$Question['ID']?>" method="post" action="">
<input type="hidden" name="action" value="take_ignore_question" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<input type="hidden" name="question_id" value="<?=$Question['ID']?>" />
</form>
<a href="#" onclick="if (confirm('Are you sure?') == true) { $('#ignore_<?=$Question['ID']?>').raw().submit(); } return false;" class="brackets">Ignore</a>
<a href="#" id="<?=$Question['ID']?>" class="brackets ignore_link">Ignore</a>
-
<a href="#" id="<?=$Question['ID']?>" class="answer_link brackets">Answer</a>
</span>

View File

@ -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.");
}

View File

@ -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");

View File

@ -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();
});
});
});