diff --git a/gazelle.sql b/gazelle.sql
index 8b71fea2..c6689034 100644
--- a/gazelle.sql
+++ b/gazelle.sql
@@ -770,6 +770,14 @@ CREATE TABLE `requests_votes` (
KEY `Bounty` (`Bounty`)
) ENGINE=InnoDB CHARSET utf8;
+CREATE TABLE `sacrifice` (
+ `UserID` int(10) NOT NULL,
+ `Time` datetime NOT NULL,
+ `Sacrifice1` text NOT NULL,
+ `Sacrifice2` text NOT NULL,
+ `IsValid` tinyint(4) NOT NULL
+) ENGINE=InnoDB CHARSET utf8;
+
CREATE TABLE `schedule` (
`NextHour` int(2) NOT NULL DEFAULT '0',
`NextDay` int(2) NOT NULL DEFAULT '0',
@@ -982,7 +990,8 @@ CREATE TABLE `staff_answers` (
`UserID` int(10) NOT NULL,
`Answer` mediumtext,
`Date` datetime NOT NULL,
- PRIMARY KEY (`QuestionID`,`UserID`)
+ PRIMARY KEY (`QuestionID`,`UserID`),
+ KEY `UserID` (`UserID`)
) ENGINE=InnoDB CHARSET utf8;
CREATE TABLE `staff_blog` (
@@ -1019,7 +1028,9 @@ CREATE TABLE `staff_pm_conversations` (
`Date` datetime DEFAULT NULL,
`Unread` tinyint(1) DEFAULT NULL,
`ResolverID` int(11) DEFAULT NULL,
- PRIMARY KEY (`ID`)
+ PRIMARY KEY (`ID`),
+ KEY `StatusAssigned` (`Status`,`AssignedToUser`),
+ KEY `StatusLevel` (`Status`,`Level`)
) ENGINE=InnoDB CHARSET utf8;
CREATE TABLE `staff_pm_messages` (
diff --git a/sections/questions/ajax_get_answers.php b/sections/questions/ajax_get_answers.php
index 2d2dd0e0..ef51fd34 100644
--- a/sections/questions/ajax_get_answers.php
+++ b/sections/questions/ajax_get_answers.php
@@ -1,15 +1,10 @@
-
-include(SERVER_ROOT.'/classes/text.class.php');
-$Text = new TEXT(true);
-
-$ID = (int) $_POST['id'];
-
+$ID = (int)$_GET['id'];
if (empty($ID)) {
die();
}
-
-$UserID = (int) $_POST['userid'];
+$Text = new TEXT(true);
+$UserID = (int)$_GET['userid'];
$UserIDSQL = "";
if (!empty($UserID)) {
$UserIDSQL = " AND UserID != '$UserID' ";
@@ -17,20 +12,16 @@
G::$DB->query("SELECT UserID, Answer, Date FROM staff_answers WHERE QuestionID = '$ID' $UserIDSQL ORDER BY DATE DESC");
-$Answers = G::$DB->to_array();
-?>
-
-
- foreach($Answers as $Answer) { ?>
-
-
-
- Answer by =Users::format_username($Answer['UserID'])?> - =time_diff($Answer['Date'])?>
-
-
-
- =$Text->full_format($Answer['Answer'])?>
-
+$Answers = G::$DB->to_array(MYSQLI_ASSOC);
+foreach($Answers as $Answer) { ?>
+
+
+
+ Answer by =Users::format_username($Answer['UserID'])?> - =time_diff($Answer['Date'])?>
+
- } ?>
-
+
+ =$Text->full_format($Answer['Answer'])?>
+
+
+ } ?>
diff --git a/sections/torrents/details.php b/sections/torrents/details.php
index 8aea2ded..7289c4a3 100644
--- a/sections/torrents/details.php
+++ b/sections/torrents/details.php
@@ -555,7 +555,7 @@ function filelist($Str) {
$Reported = false;
unset($ReportedTimes);
- $Reports = $Cache->get_value('reports_torrent_'.$TorrentID);
+ $Reports = $Cache->get_value("reports_torrent_$TorrentID");
if ($Reports === false) {
$DB->query("
SELECT r.ID,
@@ -573,7 +573,11 @@ function filelist($Str) {
if (count($Reports) > 0) {
$Reported = true;
include(SERVER_ROOT.'/sections/reportsv2/array.php');
- $ReportInfo = "\n
\n\t\n\t\tThis torrent has ".count($Reports).' active '.(count($Reports) > 1 ? 'reports' : 'report').": | \n\t
";
+ $ReportInfo = '
+
+
+ This torrent has '.count($Reports).' active '.(count($Reports) > 1 ? 'reports' : 'report').": |
+
";
foreach ($Reports as $Report) {
list($ReportID, $ReporterID, $ReportType, $ReportReason, $ReportedTime) = $Report;
diff --git a/sections/torrents/download.php b/sections/torrents/download.php
index 45b8f11b..6b15e938 100644
--- a/sections/torrents/download.php
+++ b/sections/torrents/download.php
@@ -37,7 +37,8 @@
/* uTorrent Remote and various scripts redownload .torrent files periodically.
To prevent this retardation from blowing bandwidth etc., let's block it
if the .torrent file has been downloaded four times before */
-if ((strpos($_SERVER['HTTP_USER_AGENT'], 'BTWebClient') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Python-urllib') !== false)) {
+$ScriptUAs = array('BTWebClient*', 'Python-urllib*', 'python-requests*');
+if (Misc::in_array_partial($_SERVER['HTTP_USER_AGENT'], $ScriptUAs)) {
$DB->query("
SELECT 1
FROM users_downloads
diff --git a/static/functions/questions.js b/static/functions/questions.js
index 7729e523..4fbb2461 100644
--- a/static/functions/questions.js
+++ b/static/functions/questions.js
@@ -1,13 +1,12 @@
$(document).ready(function() {
- var open_responses =
$(".answer_link").click(function(e) {
e.preventDefault();
- id = this.id;
+ var id = this.id;
$("#answer" + id).gtoggle();
});
$(".submit_button").click(function(e) {
- id = this.id;
+ var id = this.id;
$.ajax({
type : "POST",
url : "questions.php?action=take_answer_question",
@@ -25,10 +24,13 @@ $(document).ready(function() {
$(".view_responses").click(function(e) {
e.preventDefault();
- id = this.id;
- if ($("#responses_for_" + id).length == 0) {
+ var id = this.id;
+ var respDiv = $("#responses_for_" + id);
+ if (respDiv.length == 0) {
+ respDiv = $('');
+ $("#question" + id).after(respDiv);
$.ajax({
- type : "POST",
+ type : "GET",
url : "questions.php?action=ajax_get_answers",
dataType : "html",
data : {
@@ -36,10 +38,10 @@ $(document).ready(function() {
"userid" : $(this).data("gazelle-userid")
}
}).done(function(response) {
- $("#question" + id).after(response);
+ respDiv.html(response).show();
});
} else {
- $("#responses_for_" + id).remove();
+ respDiv.toggle();
}
});
});