diff --git a/classes/class_torrent_form.php b/classes/class_torrent_form.php
index 7234e48d..4fbd5b5c 100644
--- a/classes/class_torrent_form.php
+++ b/classes/class_torrent_form.php
@@ -180,6 +180,7 @@ function music_form($GenreTags) {
}
}
+ global $DB;
$HasLog = $Torrent['HasLog'];
$HasCue = $Torrent['HasCue'];
$BadTags = $Torrent['BadTags'];
@@ -187,6 +188,13 @@ function music_form($GenreTags) {
$BadFiles = $Torrent['BadFiles'];
$CassetteApproved = $Torrent['CassetteApproved'];
$LossymasterApproved = $Torrent['LossymasterApproved'];
+ if (!$this->NewTorrent) {
+ $DB->query("SELECT UserID, Points FROM library_contest WHERE TorrentID = ".$this->TorrentID);
+ list($LibraryUser, $LibraryPoints) = $DB->next_record();
+ }
+ if ($LibraryUser != "") {
+ $LibraryUpload = '1';
+ }
global $ReleaseTypes;
?>
@@ -511,6 +519,18 @@ function music_form($GenreTags) {
/> Check this box if the torrent is an approved lossy master.
+
+ Library Contest Upload |
+
+ /> Check this box if the torrent is library contest upload.
+ |
+
+
+ Library Contest Points |
+
+
+ |
+
} ?>
if($this->NewTorrent) { ?>
@@ -554,6 +574,12 @@ function music_form($GenreTags) {
Contains background information such as album history and maybe a review.
+
+ Library Contest Image Location |
+
+ Multi-disc Upload
+ |
+
} // if new torrent ?>
Release Description (optional) |
diff --git a/gazelle.sql b/gazelle.sql
index 150ae2fe..17d8482c 100644
--- a/gazelle.sql
+++ b/gazelle.sql
@@ -389,6 +389,7 @@ CREATE TABLE `ip_bans` (
CREATE TABLE `library_contest` (
`UserID` int(10) NOT NULL,
`TorrentID` int(10) NOT NULL,
+ `Points` int(10) NOT NULL DEFAULT '0',
PRIMARY KEY (`UserID`,`TorrentID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -1150,6 +1151,17 @@ CREATE TABLE `users_history_passwords` (
`ChangerIP` varchar(15) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+CREATE TABLE `users_history_sessions` (
+ `UserID` int(11) NOT NULL DEFAULT '0',
+ `SessionID` char(32) NOT NULL DEFAULT '',
+ `Browser` varchar(40) DEFAULT NULL,
+ `OperatingSystem` varchar(8) DEFAULT NULL,
+ `IP` varchar(15) DEFAULT NULL,
+ `LastUpdate` datetime DEFAULT NULL,
+ PRIMARY KEY (`UserID`,`SessionID`),
+ KEY `LastUpdate` (`LastUpdate`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
CREATE TABLE `users_info` (
`UserID` int(10) unsigned NOT NULL,
`StyleID` int(10) unsigned NOT NULL,
diff --git a/sections/reportsv2/array.php b/sections/reportsv2/array.php
index d43d82ed..a20c4b27 100644
--- a/sections/reportsv2/array.php
+++ b/sections/reportsv2/array.php
@@ -550,6 +550,23 @@
'pm' => ""
)
),
+ 'library' => array(
+ 'priority' => '90',
+ 'title' => 'Library Contest Request',
+ 'report_messages' => array(
+ "Make sure to include a link to the image so we can verify it is a library upload.",
+ "Please indicate if this is a multi-disc upload in the Comments field. A simple 'yes' or 'no' will do."
+ ),
+ 'report_fields' => array(
+ 'image' => '1'
+ ),
+ 'resolve_options' => array(
+ 'upload' => '0',
+ 'warn' => '0',
+ 'delete' => '0',
+ 'pm' => ""
+ )
+ ),
'ogg' => array(
'priority' => '11',
'title' => 'Disallowed Ogg Preset',
diff --git a/sections/reportsv2/static.php b/sections/reportsv2/static.php
index 07bce6d0..937e86e7 100644
--- a/sections/reportsv2/static.php
+++ b/sections/reportsv2/static.php
@@ -303,6 +303,7 @@
[DL]
uploaded by =$UploaderName?> =time_diff($Time)?>
+ if ($ReporterName == "") { $ReporterName = "System"; } ?>
was reported by
=$ReporterName?> =time_diff($ReportedTime)?> for the reason:
=$ReportType['title']?>
if($Status != 'Resolved') {
diff --git a/sections/reportsv2/takeresolve.php b/sections/reportsv2/takeresolve.php
index 2af4de68..817c7afb 100644
--- a/sections/reportsv2/takeresolve.php
+++ b/sections/reportsv2/takeresolve.php
@@ -168,6 +168,10 @@
$Cache->delete_value('torrents_details_'.$GroupID);
$SendPM = true;
}
+ if ($_POST['resolve_type'] == "library") {
+ $DB->query("INSERT INTO library_contest (UserID, TorrentID, Points) VALUES (".$UploaderID.", ".$TorrentID.", 1)");
+ $SendPM = false;
+ }
//Log and delete
if(isset($Escaped['delete']) && check_perms('users_mod')) {
diff --git a/sections/schedule/index.php b/sections/schedule/index.php
index cf2cf8a9..5d2f3632 100644
--- a/sections/schedule/index.php
+++ b/sections/schedule/index.php
@@ -263,7 +263,7 @@ function next_hour() {
//------------- Remove dead sessions ---------------------------------------//
sleep(3);
- $AgoDays = time_minus(3600*24*30);
+ $AgoDays = time_minus(3600*24*30);
$DB->query("SELECT UserID, SessionID FROM users_sessions WHERE Active = 1 AND LastUpdate<'$AgoDays' AND KeepLogged='1'");
while(list($UserID,$SessionID) = $DB->next_record()) {
$Cache->begin_transaction('users_sessions_'.$UserID);
diff --git a/sections/torrents/takeedit.php b/sections/torrents/takeedit.php
index 35936481..b0c92cf9 100644
--- a/sections/torrents/takeedit.php
+++ b/sections/torrents/takeedit.php
@@ -46,6 +46,8 @@
$Properties['BadFiles'] = (isset($_POST['bad_files'])) ? 1 : 0;
$Properties['CassetteApproved'] = (isset($_POST['cassette_approved']))? 1 : 0;
$Properties['LossymasterApproved'] = (isset($_POST['lossymaster_approved']))? 1 : 0;
+$Properties['LibraryUpload'] = (isset($_POST['library_upload']))? 1 : 0;
+$Properties['LibraryPoints'] = (isset($_POST['library_points']))? $_POST['library_points'] : 0;
$Properties['Format'] = $_POST['format'];
$Properties['Media'] = $_POST['media'];
$Properties['Bitrate'] = $_POST['bitrate'];
@@ -88,10 +90,12 @@
error(403);
}
+$DB->query("SELECT UserID FROM torrents WHERE ID = ".$TorrentID);
+list($UploaderID) = $DB->next_record();
+
+
if($Properties['UnknownRelease'] && !($Remastered == '1' && !$RemasterYear) && !check_perms('edit_unknowns')) {
//It's Unknown now, and it wasn't before
- $DB->query("SELECT UserID FROM torrents WHERE ID = ".$TorrentID);
- list($UploaderID) = $DB->next_record();
if($LoggedUser['ID'] != $UploaderID) {
//Hax
die();
@@ -328,6 +332,17 @@
$DB->query("DELETE FROM torrents_bad_files WHERE TorrentID='$TorrentID'");
}
+ $DB->query("SELECT TorrentID FROM library_contest WHERE TorrentID='$TorrentID'");
+ list($lbID) = $DB->next_record();
+ if (!$lbID && $Properties['LibraryUpload'] && $Properties['LibraryPoints'] > 0) {
+ $DB->query("SELECT UserID FROM torrents WHERE ID = ".$TorrentID);
+ list($UploaderID) = $DB->next_record();
+ $DB->query("INSERT INTO library_contest VALUES ($UploaderID, $TorrentID, $Properties[LibraryPoints])");
+ }
+ if ($lbID && !$Properties['LibraryUpload']) {
+ $DB->query("DELETE FROM library_contest WHERE TorrentID='$TorrentID'");
+ }
+
$DB->query("SELECT TorrentID FROM torrents_cassette_approved WHERE TorrentID='$TorrentID'");
list($caID) = $DB->next_record();
diff --git a/sections/upload/upload_handle.php b/sections/upload/upload_handle.php
index 79f19dad..6d8fd2ae 100644
--- a/sections/upload/upload_handle.php
+++ b/sections/upload/upload_handle.php
@@ -58,6 +58,8 @@
$Properties['Media'] = $_POST['media'];
$Properties['Bitrate'] = $_POST['bitrate'];
$Properties['Encoding'] = $_POST['bitrate'];
+$Properties['LibraryImage'] = $_POST['library_image'];
+$Properties['MultiDisc'] = $_POST['multi_disc'];
$Properties['TagList'] = $_POST['tags'];
$Properties['Image'] = $_POST['image'];
$Properties['GroupDescription'] = trim($_POST['album_desc']);
@@ -698,6 +700,13 @@
}
}
+//******************************************************************************//
+//--------------- Contest ------------------------------------------------------//
+if ($Properties['LibraryImage'] != "") {
+ $DB->query("INSERT INTO reportsv2 (ReporterID, TorrentID, Type, UserComment, Status, ReportedTime, Track, Image, ExtraID, Link)
+ VALUES (0, ".$TorrentID.", 'library', '".db_string(($Properties['MultiDisc'] ? "Multi-disc" : ""))."', 'New', '".sqltime()."', '', '".db_string($Properties['LibraryImage'])."', '', '')");
+}
+
//******************************************************************************//
//--------------- IRC announce and feeds ---------------------------------------//
$Announce = "";
diff --git a/sections/user/user.php b/sections/user/user.php
index 6dccefe2..239d5e98 100644
--- a/sections/user/user.php
+++ b/sections/user/user.php
@@ -224,6 +224,12 @@ function check_paranoia_here($Setting) {
} ?>
if ($OwnProfile || check_paranoia_here(false)) { //if ($OwnProfile || check_perms('users_mod')) { ?>
Tokens: =number_format($FLTokens)?>
+ } ?>
+ if ($OwnProfile || check_paranoia_here(false)) {
+ $DB->query("SELECT SUM(Points) FROM library_contest WHERE UserID = ".$UserID);
+ list($LibraryUploads) = $DB->next_record();
+ ?>
+ Library Points: =number_format($LibraryUploads)?>
} ?>