From 105dadfb2ae96c09c015e36f22df8b31482fc30c Mon Sep 17 00:00:00 2001 From: Bertrand Date: Thu, 24 May 2012 15:59:13 +0200 Subject: [PATCH 1/2] Handle false id in validation step + popup --- validation.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/validation.php b/validation.php index 48a6906..59e2a0e 100644 --- a/validation.php +++ b/validation.php @@ -29,13 +29,22 @@ $question = $file->get_question($id);

Validation de la question

Rappel de la question

- print_test() ?>
+ print_test(); - Vous pouvez valider la question. Cliquez simplement sur le - lien ci dessous.
+ echo "Vous pouvez valider la question. Cliquez simplement sur le + lien ci dessous.\n"; +} + ?>
+ onclick="validated(); $file->save() ?>; +alert('Question confirmée');"/>
From 07395d9cce55910fa237c083a4fa6e5bd87b905e Mon Sep 17 00:00:00 2001 From: Bertrand Date: Thu, 24 May 2012 16:22:35 +0200 Subject: [PATCH 2/2] validation -> Prevent from multiple validation - Not working --- Question.class.php | 5 +++++ confirmation.php | 22 ++++++++++++++++------ validation.php | 22 ++++++++++++++++++---- 3 files changed, 39 insertions(+), 10 deletions(-) diff --git a/Question.class.php b/Question.class.php index 32bdeb9..5a29c1c 100644 --- a/Question.class.php +++ b/Question.class.php @@ -111,6 +111,11 @@ class Question { return $this->id; } + + public function isValidated() + { + return $this->validated; + } } ?> \ No newline at end of file diff --git a/confirmation.php b/confirmation.php index 8c6e1dd..4b2557e 100644 --- a/confirmation.php +++ b/confirmation.php @@ -88,13 +88,23 @@ else

Merci de votre participation

- Votre question a bien été prise en compte.
- Un email a été envoyé à une personne du chan pour - qu'elle valide votre question. -

-

+ " + ."Un email a été envoyé à une personne du chan pour " + ."qu'elle valide votre question." + ."

+

Nemubot vous remercie de l'aider à agrandir sa base de donnée -

+

"); + } + ?> +
diff --git a/validation.php b/validation.php index 59e2a0e..a71a0cf 100644 --- a/validation.php +++ b/validation.php @@ -8,6 +8,8 @@ $id = $_GET['id']; $file = new QuestionsFile("questions.xml"); $question = $file->get_question($id); +$message = "Question validated maddafakka"; + ?> @@ -37,14 +39,26 @@ else { $question->print_test(); - echo "Vous pouvez valider la question. Cliquez simplement sur le - lien ci dessous.\n"; + echo "\n\n"; } ?>
+ onclick= +"isValidated()) +{ + $message = 'Votre question à déjà été validée' +. ' Merci de ne pas vous acharner.'; +} +else +{ + $question->validated(); + $file->save(); + $message = 'Question validée'; +} +?>; +alert('');"/>