mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-01-19 04:31:36 +00:00
Empty commit
This commit is contained in:
parent
373706ebae
commit
05d0134040
@ -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';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<table cellpadding="3" cellspacing="1" border="0" class="border slice" width="100%">
|
||||
<? if($this->NewTorrent){ ?>
|
||||
@ -663,6 +671,20 @@ function audiobook_form() {
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<? if(!$this->NewTorrent && check_perms('users_mod')) {?>
|
||||
<tr>
|
||||
<td class="label">Library Contest Upload</td>
|
||||
<td>
|
||||
<input type="checkbox" id="library_upload" name="library_upload"<? if ($LibraryUpload) { echo " checked='checked'";}?>/> Check this box if the torrent is library contest upload.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">Library Contest Points</td>
|
||||
<td>
|
||||
<input type="text" name="library_points" value="<?=$LibraryPoints?>" size="10" />
|
||||
</td>
|
||||
</tr>
|
||||
<? }?>
|
||||
<? if($this->NewTorrent) { ?>
|
||||
<tr>
|
||||
<td class="label">Tags</td>
|
||||
@ -683,6 +705,12 @@ function audiobook_form() {
|
||||
<p class="min_padding">Contains information like the track listing, and maybe a review.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label" style="font-weight: bold;">Library Contest Image Location</td>
|
||||
<td>
|
||||
<input type="text" id="library_image" name="library_image" size="60" /> <input type="checkbox" id="multi_disc" name="multi_disc" />Multi-disc Upload
|
||||
</td>
|
||||
</tr>
|
||||
<? }?>
|
||||
<tr>
|
||||
<td class="label">Release Description (optional)</td>
|
||||
|
11
gazelle.sql
11
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,
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -243,14 +243,4 @@
|
||||
)
|
||||
);
|
||||
|
||||
function pullmediainfo($Array) {
|
||||
$NewArray = array();
|
||||
foreach ($Array as $Item) {
|
||||
$NewArray[] = array(
|
||||
'id' => (int) $Item['id'],
|
||||
'name' => $Item['name']
|
||||
);
|
||||
}
|
||||
return $NewArray;
|
||||
}
|
||||
?>
|
||||
|
@ -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) {
|
||||
|
@ -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',
|
||||
|
@ -263,31 +263,22 @@ 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 ------------------------------------//
|
||||
$DB->query("UPDATE login_attempts SET Attempts=Attempts-1 WHERE Attempts>0");
|
||||
$DB->query("DELETE FROM login_attempts WHERE LastAttempt<'".time_minus(3600*24*90)."'");
|
||||
|
Loading…
Reference in New Issue
Block a user