From 2191b39af1046248fb2fc78faea032b7ea9418d4 Mon Sep 17 00:00:00 2001 From: rootcoma Date: Thu, 7 Nov 2013 10:26:44 -0800 Subject: [PATCH] Changed adding questions, humans have access to .addquestion, added .(accept/remove/show)tempquestion (triviamod+) and added new questions to report.php --- php/reports.php | 49 ++++++++++++++++++++- plugin.py | 114 ++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 158 insertions(+), 5 deletions(-) diff --git a/php/reports.php b/php/reports.php index 9f23528..5b2851f 100644 --- a/php/reports.php +++ b/php/reports.php @@ -112,7 +112,7 @@ query('SELECT tr.*, tq.question as original FROM triviareport tr INNER JOIN triviaquestion tq on tq.id=question_num LIMIT 10'); + $q = $db->query('SELECT tr.*, tq.question as original FROM triviareport tr INNER JOIN triviaquestion tq on tq.id=question_num ORDER BY id DESC LIMIT 10'); if ($q === false) { die("Error: database error: table does not exist\n"); } else { @@ -227,6 +227,53 @@ + + +
+
+ +
+
+
+
+

Added Questions

+ + + + + + + + + + query('SELECT tq.* FROM triviatemporaryquestion tq ORDER BY tq.id DESC LIMIT 10'); + if ($q === false) { + die("Error: database error: table does not exist\n"); + } else { + $result = $q->fetchAll(); + foreach($result as $res) { + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } + } + } else { + die('Couldnt connect to db'); + } + ?> + +
#AuthorNew Question
' . $res['id'] . '' . $res['username'] . '' . $res['question'] . '
+
+
+