Empty commit

This commit is contained in:
Git 2013-10-18 08:00:55 +00:00
parent 7b2b81dd0f
commit c2c3a83ea0
5 changed files with 46 additions and 37 deletions

View File

@ -770,6 +770,14 @@ CREATE TABLE `requests_votes` (
KEY `Bounty` (`Bounty`) KEY `Bounty` (`Bounty`)
) ENGINE=InnoDB CHARSET utf8; ) 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` ( CREATE TABLE `schedule` (
`NextHour` int(2) NOT NULL DEFAULT '0', `NextHour` int(2) NOT NULL DEFAULT '0',
`NextDay` 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, `UserID` int(10) NOT NULL,
`Answer` mediumtext, `Answer` mediumtext,
`Date` datetime NOT NULL, `Date` datetime NOT NULL,
PRIMARY KEY (`QuestionID`,`UserID`) PRIMARY KEY (`QuestionID`,`UserID`),
KEY `UserID` (`UserID`)
) ENGINE=InnoDB CHARSET utf8; ) ENGINE=InnoDB CHARSET utf8;
CREATE TABLE `staff_blog` ( CREATE TABLE `staff_blog` (
@ -1019,7 +1028,9 @@ CREATE TABLE `staff_pm_conversations` (
`Date` datetime DEFAULT NULL, `Date` datetime DEFAULT NULL,
`Unread` tinyint(1) DEFAULT NULL, `Unread` tinyint(1) DEFAULT NULL,
`ResolverID` int(11) 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; ) ENGINE=InnoDB CHARSET utf8;
CREATE TABLE `staff_pm_messages` ( CREATE TABLE `staff_pm_messages` (

View File

@ -1,15 +1,10 @@
<? <?
$ID = (int)$_GET['id'];
include(SERVER_ROOT.'/classes/text.class.php');
$Text = new TEXT(true);
$ID = (int) $_POST['id'];
if (empty($ID)) { if (empty($ID)) {
die(); die();
} }
$Text = new TEXT(true);
$UserID = (int) $_POST['userid']; $UserID = (int)$_GET['userid'];
$UserIDSQL = ""; $UserIDSQL = "";
if (!empty($UserID)) { if (!empty($UserID)) {
$UserIDSQL = " AND UserID != '$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"); G::$DB->query("SELECT UserID, Answer, Date FROM staff_answers WHERE QuestionID = '$ID' $UserIDSQL ORDER BY DATE DESC");
$Answers = G::$DB->to_array(); $Answers = G::$DB->to_array(MYSQLI_ASSOC);
?> foreach($Answers as $Answer) { ?>
<div class="box box2">
<div id="responses_for_<?=$ID?>" style="margin-left: 20px;"> <div class="head">
<? foreach($Answers as $Answer) { ?> <span>
<div class="box box2" > Answer by <?=Users::format_username($Answer['UserID'])?> - <?=time_diff($Answer['Date'])?>
<div class="head"> </span>
<span>
Answer by <?=Users::format_username($Answer['UserID'])?> - <?=time_diff($Answer['Date'])?>
</span>
</div>
<div class="pad">
<?=$Text->full_format($Answer['Answer'])?>
</div>
</div> </div>
<? } ?> <div class="pad">
</div> <?=$Text->full_format($Answer['Answer'])?>
</div>
</div>
<? } ?>

View File

@ -555,7 +555,7 @@ function filelist($Str) {
$Reported = false; $Reported = false;
unset($ReportedTimes); unset($ReportedTimes);
$Reports = $Cache->get_value('reports_torrent_'.$TorrentID); $Reports = $Cache->get_value("reports_torrent_$TorrentID");
if ($Reports === false) { if ($Reports === false) {
$DB->query(" $DB->query("
SELECT r.ID, SELECT r.ID,
@ -573,7 +573,11 @@ function filelist($Str) {
if (count($Reports) > 0) { if (count($Reports) > 0) {
$Reported = true; $Reported = true;
include(SERVER_ROOT.'/sections/reportsv2/array.php'); include(SERVER_ROOT.'/sections/reportsv2/array.php');
$ReportInfo = "\n<table class=\"reportinfo_table\">\n\t<tr class=\"colhead_dark\" style=\"font-weight: bold;\">\n\t\t<td>This torrent has ".count($Reports).' active '.(count($Reports) > 1 ? 'reports' : 'report').":</td>\n\t</tr>"; $ReportInfo = '
<table class="reportinfo_table">
<tr class="colhead_dark" style="font-weight: bold;">
<td>This torrent has '.count($Reports).' active '.(count($Reports) > 1 ? 'reports' : 'report').":</td>
</tr>";
foreach ($Reports as $Report) { foreach ($Reports as $Report) {
list($ReportID, $ReporterID, $ReportType, $ReportReason, $ReportedTime) = $Report; list($ReportID, $ReporterID, $ReportType, $ReportReason, $ReportedTime) = $Report;

View File

@ -37,7 +37,8 @@
/* uTorrent Remote and various scripts redownload .torrent files periodically. /* uTorrent Remote and various scripts redownload .torrent files periodically.
To prevent this retardation from blowing bandwidth etc., let's block it To prevent this retardation from blowing bandwidth etc., let's block it
if the .torrent file has been downloaded four times before */ 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(" $DB->query("
SELECT 1 SELECT 1
FROM users_downloads FROM users_downloads

View File

@ -1,13 +1,12 @@
$(document).ready(function() { $(document).ready(function() {
var open_responses =
$(".answer_link").click(function(e) { $(".answer_link").click(function(e) {
e.preventDefault(); e.preventDefault();
id = this.id; var id = this.id;
$("#answer" + id).gtoggle(); $("#answer" + id).gtoggle();
}); });
$(".submit_button").click(function(e) { $(".submit_button").click(function(e) {
id = this.id; var id = this.id;
$.ajax({ $.ajax({
type : "POST", type : "POST",
url : "questions.php?action=take_answer_question", url : "questions.php?action=take_answer_question",
@ -25,10 +24,13 @@ $(document).ready(function() {
$(".view_responses").click(function(e) { $(".view_responses").click(function(e) {
e.preventDefault(); e.preventDefault();
id = this.id; var id = this.id;
if ($("#responses_for_" + id).length == 0) { var respDiv = $("#responses_for_" + id);
if (respDiv.length == 0) {
respDiv = $('<div id="responses_for_' + id + '" style="display: none; margin-left: 20px;"></div>');
$("#question" + id).after(respDiv);
$.ajax({ $.ajax({
type : "POST", type : "GET",
url : "questions.php?action=ajax_get_answers", url : "questions.php?action=ajax_get_answers",
dataType : "html", dataType : "html",
data : { data : {
@ -36,10 +38,10 @@ $(document).ready(function() {
"userid" : $(this).data("gazelle-userid") "userid" : $(this).data("gazelle-userid")
} }
}).done(function(response) { }).done(function(response) {
$("#question" + id).after(response); respDiv.html(response).show();
}); });
} else { } else {
$("#responses_for_" + id).remove(); respDiv.toggle();
} }
}); });
}); });