mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-01-18 20:21:37 +00:00
Empty commit
This commit is contained in:
parent
b4fe1d35f1
commit
4433edd805
@ -126,6 +126,16 @@
|
|||||||
$Subject = "Collage Comment Report: ID #".display_str($ThingID);
|
$Subject = "Collage Comment Report: ID #".display_str($ThingID);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'rippy':
|
||||||
|
$DB->query('SELECT Message FROM rippies WHERE ID = ' . $ThingID);
|
||||||
|
if ($DB->record_count() < 1) {
|
||||||
|
$Error = "No rippy message with the reported ID found";
|
||||||
|
} else {
|
||||||
|
list($Message) = $DB->next_record();
|
||||||
|
$TypeLink = 'the rippy message "' . display_str($Message) . '"';
|
||||||
|
$Subject = 'Rippy message report: '.display_str($Message);
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
error("Incorrect type");
|
error("Incorrect type");
|
||||||
break;
|
break;
|
||||||
|
@ -35,9 +35,9 @@
|
|||||||
$TypeID = $_POST['type'] + 1;
|
$TypeID = $_POST['type'] + 1;
|
||||||
$Properties['CategoryName'] = $Type;
|
$Properties['CategoryName'] = $Type;
|
||||||
$Properties['Title'] = $_POST['title'];
|
$Properties['Title'] = $_POST['title'];
|
||||||
$Properties['Remastered'] = (isset($_POST['remaster'])) ? 1 : 0;
|
$Properties['Remastered'] = ((isset($_POST['remaster'])) ? 1 : 0);
|
||||||
if ($Properties['Remastered'] || isset($_POST['unknown'])) {
|
if ($Properties['Remastered'] || isset($_POST['unknown'])) {
|
||||||
$Properties['UnknownRelease'] = (isset($_POST['unknown'])) ? 1 : 0;
|
$Properties['UnknownRelease'] = ((isset($_POST['unknown'])) ? 1 : 0);
|
||||||
$Properties['RemasterYear'] = $_POST['remaster_year'];
|
$Properties['RemasterYear'] = $_POST['remaster_year'];
|
||||||
$Properties['RemasterTitle'] = $_POST['remaster_title'];
|
$Properties['RemasterTitle'] = $_POST['remaster_title'];
|
||||||
$Properties['RemasterRecordLabel'] = $_POST['remaster_record_label'];
|
$Properties['RemasterRecordLabel'] = $_POST['remaster_record_label'];
|
||||||
@ -54,7 +54,7 @@
|
|||||||
$Properties['RecordLabel'] = $_POST['record_label'];
|
$Properties['RecordLabel'] = $_POST['record_label'];
|
||||||
$Properties['CatalogueNumber'] = $_POST['catalogue_number'];
|
$Properties['CatalogueNumber'] = $_POST['catalogue_number'];
|
||||||
$Properties['ReleaseType'] = $_POST['releasetype'];
|
$Properties['ReleaseType'] = $_POST['releasetype'];
|
||||||
$Properties['Scene'] = (isset($_POST['scene'])) ? 1 : 0;
|
$Properties['Scene'] = ((isset($_POST['scene'])) ? 1 : 0);
|
||||||
$Properties['Format'] = $_POST['format'];
|
$Properties['Format'] = $_POST['format'];
|
||||||
$Properties['Media'] = $_POST['media'];
|
$Properties['Media'] = $_POST['media'];
|
||||||
$Properties['Bitrate'] = $_POST['bitrate'];
|
$Properties['Bitrate'] = $_POST['bitrate'];
|
||||||
@ -86,30 +86,30 @@
|
|||||||
//******************************************************************************//
|
//******************************************************************************//
|
||||||
//--------------- Validate data in upload form ---------------------------------//
|
//--------------- Validate data in upload form ---------------------------------//
|
||||||
|
|
||||||
$Validate->SetFields('type','1','inarray','Please select a valid type.',array('inarray'=>array_keys($Categories)));
|
$Validate->SetFields('type','1','inarray','Please select a valid type.', array('inarray'=>array_keys($Categories)));
|
||||||
switch ($Type) {
|
switch ($Type) {
|
||||||
case 'Music':
|
case 'Music':
|
||||||
if (!$_POST['groupid']) {
|
if (!$_POST['groupid']) {
|
||||||
$Validate->SetFields('title',
|
$Validate->SetFields('title',
|
||||||
'1','string','Title must be between 1 and 200 characters.',array('maxlength'=>200, 'minlength'=>1));
|
'1','string','Title must be between 1 and 200 characters.', array('maxlength'=>200, 'minlength'=>1));
|
||||||
|
|
||||||
$Validate->SetFields('year',
|
$Validate->SetFields('year',
|
||||||
'1','number','The year of the original release must be entered.',array('length'=>40));
|
'1','number','The year of the original release must be entered.', array('length'=>40));
|
||||||
|
|
||||||
$Validate->SetFields('releasetype',
|
$Validate->SetFields('releasetype',
|
||||||
'1','inarray','Please select a valid release type.',array('inarray'=>array_keys($ReleaseTypes)));
|
'1','inarray','Please select a valid release type.', array('inarray'=>array_keys($ReleaseTypes)));
|
||||||
|
|
||||||
$Validate->SetFields('tags',
|
$Validate->SetFields('tags',
|
||||||
'1','string','You must enter at least one tag. Maximum length is 200 characters.',array('maxlength'=>200, 'minlength'=>2));
|
'1','string','You must enter at least one tag. Maximum length is 200 characters.', array('maxlength'=>200, 'minlength'=>2));
|
||||||
|
|
||||||
$Validate->SetFields('record_label',
|
$Validate->SetFields('record_label',
|
||||||
'0','string','Record label must be between 2 and 80 characters.',array('maxlength'=>80, 'minlength'=>2));
|
'0','string','Record label must be between 2 and 80 characters.', array('maxlength'=>80, 'minlength'=>2));
|
||||||
|
|
||||||
$Validate->SetFields('catalogue_number',
|
$Validate->SetFields('catalogue_number',
|
||||||
'0','string','Catalogue Number must be between 2 and 80 characters.',array('maxlength'=>80, 'minlength'=>2));
|
'0','string','Catalogue Number must be between 2 and 80 characters.', array('maxlength'=>80, 'minlength'=>2));
|
||||||
|
|
||||||
$Validate->SetFields('album_desc',
|
$Validate->SetFields('album_desc',
|
||||||
'1','string','The album description has a minimum length of 10 characters.',array('maxlength'=>1000000, 'minlength'=>10));
|
'1','string','The album description has a minimum length of 10 characters.', array('maxlength'=>1000000, 'minlength'=>10));
|
||||||
|
|
||||||
if ($Properties['Media'] == 'CD' && !$Properties['Remastered']) {
|
if ($Properties['Media'] == 'CD' && !$Properties['Remastered']) {
|
||||||
$Validate->SetFields('year', '1', 'number', 'You have selected a year for an album that predates the media you say it was created on.', array('minlength'=>1982));
|
$Validate->SetFields('year', '1', 'number', 'You have selected a year for an album that predates the media you say it was created on.', array('minlength'=>1982));
|
||||||
@ -129,19 +129,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$Validate->SetFields('remaster_title',
|
$Validate->SetFields('remaster_title',
|
||||||
'0','string','Remaster title must be between 2 and 80 characters.',array('maxlength'=>80, 'minlength'=>2));
|
'0','string','Remaster title must be between 2 and 80 characters.', array('maxlength'=>80, 'minlength'=>2));
|
||||||
if ($Properties['RemasterTitle'] == 'Original Release') {
|
if ($Properties['RemasterTitle'] == 'Original Release') {
|
||||||
$Validate->SetFields('remaster_title', '0', 'string', '"Orginal Release" is not a valid remaster title.');
|
$Validate->SetFields('remaster_title', '0', 'string', '"Orginal Release" is not a valid remaster title.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$Validate->SetFields('remaster_record_label',
|
$Validate->SetFields('remaster_record_label',
|
||||||
'0','string','Remaster record label must be between 2 and 80 characters.',array('maxlength'=>80, 'minlength'=>2));
|
'0','string','Remaster record label must be between 2 and 80 characters.', array('maxlength'=>80, 'minlength'=>2));
|
||||||
|
|
||||||
$Validate->SetFields('remaster_catalogue_number',
|
$Validate->SetFields('remaster_catalogue_number',
|
||||||
'0','string','Remaster catalogue number must be between 2 and 80 characters.',array('maxlength'=>80, 'minlength'=>2));
|
'0','string','Remaster catalogue number must be between 2 and 80 characters.', array('maxlength'=>80, 'minlength'=>2));
|
||||||
|
|
||||||
$Validate->SetFields('format',
|
$Validate->SetFields('format',
|
||||||
'1','inarray','Please select a valid format.',array('inarray'=>$Formats));
|
'1','inarray','Please select a valid format.', array('inarray'=>$Formats));
|
||||||
|
|
||||||
// Handle 'other' bitrates
|
// Handle 'other' bitrates
|
||||||
if ($Properties['Encoding'] == 'Other') {
|
if ($Properties['Encoding'] == 'Other') {
|
||||||
@ -153,7 +153,9 @@
|
|||||||
$Validate->SetFields('other_bitrate',
|
$Validate->SetFields('other_bitrate',
|
||||||
'1','string','You must enter the other bitrate (max length: 9 characters).', array('maxlength'=>9));
|
'1','string','You must enter the other bitrate (max length: 9 characters).', array('maxlength'=>9));
|
||||||
$enc = trim($_POST['other_bitrate']);
|
$enc = trim($_POST['other_bitrate']);
|
||||||
if (isset($_POST['vbr'])) { $enc.=' (VBR)'; }
|
if (isset($_POST['vbr'])) {
|
||||||
|
$enc.= ' (VBR)';
|
||||||
|
}
|
||||||
|
|
||||||
$Properties['Encoding'] = $enc;
|
$Properties['Encoding'] = $enc;
|
||||||
$Properties['Bitrate'] = $enc;
|
$Properties['Bitrate'] = $enc;
|
||||||
@ -163,13 +165,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$Validate->SetFields('media',
|
$Validate->SetFields('media',
|
||||||
'1','inarray','Please select a valid media.',array('inarray'=>$Media));
|
'1','inarray','Please select a valid media.', array('inarray'=>$Media));
|
||||||
|
|
||||||
$Validate->SetFields('image',
|
$Validate->SetFields('image',
|
||||||
'0','link','The image URL you entered was invalid.',array('maxlength'=>255, 'minlength'=>12));
|
'0','link','The image URL you entered was invalid.', array('maxlength'=>255, 'minlength'=>12));
|
||||||
|
|
||||||
$Validate->SetFields('release_desc',
|
$Validate->SetFields('release_desc',
|
||||||
'0','string','The release description has a minimum length of 10 characters.',array('maxlength'=>1000000, 'minlength'=>10));
|
'0','string','The release description has a minimum length of 10 characters.', array('maxlength'=>1000000, 'minlength'=>10));
|
||||||
|
|
||||||
$Validate->SetFields('groupid', '0', 'number', 'Group ID was not numeric');
|
$Validate->SetFields('groupid', '0', 'number', 'Group ID was not numeric');
|
||||||
|
|
||||||
@ -178,19 +180,21 @@
|
|||||||
case 'Audiobooks':
|
case 'Audiobooks':
|
||||||
case 'Comedy':
|
case 'Comedy':
|
||||||
$Validate->SetFields('title',
|
$Validate->SetFields('title',
|
||||||
'1','string','Title must be between 2 and 200 characters.',array('maxlength'=>200, 'minlength'=>2));
|
'1','string','Title must be between 2 and 200 characters.', array('maxlength'=>200, 'minlength'=>2));
|
||||||
|
|
||||||
$Validate->SetFields('year',
|
$Validate->SetFields('year',
|
||||||
'1','number','The year of the release must be entered.');
|
'1','number','The year of the release must be entered.');
|
||||||
|
|
||||||
$Validate->SetFields('format',
|
$Validate->SetFields('format',
|
||||||
'1','inarray','Please select a valid format.',array('inarray'=>$Formats));
|
'1','inarray','Please select a valid format.', array('inarray'=>$Formats));
|
||||||
|
|
||||||
if ($Properties['Encoding'] == 'Other') {
|
if ($Properties['Encoding'] == 'Other') {
|
||||||
$Validate->SetFields('other_bitrate',
|
$Validate->SetFields('other_bitrate',
|
||||||
'1','string','You must enter the other bitrate (max length: 9 characters).', array('maxlength'=>9));
|
'1','string','You must enter the other bitrate (max length: 9 characters).', array('maxlength'=>9));
|
||||||
$enc = trim($_POST['other_bitrate']);
|
$enc = trim($_POST['other_bitrate']);
|
||||||
if (isset($_POST['vbr'])) { $enc.=' (VBR)'; }
|
if (isset($_POST['vbr'])) {
|
||||||
|
$enc.= ' (VBR)';
|
||||||
|
}
|
||||||
|
|
||||||
$Properties['Encoding'] = $enc;
|
$Properties['Encoding'] = $enc;
|
||||||
$Properties['Bitrate'] = $enc;
|
$Properties['Bitrate'] = $enc;
|
||||||
@ -200,16 +204,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$Validate->SetFields('album_desc',
|
$Validate->SetFields('album_desc',
|
||||||
'1','string','You must enter a proper audiobook description.',array('maxlength'=>1000000, 'minlength'=>10));
|
'1','string','You must enter a proper audiobook description.', array('maxlength'=>1000000, 'minlength'=>10));
|
||||||
|
|
||||||
$Validate->SetFields('tags',
|
$Validate->SetFields('tags',
|
||||||
'1','string','You must enter at least one tag. Maximum length is 200 characters.',array('maxlength'=>200, 'minlength'=>2));
|
'1','string','You must enter at least one tag. Maximum length is 200 characters.', array('maxlength'=>200, 'minlength'=>2));
|
||||||
|
|
||||||
$Validate->SetFields('release_desc',
|
$Validate->SetFields('release_desc',
|
||||||
'0','string','The release description has a minimum length of 10 characters.',array('maxlength'=>1000000, 'minlength'=>10));
|
'0','string','The release description has a minimum length of 10 characters.', array('maxlength'=>1000000, 'minlength'=>10));
|
||||||
|
|
||||||
$Validate->SetFields('image',
|
$Validate->SetFields('image',
|
||||||
'0','link','The image URL you entered was invalid.',array('maxlength'=>255, 'minlength'=>12));
|
'0','link','The image URL you entered was invalid.', array('maxlength'=>255, 'minlength'=>12));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'Applications':
|
case 'Applications':
|
||||||
@ -217,30 +221,30 @@
|
|||||||
case 'E-Books':
|
case 'E-Books':
|
||||||
case 'E-Learning Videos':
|
case 'E-Learning Videos':
|
||||||
$Validate->SetFields('title',
|
$Validate->SetFields('title',
|
||||||
'1','string','Title must be between 2 and 200 characters.',array('maxlength'=>200, 'minlength'=>2));
|
'1','string','Title must be between 2 and 200 characters.', array('maxlength'=>200, 'minlength'=>2));
|
||||||
|
|
||||||
$Validate->SetFields('tags',
|
$Validate->SetFields('tags',
|
||||||
'1','string','You must enter at least one tag. Maximum length is 200 characters.',array('maxlength'=>200, 'minlength'=>2));
|
'1','string','You must enter at least one tag. Maximum length is 200 characters.', array('maxlength'=>200, 'minlength'=>2));
|
||||||
|
|
||||||
$Validate->SetFields('release_desc',
|
$Validate->SetFields('release_desc',
|
||||||
'0','string','The release description has a minimum length of 10 characters.',array('maxlength'=>1000000, 'minlength'=>10));
|
'0','string','The release description has a minimum length of 10 characters.', array('maxlength'=>1000000, 'minlength'=>10));
|
||||||
|
|
||||||
$Validate->SetFields('image',
|
$Validate->SetFields('image',
|
||||||
'0','link','The image URL you entered was invalid.',array('maxlength'=>255, 'minlength'=>12));
|
'0','link','The image URL you entered was invalid.', array('maxlength'=>255, 'minlength'=>12));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$Validate->SetFields('rules',
|
$Validate->SetFields('rules',
|
||||||
'1','require','Your torrent must abide by the rules.');
|
'1','require','Your torrent must abide by the rules.');
|
||||||
|
|
||||||
$Err=$Validate->ValidateForm($_POST); // Validate the form
|
$Err = $Validate->ValidateForm($_POST); // Validate the form
|
||||||
|
|
||||||
|
|
||||||
$File = $_FILES['file_input']; // This is our torrent file
|
$File = $_FILES['file_input']; // This is our torrent file
|
||||||
$TorrentName = $File['tmp_name'];
|
$TorrentName = $File['tmp_name'];
|
||||||
|
|
||||||
if (!is_uploaded_file($TorrentName) || !filesize($TorrentName)) {
|
if (!is_uploaded_file($TorrentName) || !filesize($TorrentName)) {
|
||||||
$Err='No torrent file uploaded, or file is empty.';
|
$Err = 'No torrent file uploaded, or file is empty.';
|
||||||
} elseif (substr(strtolower($File['name']), strlen($File['name']) - strlen('.torrent')) !== '.torrent') {
|
} elseif (substr(strtolower($File['name']), strlen($File['name']) - strlen('.torrent')) !== '.torrent') {
|
||||||
$Err = "You seem to have put something other than a torrent file into the upload field. (".$File['name'].").";
|
$Err = "You seem to have put something other than a torrent file into the upload field. (".$File['name'].").";
|
||||||
}
|
}
|
||||||
@ -273,7 +277,7 @@
|
|||||||
//Multiple artists!
|
//Multiple artists!
|
||||||
|
|
||||||
$LogName = '';
|
$LogName = '';
|
||||||
if (empty($Properties['GroupID']) && empty($ArtistForm) && $Type == "Music") {
|
if (empty($Properties['GroupID']) && empty($ArtistForm) && $Type == 'Music') {
|
||||||
$MainArtistCount = 0;
|
$MainArtistCount = 0;
|
||||||
$ArtistNames = array();
|
$ArtistNames = array();
|
||||||
$ArtistForm = array(
|
$ArtistForm = array(
|
||||||
@ -301,7 +305,12 @@
|
|||||||
}
|
}
|
||||||
$LogName .= Artists::display_artists($ArtistForm, false, true, false);
|
$LogName .= Artists::display_artists($ArtistForm, false, true, false);
|
||||||
} elseif ($Type == 'Music' && empty($ArtistForm)) {
|
} elseif ($Type == 'Music' && empty($ArtistForm)) {
|
||||||
$DB->query("SELECT ta.ArtistID,aa.Name,ta.Importance FROM torrents_artists AS ta JOIN artists_alias AS aa ON ta.AliasID = aa.AliasID WHERE ta.GroupID = ".$Properties['GroupID']." ORDER BY ta.Importance ASC, aa.Name ASC;");
|
$DB->query("
|
||||||
|
SELECT ta.ArtistID, aa.Name, ta.Importance
|
||||||
|
FROM torrents_artists AS ta
|
||||||
|
JOIN artists_alias AS aa ON ta.AliasID = aa.AliasID
|
||||||
|
WHERE ta.GroupID = ".$Properties['GroupID']."
|
||||||
|
ORDER BY ta.Importance ASC, aa.Name ASC;");
|
||||||
while (list($ArtistID,$ArtistName,$ArtistImportance) = $DB->next_record(MYSQLI_BOTH, false)) {
|
while (list($ArtistID,$ArtistName,$ArtistImportance) = $DB->next_record(MYSQLI_BOTH, false)) {
|
||||||
$ArtistForm[$ArtistImportance][] = array('id' => $ArtistID, 'name' => display_str($ArtistName));
|
$ArtistForm[$ArtistImportance][] = array('id' => $ArtistID, 'name' => display_str($ArtistName));
|
||||||
$ArtistsUnescaped[$ArtistImportance][] = array('name' => $ArtistName);
|
$ArtistsUnescaped[$ArtistImportance][] = array('name' => $ArtistName);
|
||||||
@ -311,7 +320,7 @@
|
|||||||
|
|
||||||
|
|
||||||
if ($Err) { // Show the upload form, with the data the user entered
|
if ($Err) { // Show the upload form, with the data the user entered
|
||||||
$UploadForm=$Type;
|
$UploadForm = $Type;
|
||||||
include(SERVER_ROOT.'/sections/upload/upload.php');
|
include(SERVER_ROOT.'/sections/upload/upload.php');
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
@ -347,21 +356,29 @@
|
|||||||
$TorEnc = db_string($Tor->encode());
|
$TorEnc = db_string($Tor->encode());
|
||||||
$InfoHash = pack('H*', $Tor->info_hash());
|
$InfoHash = pack('H*', $Tor->info_hash());
|
||||||
|
|
||||||
$DB->query("SELECT ID FROM torrents WHERE info_hash='".db_string($InfoHash)."'");
|
$DB->query("
|
||||||
|
SELECT ID
|
||||||
|
FROM torrents
|
||||||
|
WHERE info_hash='".db_string($InfoHash)."'");
|
||||||
if ($DB->record_count() > 0) {
|
if ($DB->record_count() > 0) {
|
||||||
list($ID) = $DB->next_record();
|
list($ID) = $DB->next_record();
|
||||||
$DB->query("SELECT TorrentID FROM torrents_files WHERE TorrentID = ".$ID);
|
$DB->query("
|
||||||
|
SELECT TorrentID
|
||||||
|
FROM torrents_files
|
||||||
|
WHERE TorrentID = ".$ID);
|
||||||
if ($DB->record_count() > 0) {
|
if ($DB->record_count() > 0) {
|
||||||
$Err = '<a href="torrents.php?torrentid='.$ID.'">The exact same torrent file already exists on the site!</a>';
|
$Err = '<a href="torrents.php?torrentid='.$ID.'">The exact same torrent file already exists on the site!</a>';
|
||||||
} else {
|
} else {
|
||||||
// A lost torrent
|
// A lost torrent
|
||||||
$DB->query("INSERT INTO torrents_files (TorrentID, File) VALUES ($ID, '$TorEnc')");
|
$DB->query("
|
||||||
|
INSERT INTO torrents_files (TorrentID, File)
|
||||||
|
VALUES ($ID, '$TorEnc')");
|
||||||
$Err = '<a href="torrents.php?torrentid='.$ID.'">Thank you for fixing this torrent</a>';
|
$Err = '<a href="torrents.php?torrentid='.$ID.'">Thank you for fixing this torrent</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($Tor->Dec['encrypted_files'])) {
|
if (isset($Tor->Dec['encrypted_files'])) {
|
||||||
$Err = "This torrent contains an encrypted file list which is not supported here";
|
$Err = 'This torrent contains an encrypted file list which is not supported here';
|
||||||
}
|
}
|
||||||
|
|
||||||
// File list and size
|
// File list and size
|
||||||
@ -371,7 +388,7 @@
|
|||||||
$HasCue = 0;
|
$HasCue = 0;
|
||||||
$TmpFileList = array();
|
$TmpFileList = array();
|
||||||
$TooLongPaths = array();
|
$TooLongPaths = array();
|
||||||
$DirName = isset($Tor->Dec['info']['files']) ? Format::make_utf8($Tor->get_name()) : "";
|
$DirName = (isset($Tor->Dec['info']['files']) ? Format::make_utf8($Tor->get_name()) : '');
|
||||||
foreach ($FileList as $File) {
|
foreach ($FileList as $File) {
|
||||||
list($Size, $Name) = $File;
|
list($Size, $Name) = $File;
|
||||||
// add +log to encoding
|
// add +log to encoding
|
||||||
@ -435,7 +452,7 @@
|
|||||||
if ($DB->record_count() > 0) {
|
if ($DB->record_count() > 0) {
|
||||||
// Don't escape tg.Name. It's written directly to the log table
|
// Don't escape tg.Name. It's written directly to the log table
|
||||||
list($GroupID, $WikiImage, $WikiBody, $RevisionID, $Properties['Title'], $Properties['Year'], $Properties['ReleaseType'], $Properties['TagList']) = $DB->next_record(MYSQLI_NUM, array(4));
|
list($GroupID, $WikiImage, $WikiBody, $RevisionID, $Properties['Title'], $Properties['Year'], $Properties['ReleaseType'], $Properties['TagList']) = $DB->next_record(MYSQLI_NUM, array(4));
|
||||||
$Properties['TagList'] = str_replace(array(" ",".","_"), array(", ",".","."), $Properties['TagList']);
|
$Properties['TagList'] = str_replace(array(' ', '.', '_'), array(', ', '.', '.'), $Properties['TagList']);
|
||||||
if (!$Properties['Image'] && $WikiImage) {
|
if (!$Properties['Image'] && $WikiImage) {
|
||||||
$Properties['Image'] = $WikiImage;
|
$Properties['Image'] = $WikiImage;
|
||||||
$T['Image'] = "'".db_string($WikiImage)."'";
|
$T['Image'] = "'".db_string($WikiImage)."'";
|
||||||
@ -483,7 +500,7 @@
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// The album hasn't been uploaded. Try to get the artist ids
|
// The album hasn't been uploaded. Try to get the artist IDs
|
||||||
$DB->query("
|
$DB->query("
|
||||||
SELECT
|
SELECT
|
||||||
aa.ArtistID,
|
aa.ArtistID,
|
||||||
@ -526,12 +543,16 @@
|
|||||||
$ArtistForm[$Importance][$Num] = $ArtistsAdded[strtolower($Artist['name'])];
|
$ArtistForm[$Importance][$Num] = $ArtistsAdded[strtolower($Artist['name'])];
|
||||||
} else {
|
} else {
|
||||||
// Create artist
|
// Create artist
|
||||||
$DB->query("INSERT INTO artists_group (Name) VALUES ('".db_string($Artist['name'])."')");
|
$DB->query("
|
||||||
|
INSERT INTO artists_group (Name)
|
||||||
|
VALUES ('".db_string($Artist['name'])."')");
|
||||||
$ArtistID = $DB->inserted_id();
|
$ArtistID = $DB->inserted_id();
|
||||||
|
|
||||||
$Cache->increment('stats_artist_count');
|
$Cache->increment('stats_artist_count');
|
||||||
|
|
||||||
$DB->query("INSERT INTO artists_alias (ArtistID, Name) VALUES (".$ArtistID.", '".db_string($Artist['name'])."')");
|
$DB->query("
|
||||||
|
INSERT INTO artists_alias (ArtistID, Name)
|
||||||
|
VALUES ($ArtistID, '".db_string($Artist['name'])."')");
|
||||||
$AliasID = $DB->inserted_id();
|
$AliasID = $DB->inserted_id();
|
||||||
|
|
||||||
$ArtistForm[$Importance][$Num] = array('id' => $ArtistID, 'aliasid' => $AliasID, 'name' => $Artist['name']);
|
$ArtistForm[$Importance][$Num] = array('id' => $ArtistID, 'aliasid' => $AliasID, 'name' => $Artist['name']);
|
||||||
@ -547,13 +568,16 @@
|
|||||||
// Create torrent group
|
// Create torrent group
|
||||||
$DB->query("
|
$DB->query("
|
||||||
INSERT INTO torrents_group
|
INSERT INTO torrents_group
|
||||||
(ArtistID, CategoryID, Name, Year, RecordLabel, CatalogueNumber, Time, WikiBody, WikiImage, SearchText, ReleaseType, VanityHouse) VALUES
|
(ArtistID, CategoryID, Name, Year, RecordLabel, CatalogueNumber, Time, WikiBody, WikiImage, SearchText, ReleaseType, VanityHouse)
|
||||||
(0, ".$TypeID.", ".$T['Title'].", $T[Year], $T[RecordLabel], $T[CatalogueNumber], '".sqltime()."', '".db_string($Body)."', $T[Image], '$SearchText', $T[ReleaseType], $T[VanityHouse])");
|
VALUES
|
||||||
|
(0, $TypeID, ".$T['Title'].", $T[Year], $T[RecordLabel], $T[CatalogueNumber], '".sqltime()."', '".db_string($Body)."', $T[Image], '$SearchText', $T[ReleaseType], $T[VanityHouse])");
|
||||||
$GroupID = $DB->inserted_id();
|
$GroupID = $DB->inserted_id();
|
||||||
if ($Type == 'Music') {
|
if ($Type == 'Music') {
|
||||||
foreach ($ArtistForm as $Importance => $Artists) {
|
foreach ($ArtistForm as $Importance => $Artists) {
|
||||||
foreach ($Artists as $Num => $Artist) {
|
foreach ($Artists as $Num => $Artist) {
|
||||||
$DB->query("INSERT IGNORE INTO torrents_artists (GroupID, ArtistID, AliasID, UserID, Importance) VALUES (".$GroupID.", ".$Artist['id'].", ".$Artist['aliasid'].", ".$LoggedUser['ID'].", '".$Importance."')");
|
$DB->query("
|
||||||
|
INSERT IGNORE INTO torrents_artists (GroupID, ArtistID, AliasID, UserID, Importance)
|
||||||
|
VALUES ($GroupID, ".$Artist['id'].", ".$Artist['aliasid'].", ".$LoggedUser['ID'].", '$Importance')");
|
||||||
$Cache->increment('stats_album_count');
|
$Cache->increment('stats_album_count');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -561,8 +585,9 @@
|
|||||||
$Cache->increment('stats_group_count');
|
$Cache->increment('stats_group_count');
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$DB->query("UPDATE torrents_group SET
|
$DB->query("
|
||||||
Time='".sqltime()."'
|
UPDATE torrents_group
|
||||||
|
SET Time='".sqltime()."'
|
||||||
WHERE ID=$GroupID");
|
WHERE ID=$GroupID");
|
||||||
$Cache->delete_value('torrent_group_'.$GroupID);
|
$Cache->delete_value('torrent_group_'.$GroupID);
|
||||||
$Cache->delete_value('torrents_details_'.$GroupID);
|
$Cache->delete_value('torrents_details_'.$GroupID);
|
||||||
@ -577,13 +602,16 @@
|
|||||||
if (!$NoRevision) {
|
if (!$NoRevision) {
|
||||||
$DB->query("
|
$DB->query("
|
||||||
INSERT INTO wiki_torrents
|
INSERT INTO wiki_torrents
|
||||||
(PageID, Body, UserID, Summary, Time, Image) VALUES
|
(PageID, Body, UserID, Summary, Time, Image)
|
||||||
($GroupID, $T[GroupDescription], $LoggedUser[ID], 'Uploaded new torrent', '".sqltime()."', $T[Image])
|
VALUES
|
||||||
");
|
($GroupID, $T[GroupDescription], $LoggedUser[ID], 'Uploaded new torrent', '".sqltime()."', $T[Image])");
|
||||||
$RevisionID = $DB->inserted_id();
|
$RevisionID = $DB->inserted_id();
|
||||||
|
|
||||||
// Revision ID
|
// Revision ID
|
||||||
$DB->query("UPDATE torrents_group SET RevisionID='$RevisionID' WHERE ID=$GroupID");
|
$DB->query("
|
||||||
|
UPDATE torrents_group
|
||||||
|
SET RevisionID='$RevisionID'
|
||||||
|
WHERE ID=$GroupID");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tags
|
// Tags
|
||||||
@ -593,15 +621,19 @@
|
|||||||
$Tag = Misc::sanitize_tag($Tag);
|
$Tag = Misc::sanitize_tag($Tag);
|
||||||
if (!empty($Tag)) {
|
if (!empty($Tag)) {
|
||||||
$Tag = Misc::get_alias_tag($Tag);
|
$Tag = Misc::get_alias_tag($Tag);
|
||||||
$DB->query("INSERT INTO tags
|
$DB->query("
|
||||||
(Name, UserID) VALUES
|
INSERT INTO tags
|
||||||
('".$Tag."', $LoggedUser[ID])
|
(Name, UserID)
|
||||||
|
VALUES
|
||||||
|
('$Tag', $LoggedUser[ID])
|
||||||
ON DUPLICATE KEY UPDATE Uses=Uses+1;
|
ON DUPLICATE KEY UPDATE Uses=Uses+1;
|
||||||
");
|
");
|
||||||
$TagID = $DB->inserted_id();
|
$TagID = $DB->inserted_id();
|
||||||
|
|
||||||
$DB->query("INSERT INTO torrents_tags
|
$DB->query("
|
||||||
(TagID, GroupID, UserID, PositiveVotes) VALUES
|
INSERT INTO torrents_tags
|
||||||
|
(TagID, GroupID, UserID, PositiveVotes)
|
||||||
|
VALUES
|
||||||
($TagID, $GroupID, $LoggedUser[ID], 10)
|
($TagID, $GroupID, $LoggedUser[ID], 10)
|
||||||
ON DUPLICATE KEY UPDATE PositiveVotes=PositiveVotes+1;
|
ON DUPLICATE KEY UPDATE PositiveVotes=PositiveVotes+1;
|
||||||
");
|
");
|
||||||
@ -635,9 +667,11 @@
|
|||||||
//******************************************************************************//
|
//******************************************************************************//
|
||||||
//--------------- Write torrent file -------------------------------------------//
|
//--------------- Write torrent file -------------------------------------------//
|
||||||
|
|
||||||
$DB->query("INSERT INTO torrents_files (TorrentID, File) VALUES ($TorrentID, '$TorEnc')");
|
$DB->query("
|
||||||
Misc::write_log("Torrent $TorrentID ($LogName) (".number_format($TotalSize/(1024*1024), 2)." MB) was uploaded by " . $LoggedUser['Username']);
|
INSERT INTO torrents_files (TorrentID, File)
|
||||||
Torrents::write_group_log($GroupID, $TorrentID, $LoggedUser['ID'], "uploaded (".number_format($TotalSize/(1024*1024), 2)." MB)", 0);
|
VALUES ($TorrentID, '$TorEnc')");
|
||||||
|
Misc::write_log("Torrent $TorrentID ($LogName) (".number_format($TotalSize / (1024 * 1024), 2)." MB) was uploaded by " . $LoggedUser['Username']);
|
||||||
|
Torrents::write_group_log($GroupID, $TorrentID, $LoggedUser['ID'], 'uploaded ('.number_format($TotalSize / (1024 * 1024), 2).' MB)', 0);
|
||||||
|
|
||||||
Torrents::update_hash($GroupID);
|
Torrents::update_hash($GroupID);
|
||||||
$Debug->set_flag('upload: sphinx updated');
|
$Debug->set_flag('upload: sphinx updated');
|
||||||
@ -648,15 +682,15 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//******************************************************************************//
|
//******************************************************************************//
|
||||||
//--------------- Add the log scores to the DB ---------------------------------//
|
//--------------- Add the log scores to the DB ---------------------------------//
|
||||||
|
|
||||||
if (!empty($LogScores) && $HasLog) {
|
if (!empty($LogScores) && $HasLog) {
|
||||||
$LogQuery = 'INSERT INTO torrents_logs_new (TorrentID,Log,Details,NotEnglish,Score,Revision,Adjusted,AdjustedBy,AdjustmentReason) VALUES (';
|
$LogQuery = '
|
||||||
|
INSERT INTO torrents_logs_new (TorrentID, Log, Details, NotEnglish, Score, Revision, Adjusted, AdjustedBy, AdjustmentReason)
|
||||||
|
VALUES (';
|
||||||
foreach ($LogScores as $LogKey => $LogScore) {
|
foreach ($LogScores as $LogKey => $LogScore) {
|
||||||
$LogScores[$LogKey] = "$TorrentID,$LogScore,1,0,0,NULL";
|
$LogScores[$LogKey] = "$TorrentID, $LogScore, 1, 0, 0, NULL";
|
||||||
}
|
}
|
||||||
$LogQuery .= implode('),(', $LogScores).')';
|
$LogQuery .= implode('),(', $LogScores).')';
|
||||||
$DB->query($LogQuery);
|
$DB->query($LogQuery);
|
||||||
@ -680,7 +714,7 @@
|
|||||||
if (count($RecentUploads) == 5) {
|
if (count($RecentUploads) == 5) {
|
||||||
array_pop($RecentUploads);
|
array_pop($RecentUploads);
|
||||||
}
|
}
|
||||||
array_unshift($RecentUploads, array('ID'=>$GroupID,'Name'=>trim($Properties['Title']),'Artist'=>Artists::display_artists($ArtistForm, false, true),'WikiImage'=>trim($Properties['Image'])));
|
array_unshift($RecentUploads, array('ID'=>$GroupID, 'Name'=>trim($Properties['Title']), 'Artist'=>Artists::display_artists($ArtistForm, false, true), 'WikiImage'=>trim($Properties['Image'])));
|
||||||
$Cache->cache_value('recent_uploads_'.$UserID, $RecentUploads, 0);
|
$Cache->cache_value('recent_uploads_'.$UserID, $RecentUploads, 0);
|
||||||
} while (0);
|
} while (0);
|
||||||
}
|
}
|
||||||
@ -689,8 +723,9 @@
|
|||||||
//******************************************************************************//
|
//******************************************************************************//
|
||||||
//--------------- Contest ------------------------------------------------------//
|
//--------------- Contest ------------------------------------------------------//
|
||||||
if ($Properties['LibraryImage'] != '') {
|
if ($Properties['LibraryImage'] != '') {
|
||||||
$DB->query("INSERT INTO reportsv2 (ReporterID, TorrentID, Type, UserComment, Status, ReportedTime, Track, Image, ExtraID, Link)
|
$DB->query("
|
||||||
VALUES (0, ".$TorrentID.", 'library', '".db_string(($Properties['MultiDisc'] ? 'Multi-disc' : ''))."', 'New', '".sqltime()."', '', '".db_string($Properties['LibraryImage'])."', '', '')");
|
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'])."', '', '')");
|
||||||
}
|
}
|
||||||
|
|
||||||
//******************************************************************************//
|
//******************************************************************************//
|
||||||
@ -701,14 +736,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if ($PublicTorrent) {
|
if ($PublicTorrent) {
|
||||||
View::show_header("Warning");
|
View::show_header('Warning');
|
||||||
?>
|
?>
|
||||||
<h1>Warning</h1>
|
<h1>Warning</h1>
|
||||||
<p><strong>Your torrent has been uploaded; however, you must download your torrent from <a href="torrents.php?id=<?=$GroupID?>">here</a> because you didn't make your torrent using the "private" option.</strong></p>
|
<p><strong>Your torrent has been uploaded; however, you must download your torrent from <a href="torrents.php?id=<?=$GroupID?>">here</a> because you didn't make your torrent using the "private" option.</strong></p>
|
||||||
<?
|
<?
|
||||||
View::show_footer();
|
View::show_footer();
|
||||||
} elseif ($RequestID) {
|
} elseif ($RequestID) {
|
||||||
header("Location: requests.php?action=takefill&requestid=".$RequestID."&torrentid=".$TorrentID."&auth=".$LoggedUser['AuthKey']);
|
header("Location: requests.php?action=takefill&requestid=$RequestID&torrentid=$TorrentID&auth=".$LoggedUser['AuthKey']);
|
||||||
} else {
|
} else {
|
||||||
header("Location: torrents.php?id=$GroupID");
|
header("Location: torrents.php?id=$GroupID");
|
||||||
}
|
}
|
||||||
@ -728,7 +763,7 @@
|
|||||||
if ($Type == 'Music') {
|
if ($Type == 'Music') {
|
||||||
$Announce .= Artists::display_artists($ArtistForm, false);
|
$Announce .= Artists::display_artists($ArtistForm, false);
|
||||||
}
|
}
|
||||||
$Announce .= trim($Properties['Title'])." ";
|
$Announce .= trim($Properties['Title']).' ';
|
||||||
if ($Type == 'Music') {
|
if ($Type == 'Music') {
|
||||||
$Announce .= '['.trim($Properties['Year']).']';
|
$Announce .= '['.trim($Properties['Year']).']';
|
||||||
if (($Type == 'Music') && ($Properties['ReleaseType'] > 0)) {
|
if (($Type == 'Music') && ($Properties['ReleaseType'] > 0)) {
|
||||||
@ -758,8 +793,8 @@
|
|||||||
$AnnounceSSL = $Announce . " - https://".SSL_SITE_URL."/torrents.php?id=$GroupID / https://".SSL_SITE_URL."/torrents.php?action=download&id=$TorrentID";
|
$AnnounceSSL = $Announce . " - https://".SSL_SITE_URL."/torrents.php?id=$GroupID / https://".SSL_SITE_URL."/torrents.php?action=download&id=$TorrentID";
|
||||||
$Announce .= " - https://".SSL_SITE_URL."/torrents.php?id=$GroupID / https://".SSL_SITE_URL."/torrents.php?action=download&id=$TorrentID";
|
$Announce .= " - https://".SSL_SITE_URL."/torrents.php?id=$GroupID / https://".SSL_SITE_URL."/torrents.php?action=download&id=$TorrentID";
|
||||||
|
|
||||||
$AnnounceSSL .= " - ".trim($Properties['TagList']);
|
$AnnounceSSL .= ' - '.trim($Properties['TagList']);
|
||||||
$Announce .= " - ".trim($Properties['TagList']);
|
$Announce .= ' - '.trim($Properties['TagList']);
|
||||||
|
|
||||||
// ENT_QUOTES is needed to decode single quotes/apostrophes
|
// ENT_QUOTES is needed to decode single quotes/apostrophes
|
||||||
send_irc('PRIVMSG #'.NONSSL_SITE_URL.'-announce :'.html_entity_decode($Announce, ENT_QUOTES));
|
send_irc('PRIVMSG #'.NONSSL_SITE_URL.'-announce :'.html_entity_decode($Announce, ENT_QUOTES));
|
||||||
@ -798,7 +833,8 @@
|
|||||||
|
|
||||||
|
|
||||||
//Notifications
|
//Notifications
|
||||||
$SQL = "SELECT unf.ID, unf.UserID, torrent_pass
|
$SQL = "
|
||||||
|
SELECT unf.ID, unf.UserID, torrent_pass
|
||||||
FROM users_notify_filters AS unf
|
FROM users_notify_filters AS unf
|
||||||
JOIN users_main AS um ON um.ID=unf.UserID
|
JOIN users_main AS um ON um.ID=unf.UserID
|
||||||
WHERE um.Enabled='1'";
|
WHERE um.Enabled='1'";
|
||||||
@ -886,7 +922,8 @@
|
|||||||
$SQL .= "AND ((NewGroupsOnly = '0' ";
|
$SQL .= "AND ((NewGroupsOnly = '0' ";
|
||||||
// Or this is the first torrent in the group to match the formatbitrate filter
|
// Or this is the first torrent in the group to match the formatbitrate filter
|
||||||
$SQL .= ") OR ( NewGroupsOnly = '1' ";
|
$SQL .= ") OR ( NewGroupsOnly = '1' ";
|
||||||
|
// Investigate the following line...
|
||||||
|
$SQL .= ") OR ( NewGroupsOnly = '' ";
|
||||||
// Test the filter doesn't match any previous formatbitrate in the group
|
// Test the filter doesn't match any previous formatbitrate in the group
|
||||||
foreach ($UsedFormatBitrates as $UsedFormatBitrate) {
|
foreach ($UsedFormatBitrates as $UsedFormatBitrate) {
|
||||||
$FormatReq = "(Formats LIKE '%|".db_string($UsedFormatBitrate['format'])."|%' OR Formats = '') ";
|
$FormatReq = "(Formats LIKE '%|".db_string($UsedFormatBitrate['format'])."|%' OR Formats = '') ";
|
||||||
@ -909,6 +946,17 @@
|
|||||||
}
|
}
|
||||||
$SQL.=" AND UserID != '".$LoggedUser['ID']."' ";
|
$SQL.=" AND UserID != '".$LoggedUser['ID']."' ";
|
||||||
|
|
||||||
|
$DB->query("SELECT Paranoia FROM users_main WHERE ID = $LoggedUser[ID]");
|
||||||
|
list($Paranoia) = $DB->next_record();
|
||||||
|
$Paranoia = unserialize($Paranoia);
|
||||||
|
if (!is_array($Paranoia)) {
|
||||||
|
$Paranoia = array();
|
||||||
|
}
|
||||||
|
if(!in_array('notifications', $Paranoia)) {
|
||||||
|
$SQL.=" AND (Users LIKE '%|".$LoggedUser['ID']."|%' OR Users = '') ";
|
||||||
|
}
|
||||||
|
|
||||||
|
$SQL.=" AND UserID != '".$LoggedUser['ID']."' ";
|
||||||
$DB->query($SQL);
|
$DB->query($SQL);
|
||||||
$Debug->set_flag('upload: notification query finished');
|
$Debug->set_flag('upload: notification query finished');
|
||||||
|
|
||||||
@ -916,7 +964,9 @@
|
|||||||
$UserArray = $DB->to_array('UserID');
|
$UserArray = $DB->to_array('UserID');
|
||||||
$FilterArray = $DB->to_array('ID');
|
$FilterArray = $DB->to_array('ID');
|
||||||
|
|
||||||
$InsertSQL = 'INSERT IGNORE INTO users_notify_torrents (UserID, GroupID, TorrentID, FilterID) VALUES ';
|
$InsertSQL = '
|
||||||
|
INSERT IGNORE INTO users_notify_torrents (UserID, GroupID, TorrentID, FilterID)
|
||||||
|
VALUES ';
|
||||||
$Rows = array();
|
$Rows = array();
|
||||||
foreach ($UserArray as $User) {
|
foreach ($UserArray as $User) {
|
||||||
list($FilterID, $UserID, $Passkey) = $User;
|
list($FilterID, $UserID, $Passkey) = $User;
|
||||||
@ -935,7 +985,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// RSS for bookmarks
|
// RSS for bookmarks
|
||||||
$DB->query("SELECT u.ID, u.torrent_pass
|
$DB->query("
|
||||||
|
SELECT u.ID, u.torrent_pass
|
||||||
FROM users_main AS u
|
FROM users_main AS u
|
||||||
JOIN bookmarks_torrents AS b ON b.UserID = u.ID
|
JOIN bookmarks_torrents AS b ON b.UserID = u.ID
|
||||||
WHERE b.GroupID = $GroupID");
|
WHERE b.GroupID = $GroupID");
|
||||||
|
@ -468,6 +468,7 @@ function checked($Checked) {
|
|||||||
list($ArtistsAdded) = $DB->next_record();
|
list($ArtistsAdded) = $DB->next_record();
|
||||||
?>
|
?>
|
||||||
<br /><label><input type="checkbox" name="p_artistsadded" <?=checked(!in_array('artistsadded', $Paranoia))?>/> Number of artists added</label>
|
<br /><label><input type="checkbox" name="p_artistsadded" <?=checked(!in_array('artistsadded', $Paranoia))?>/> Number of artists added</label>
|
||||||
|
<br /><label><input type="checkbox" name="p_notifications" <?=checked(!in_array('notifications', $Paranoia))?>/> Allow users to subscribe to my uploads</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -13,7 +13,22 @@
|
|||||||
</div>
|
</div>
|
||||||
<?
|
<?
|
||||||
$DB->query("
|
$DB->query("
|
||||||
SELECT ID, Label, Artists, ExcludeVA, NewGroupsOnly, Tags, NotTags, ReleaseTypes, Categories, Formats, Encodings, Media, FromYear, ToYear, RecordLabels
|
SELECT
|
||||||
|
ID,
|
||||||
|
Label,
|
||||||
|
Artists,
|
||||||
|
ExcludeVA,
|
||||||
|
NewGroupsOnly,
|
||||||
|
Tags,
|
||||||
|
NotTags,
|
||||||
|
ReleaseTypes,
|
||||||
|
Categories,
|
||||||
|
Formats,
|
||||||
|
Encodings,
|
||||||
|
Media,
|
||||||
|
FromYear,
|
||||||
|
ToYear,
|
||||||
|
Users
|
||||||
FROM users_notify_filters
|
FROM users_notify_filters
|
||||||
WHERE UserID='$LoggedUser[ID]'
|
WHERE UserID='$LoggedUser[ID]'
|
||||||
UNION ALL
|
UNION ALL
|
||||||
@ -23,7 +38,7 @@
|
|||||||
|
|
||||||
$Notifications = $DB->to_array();
|
$Notifications = $DB->to_array();
|
||||||
|
|
||||||
foreach ($Notifications as $N) { //$N stands for Notifications
|
foreach ($Notifications as $N) { // $N stands for Notifications
|
||||||
$N['Artists'] = implode(', ', explode('|', substr($N['Artists'], 1, -1)));
|
$N['Artists'] = implode(', ', explode('|', substr($N['Artists'], 1, -1)));
|
||||||
$N['Tags'] = implode(', ', explode('|', substr($N['Tags'], 1, -1)));
|
$N['Tags'] = implode(', ', explode('|', substr($N['Tags'], 1, -1)));
|
||||||
$N['NotTags'] = implode(', ', explode('|', substr($N['NotTags'], 1, -1)));
|
$N['NotTags'] = implode(', ', explode('|', substr($N['NotTags'], 1, -1)));
|
||||||
@ -32,7 +47,15 @@
|
|||||||
$N['Formats'] = explode('|', substr($N['Formats'], 1, -1));
|
$N['Formats'] = explode('|', substr($N['Formats'], 1, -1));
|
||||||
$N['Encodings'] = explode('|', substr($N['Encodings'], 1, -1));
|
$N['Encodings'] = explode('|', substr($N['Encodings'], 1, -1));
|
||||||
$N['Media'] = explode('|', substr($N['Media'], 1, -1));
|
$N['Media'] = explode('|', substr($N['Media'], 1, -1));
|
||||||
$N['RecordLabels'] = implode(', ', explode('|', substr($N['RecordLabels'], 1, -1)));
|
$N['Users'] = explode('|', substr($N['Users'], 1, -1));
|
||||||
|
|
||||||
|
$Usernames = '';
|
||||||
|
foreach($N['Users'] as $UserID) {
|
||||||
|
$UserInfo = Users::user_info($UserID);
|
||||||
|
$Usernames .= $UserInfo['Username'] . ', ';
|
||||||
|
}
|
||||||
|
$Usernames = rtrim($Usernames, ', ');
|
||||||
|
|
||||||
if ($N['FromYear'] == 0) {
|
if ($N['FromYear'] == 0) {
|
||||||
$N['FromYear'] = '';
|
$N['FromYear'] = '';
|
||||||
}
|
}
|
||||||
@ -79,7 +102,15 @@
|
|||||||
<input type="checkbox" name="excludeva<?=$i?>" id="excludeva_<?=$N['ID']?>"<? if ($N['ExcludeVA'] == '1') { echo ' checked="checked"';} ?> />
|
<input type="checkbox" name="excludeva<?=$i?>" id="excludeva_<?=$N['ID']?>"<? if ($N['ExcludeVA'] == '1') { echo ' checked="checked"';} ?> />
|
||||||
<label for="excludeva_<?=$N['ID']?>">Exclude Various Artists releases</label>
|
<label for="excludeva_<?=$N['ID']?>">Exclude Various Artists releases</label>
|
||||||
</td>
|
</td>
|
||||||
</tr> <tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="label"><strong>One of these users</strong></td>
|
||||||
|
<td>
|
||||||
|
<textarea name="users<?=$i?>" style="width:100%" rows="5"><?=display_str($Usernames)?></textarea>
|
||||||
|
<p class="min_padding">Comma-separated list of usernames</em></p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
<td class="label"><strong>At least one of these tags</strong></td>
|
<td class="label"><strong>At least one of these tags</strong></td>
|
||||||
<td>
|
<td>
|
||||||
<textarea name="tags<?=$i?>" style="width: 100%;" rows="2"><?=display_str($N['Tags'])?></textarea>
|
<textarea name="tags<?=$i?>" style="width: 100%;" rows="2"><?=display_str($N['Tags'])?></textarea>
|
||||||
@ -155,7 +186,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" class="center">
|
<td colspan="2" class="center">
|
||||||
<input type="submit" value="<?=($i>$NumFilters)?'Create filter':'Update filter'?>" />
|
<input type="submit" value="<?=(($i > $NumFilters) ? 'Create filter' : 'Update filter')?>" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
$MediaList = '';
|
$MediaList = '';
|
||||||
$FromYear = 0;
|
$FromYear = 0;
|
||||||
$ToYear = 0;
|
$ToYear = 0;
|
||||||
$RecordLabels = '';
|
$Users = '';
|
||||||
$HasFilter = false;
|
$HasFilter = false;
|
||||||
|
|
||||||
if ($_POST['formid'] && is_number($_POST['formid'])) {
|
if ($_POST['formid'] && is_number($_POST['formid'])) {
|
||||||
@ -119,18 +119,26 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST['record_labels'.$FormID]) {
|
|
||||||
$RLs = explode(',', $_POST['record_labels'.$FormID]);
|
if ($_POST['users'.$FormID]) {
|
||||||
$ParsedRLs = array();
|
$Usernames = explode(',', $_POST['users'.$FormID]);
|
||||||
foreach ($RLs as $RL) {
|
$EscapedUsernames = array();
|
||||||
if (trim($RL) != '') {
|
foreach($Usernames as $Username) {
|
||||||
$ParsedRLs[] = db_string(trim($RL));
|
$EscapedUsernames[] = db_string(trim($Username));;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (count($ParsedRLs) > 0) {
|
$DB->query("
|
||||||
$RecordLabels = '|'.implode('|', $ParsedRLs).'|';
|
SELECT m.ID, m.Paranoia
|
||||||
|
FROM users_main AS m
|
||||||
|
WHERE m.Username IN ('" . implode("', '", $EscapedUsernames) . "')
|
||||||
|
AND m.ID != $LoggedUser[ID]");
|
||||||
|
while (list($UserID, $Paranoia) = $DB->next_record()) {
|
||||||
|
$Paranoia = unserialize($Paranoia);
|
||||||
|
if (!in_array('notifications', $Paranoia)) {
|
||||||
|
$Users .= '|' . $UserID . '|';
|
||||||
$HasFilter = true;
|
$HasFilter = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$HasFilter) {
|
if (!$HasFilter) {
|
||||||
@ -145,9 +153,10 @@
|
|||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
$ArtistList = str_replace('||','|',$ArtistList);
|
$ArtistList = str_replace('||', '|', $ArtistList);
|
||||||
$TagList = str_replace('||','|',$TagList);
|
$TagList = str_replace('||', '|', $TagList);
|
||||||
$NotTagList = str_replace('||','|',$NotTagList);
|
$NotTagList = str_replace('||', '|', $NotTagList);
|
||||||
|
$Users = str_replace('||', '|', $Users);
|
||||||
|
|
||||||
if ($_POST['id'.$FormID] && is_number($_POST['id'.$FormID])) {
|
if ($_POST['id'.$FormID] && is_number($_POST['id'.$FormID])) {
|
||||||
$DB->query("
|
$DB->query("
|
||||||
@ -155,7 +164,7 @@
|
|||||||
SET
|
SET
|
||||||
Artists='$ArtistList',
|
Artists='$ArtistList',
|
||||||
ExcludeVA='$ExcludeVA',
|
ExcludeVA='$ExcludeVA',
|
||||||
NewGroupsOnly='$NewGroupsOnly',
|
NewGroupsOnly='$NewGrsoupsOnly',
|
||||||
Tags='$TagList',
|
Tags='$TagList',
|
||||||
NotTags='$NotTagList',
|
NotTags='$NotTagList',
|
||||||
ReleaseTypes='$ReleaseTypeList',
|
ReleaseTypes='$ReleaseTypeList',
|
||||||
@ -165,15 +174,15 @@
|
|||||||
Media='$MediaList',
|
Media='$MediaList',
|
||||||
FromYear='$FromYear',
|
FromYear='$FromYear',
|
||||||
ToYear='$ToYear',
|
ToYear='$ToYear',
|
||||||
RecordLabels='$RecordLabels'
|
Users ='$Users'
|
||||||
WHERE ID='".$_POST['id'.$FormID]."'
|
WHERE ID='".$_POST['id'.$FormID]."'
|
||||||
AND UserID='$LoggedUser[ID]'");
|
AND UserID='$LoggedUser[ID]'");
|
||||||
} else {
|
} else {
|
||||||
$DB->query("
|
$DB->query("
|
||||||
INSERT INTO users_notify_filters
|
INSERT INTO users_notify_filters
|
||||||
(UserID, Label, Artists, ExcludeVA, NewGroupsOnly, Tags, NotTags, ReleaseTypes, Categories, Formats, Encodings, Media, FromYear, ToYear, RecordLabels)
|
(UserID, Label, Artists, ExcludeVA, NewGroupsOnly, Tags, NotTags, ReleaseTypes, Categories, Formats, Encodings, Media, FromYear, ToYear, Users)
|
||||||
VALUES
|
VALUES
|
||||||
('$LoggedUser[ID]','".db_string($_POST['label'.$FormID])."','$ArtistList','$ExcludeVA','$NewGroupsOnly','$TagList', '$NotTagList', '$ReleaseTypeList','$CategoryList','$FormatList','$EncodingList','$MediaList', '$FromYear', '$ToYear', '$RecordLabels')");
|
('$LoggedUser[ID]','".db_string($_POST['label'.$FormID])."','$ArtistList','$ExcludeVA','$NewGroupsOnly','$TagList', '$NotTagList', '$ReleaseTypeList','$CategoryList','$FormatList','$EncodingList','$MediaList', '$FromYear', '$ToYear', '$Users')");
|
||||||
}
|
}
|
||||||
|
|
||||||
$Cache->delete_value('notify_filters_'.$LoggedUser['ID']);
|
$Cache->delete_value('notify_filters_'.$LoggedUser['ID']);
|
||||||
|
@ -85,7 +85,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$Paranoia = array();
|
$Paranoia = array();
|
||||||
$Checkboxes = array('downloaded', 'uploaded', 'ratio', 'lastseen', 'requiredratio', 'invitedcount', 'artistsadded');
|
$Checkboxes = array('downloaded', 'uploaded', 'ratio', 'lastseen', 'requiredratio', 'invitedcount', 'artistsadded', 'notifications');
|
||||||
foreach ($Checkboxes as $C) {
|
foreach ($Checkboxes as $C) {
|
||||||
if (!isset($_POST['p_'.$C])) {
|
if (!isset($_POST['p_'.$C])) {
|
||||||
$Paranoia[] = $C;
|
$Paranoia[] = $C;
|
||||||
|
@ -523,7 +523,7 @@ ul#userinfo_username {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#content .header h2,
|
#content .header h2,
|
||||||
#content > .thin > h2:first-of-type,
|
#content > .thin > h2:first-child,
|
||||||
#content > .thin > .header:first-of-type > h3:first-of-type {
|
#content > .thin > .header:first-of-type > h3:first-of-type {
|
||||||
background-color: #f0f0f0;
|
background-color: #f0f0f0;
|
||||||
margin: 20px -20px -1px -20px !important;
|
margin: 20px -20px -1px -20px !important;
|
||||||
@ -540,7 +540,7 @@ ul#userinfo_username {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#content .header:first-child h2,
|
#content .header:first-child h2,
|
||||||
#content > .thin > h2:first-of-type,
|
#content > .thin > h2:first-child,
|
||||||
#content > .thin > .header:first-of-type > h3:first-of-type {
|
#content > .thin > .header:first-of-type > h3:first-of-type {
|
||||||
margin-top: -20px !important;
|
margin-top: -20px !important;
|
||||||
}
|
}
|
||||||
@ -759,6 +759,7 @@ table {
|
|||||||
-moz-box-shadow: -4px 1px 8px rgba(187, 215, 235, 0.8);
|
-moz-box-shadow: -4px 1px 8px rgba(187, 215, 235, 0.8);
|
||||||
box-shadow: -4px 1px 8px rgba(187, 215, 235, 0.8);
|
box-shadow: -4px 1px 8px rgba(187, 215, 235, 0.8);
|
||||||
background-color: #F5F5F5;
|
background-color: #F5F5F5;
|
||||||
|
word-break: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
.forum_post .body div {
|
.forum_post .body div {
|
||||||
@ -1627,6 +1628,10 @@ ul.collage_images {
|
|||||||
min-width: 60px;
|
min-width: 60px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#requests .scale_image {
|
||||||
|
max-width: 440px;
|
||||||
|
}
|
||||||
|
|
||||||
#quickreplybuttons {
|
#quickreplybuttons {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user