diff --git a/classes/class_torrent_form.php b/classes/class_torrent_form.php index 4fbd5b5c..8c794ad3 100644 --- a/classes/class_torrent_form.php +++ b/classes/class_torrent_form.php @@ -597,6 +597,14 @@ function music_form($GenreTags) { function audiobook_form() { $Torrent = $this->Torrent; + if (!$this->NewTorrent) { + global $DB; + $DB->query("SELECT UserID, Points FROM library_contest WHERE TorrentID = ".$this->TorrentID); + list($LibraryUser, $LibraryPoints) = $DB->next_record(); + if ($LibraryUser != "") { + $LibraryUpload = '1'; + } + } ?> NewTorrent){ ?> @@ -663,6 +671,20 @@ function audiobook_form() { +NewTorrent && check_perms('users_mod')) {?> + + + + + + + + +NewTorrent) { ?> @@ -683,6 +705,12 @@ function audiobook_form() {

Contains information like the track listing, and maybe a review.

+ + + + diff --git a/gazelle.sql b/gazelle.sql index 17d8482c..4a33bfb2 100644 --- a/gazelle.sql +++ b/gazelle.sql @@ -1151,17 +1151,6 @@ 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/ajax/index.php b/sections/ajax/index.php index 26af8171..c7f33339 100644 --- a/sections/ajax/index.php +++ b/sections/ajax/index.php @@ -85,4 +85,15 @@ print json_encode(array('status' => 'failure')); } +function pullmediainfo($Array) { + $NewArray = array(); + foreach ($Array as $Item) { + $NewArray[] = array( + 'id' => (int) $Item['id'], + 'name' => $Item['name'] + ); + } + return $NewArray; +} + ?> diff --git a/sections/ajax/request.php b/sections/ajax/request.php index 37810378..cf94ab52 100644 --- a/sections/ajax/request.php +++ b/sections/ajax/request.php @@ -243,14 +243,4 @@ ) ); -function pullmediainfo($Array) { - $NewArray = array(); - foreach ($Array as $Item) { - $NewArray[] = array( - 'id' => (int) $Item['id'], - 'name' => $Item['name'] - ); - } - return $NewArray; -} ?> diff --git a/sections/ajax/torrentgroup.php b/sections/ajax/torrentgroup.php index b44b6588..d4980adb 100644 --- a/sections/ajax/torrentgroup.php +++ b/sections/ajax/torrentgroup.php @@ -20,6 +20,26 @@ function filter_by_key($input, $keys) { return array_intersect_key($input, array_flip($keys)); } $TorrentDetails = filter_by_key($TorrentCache[0][0], $GroupAllowed); + +$ArtistForm = get_artist($GroupID); +if($TorrentDetails['CategoryID'] == 0) { + $CategoryName = "Unknown"; +} else { + $CategoryName = $Categories[$TorrentDetails['CategoryID'] - 1]; +} +$JsonMusicInfo = array(); +if ($CategoryName == "Music") { + $JsonMusicInfo = array( + 'composers' => $ArtistForm[4] == null ? array() : pullmediainfo($ArtistForm[4]), + 'dj' => $ArtistForm[6] == null ? array() : pullmediainfo($ArtistForm[6]), + 'artists' => $ArtistForm[1] == null ? array() : pullmediainfo($ArtistForm[1]), + 'with' => $ArtistForm[2] == null ? array() : pullmediainfo($ArtistForm[2]), + 'conductor' => $ArtistForm[5] == null ? array() : pullmediainfo($ArtistForm[5]), + 'remixedBy' => $ArtistForm[3] == null ? array() : pullmediainfo($ArtistForm[3]), + 'producer' => $ArtistForm[7] == null ? array() : pullmediainfo($ArtistForm[7]) + ); +} + $JsonTorrentDetails = array( 'wikiBody' => $Text->full_format($TorrentDetails['WikiBody']), 'wikiImage' => $TorrentDetails['WikiImage'], @@ -30,9 +50,10 @@ function filter_by_key($input, $keys) { return array_intersect_key($input, array 'catalogueNumber' => $TorrentDetails['CatalogueNumber'], 'releaseType' => (int) $TorrentDetails['ReleaseType'], 'categoryId' => (int) $TorrentDetails['CategoryID'], + 'categoryName' => $CategoryName, 'time' => $TorrentDetails['Time'], 'vanityHouse' => $TorrentDetails['VanityHouse'] == 1, - 'artists' => get_artist($GroupID), + 'musicInfo' => $JsonMusicInfo ); $TorrentList = array(); foreach ($TorrentCache[1] as $Torrent) { diff --git a/sections/reportsv2/array.php b/sections/reportsv2/array.php index a20c4b27..29a0d748 100644 --- a/sections/reportsv2/array.php +++ b/sections/reportsv2/array.php @@ -84,6 +84,23 @@ 'delete' => '0', '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' => "" + ) ) ), '1' => array( //Music Resolves @@ -550,23 +567,6 @@ '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/schedule/index.php b/sections/schedule/index.php index 5d2f3632..16f112c8 100644 --- a/sections/schedule/index.php +++ b/sections/schedule/index.php @@ -263,29 +263,20 @@ function next_hour() { //------------- Remove dead sessions ---------------------------------------// sleep(3); - $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); - $Cache->delete_row($SessionID); - $Cache->commit_transaction(0); - } - - - $DB->query("DELETE FROM users_sesions WHERE LastUpdate<'$AgoDays' AND KeepLogged='1'"); - - $AgoMins = time_minus(60*30); - $DB->query("SELECT UserID, SessionID FROM users_sessions WHERE Active = 1 AND LastUpdate<'$AgoMins' AND KeepLogged='0'"); - while(list($UserID,$SessionID) = $DB->next_record()) { + $AgoDays = time_minus(3600*24*30); + + + $SessionQuery = $DB->query("SELECT UserID, SessionID FROM users_sessions + WHERE (LastUpdate<'$AgoDays' AND KeepLogged='1') OR (LastUpdate<'$AgoMins' AND KeepLogged='0')"); + $DB->query("DELETE FROM users_sessions WHERE (LastUpdate<'$AgoDays' AND KeepLogged='1') OR (LastUpdate<'$AgoMins' AND KeepLogged='0')"); + + $DB->set_query_id($SessionQuery); + while(list($UserID, $SessionID) = $DB->next_record()) { $Cache->begin_transaction('users_sessions_'.$UserID); $Cache->delete_row($SessionID); $Cache->commit_transaction(0); } - - - $DB->query("DELETE FROM users_sessions WHERE LastUpdate<'$AgoMins' AND KeepLogged='0'"); - //------------- Lower Login Attempts ------------------------------------//
Library Contest Upload + /> Check this box if the torrent is library contest upload. +
Library Contest Points + +
Tags
Library Contest Image Location +   Multi-disc Upload +
Release Description (optional)