From 4889f1f7cff70ca36a95722ae39ca477fae396e7 Mon Sep 17 00:00:00 2001 From: Git Date: Thu, 16 May 2013 08:00:10 +0000 Subject: [PATCH] Empty commit --- classes/class_text.php | 22 +-- classes/class_text3.php | 6 +- classes/class_torrent_form.php | 4 +- classes/class_torrents.php | 139 +++++++++++------- classes/script_start.php | 14 +- sections/ajax/send_recommendation.php | 2 +- sections/donate/donate.php | 2 +- sections/rules/upload.php | 26 ++-- sections/schedule/index.php | 76 +++++----- sections/tools/index.php | 60 ++++---- sections/tools/managers/dnu_list.php | 43 +++--- .../managers/{eb.php => email_blacklist.php} | 6 +- ...eb_alter.php => email_blacklist_alter.php} | 11 +- ..._search.php => email_blacklist_search.php} | 32 ++-- sections/tools/tools.php | 2 +- sections/user/takemoderate.php | 4 +- 16 files changed, 250 insertions(+), 199 deletions(-) rename sections/tools/managers/{eb.php => email_blacklist.php} (90%) rename sections/tools/managers/{eb_alter.php => email_blacklist_alter.php} (80%) rename sections/tools/managers/{eb_search.php => email_blacklist_search.php} (53%) diff --git a/classes/class_text.php b/classes/class_text.php index 5d28630c..ae2da922 100644 --- a/classes/class_text.php +++ b/classes/class_text.php @@ -314,7 +314,7 @@ private function parse ($Str) { if (!empty($Tag[3][0])) { $Attrib = substr($Tag[3][0], 1); } else { - $Attrib=''; + $Attrib = ''; } } @@ -359,7 +359,7 @@ private function parse ($Str) { $NewLine = $i; do { // Look for \n[*] $NewLine = strpos($Str, "\n", $NewLine + 1); - } while ($NewLine !== false && substr($Str, $NewLine + 1, 3) == '['.$TagName.']'); + } while ($NewLine !== false && substr($Str, $NewLine + 1, 3) == "[$TagName]"); $CloseTag = $NewLine; if ($CloseTag === false) { // block finishes with list @@ -384,7 +384,7 @@ private function parse ($Str) { // Every time we find an internal open tag of the same type, search for the next close tag // (as the first close tag won't do - it's been opened again) do { - $CloseTag = stripos($Str, '[/'.$TagName.']', $CloseTag + 1); + $CloseTag = stripos($Str, "[/$TagName]", $CloseTag + 1); if ($CloseTag === false) { $CloseTag = $Len; break; @@ -490,7 +490,7 @@ private function parse ($Str) { case '*': $Array[$ArrayPos] = array('Type'=>'list'); $Array[$ArrayPos]['Val'] = explode('['.$TagName.']', $Block); - $Array[$ArrayPos]['ListType'] = $TagName === '*' ? 'ul' : 'ol'; + $Array[$ArrayPos]['ListType'] = ($TagName === '*' ? 'ul' : 'ol'); $Array[$ArrayPos]['Tag'] = $TagName; foreach ($Array[$ArrayPos]['Val'] as $Key=>$Val) { $Array[$ArrayPos]['Val'][$Key] = $this->parse(trim($Val)); @@ -507,7 +507,7 @@ private function parse ($Str) { // Basic tags, like [b] or [size=5] $Array[$ArrayPos] = array('Type'=>$TagName, 'Val'=>$this->parse($Block)); - if (!empty($Attrib) && $MaxAttribs>0) { + if (!empty($Attrib) && $MaxAttribs > 0) { $Array[$ArrayPos]['Attr'] = strtolower($Attrib); } } @@ -574,11 +574,11 @@ private function headline_level (&$ItemLevel, &$Level, &$List, $i, &$Offset) { if ($Offset > 0) $List .= str_repeat('
    1. ', $Offset - 2); if ($ItemLevel > 1) { - $List .= $i === 0 ? '
    2. ' : ''; - $List .= "\n" . '
        ' . "\n"; + $List .= ($i === 0 ? '
      1. ' : ''); + $List .= ("\n
          \n"); } } else { - $List .= $i > 0 ? '' : '
        1. '; + $List .= ($i > 0 ? '
        2. ' : '
        3. '); } } @@ -658,7 +658,7 @@ private function to_html ($Array) { $Str.=''.$Block['Val'].''; break; case 'tex': - $Str.=''.$Block['Val'].''; + $Str.=''.$Block['Val'].''; break; case 'plain': $Str.=$Block['Val']; @@ -682,7 +682,7 @@ private function to_html ($Array) { if (!in_array($Block['Attr'], $ValidAttribs)) { $Str.='[align='.$Block['Attr'].']'.$this->to_html($Block['Val']).'[/align]'; } else { - $Str.='
          '.$this->to_html($Block['Val']).'
          '; + $Str.='
          '.$this->to_html($Block['Val']).'
          '; } break; case 'color': @@ -691,7 +691,7 @@ private function to_html ($Array) { if (!in_array($Block['Attr'], $ValidAttribs) && !preg_match('/^#[0-9a-f]{6}$/', $Block['Attr'])) { $Str.='[color='.$Block['Attr'].']'.$this->to_html($Block['Val']).'[/color]'; } else { - $Str.=''.$this->to_html($Block['Val']).''; + $Str.=''.$this->to_html($Block['Val']).''; } break; case 'headline': diff --git a/classes/class_text3.php b/classes/class_text3.php index bbabbb4b..862718a6 100644 --- a/classes/class_text3.php +++ b/classes/class_text3.php @@ -398,7 +398,7 @@ function parse($Str) { // Basic tags, like [b] or [size=5] $Array[$ArrayPos] = array('Type'=>$TagName, 'Val'=>$this->parse($Block)); - if (!empty($Attrib) && $MaxAttribs>0) { + if (!empty($Attrib) && $MaxAttribs > 0) { $Array[$ArrayPos]['Attr'] = strtolower($Attrib); } } @@ -411,7 +411,9 @@ function parse($Str) { function to_html($Array) { $this->Levels++; - if ($this->Levels>10) { return $Block['Val']; } // Hax prevention + if ($this->Levels > 10) { // Hax prevention + return $Block['Val']; + } $Str = ''; foreach ($Array as $Block) { diff --git a/classes/class_torrent_form.php b/classes/class_torrent_form.php index 16f12688..bb617b54 100644 --- a/classes/class_torrent_form.php +++ b/classes/class_torrent_form.php @@ -378,7 +378,7 @@ function show() { Record label: /> -

          This is for the record label of the release (It may differ from the original).

          +

          This is for the record label of the release. It may differ from the original.

          @@ -396,7 +396,7 @@ function show() { Scene: /> - + diff --git a/classes/class_torrents.php b/classes/class_torrents.php index 711ed402..b888459c 100644 --- a/classes/class_torrents.php +++ b/classes/class_torrents.php @@ -318,7 +318,7 @@ public static function delete_group($GroupID) { // Collages $DB->query("SELECT CollageID FROM collages_torrents WHERE GroupID='$GroupID'"); - if ($DB->record_count()>0) { + if ($DB->record_count() > 0) { $CollageIDs = $DB->collect('CollageID'); $DB->query("UPDATE collages SET NumTorrents=NumTorrents-1 WHERE ID IN (".implode(', ',$CollageIDs).")"); $DB->query("DELETE FROM collages_torrents WHERE GroupID='$GroupID'"); @@ -337,19 +337,23 @@ public static function delete_group($GroupID) { $DB->query("DELETE FROM torrents_artists WHERE GroupID='$GroupID'"); foreach ($Artists as $ArtistID) { - if (empty($ArtistID)) { continue; } + if (empty($ArtistID)) { + continue; + } // Get a count of how many groups or requests use the artist ID - $DB->query("SELECT COUNT(ag.ArtistID) - FROM artists_group as ag - LEFT JOIN requests_artists AS ra ON ag.ArtistID=ra.ArtistID - WHERE ra.ArtistID IS NOT NULL - AND ag.ArtistID = '$ArtistID'"); + $DB->query(" + SELECT COUNT(ag.ArtistID) + FROM artists_group as ag + LEFT JOIN requests_artists AS ra ON ag.ArtistID=ra.ArtistID + WHERE ra.ArtistID IS NOT NULL + AND ag.ArtistID = '$ArtistID'"); list($ReqCount) = $DB->next_record(); - $DB->query("SELECT COUNT(ag.ArtistID) - FROM artists_group as ag - LEFT JOIN torrents_artists AS ta ON ag.ArtistID=ta.ArtistID - WHERE ta.ArtistID IS NOT NULL - AND ag.ArtistID = '$ArtistID'"); + $DB->query(" + SELECT COUNT(ag.ArtistID) + FROM artists_group as ag + LEFT JOIN torrents_artists AS ta ON ag.ArtistID=ta.ArtistID + WHERE ta.ArtistID IS NOT NULL + AND ag.ArtistID = '$ArtistID'"); list($GroupCount) = $DB->next_record(); if (($ReqCount + $GroupCount) == 0) { //The only group to use this artist @@ -388,11 +392,15 @@ public static function delete_group($GroupID) { */ public static function update_hash($GroupID) { global $DB, $Cache; - $DB->query("UPDATE torrents_group SET TagList=(SELECT REPLACE(GROUP_CONCAT(tags.Name SEPARATOR ' '),'.','_') - FROM torrents_tags AS t - INNER JOIN tags ON tags.ID=t.TagID - WHERE t.GroupID='$GroupID' - GROUP BY t.GroupID) + $DB->query(" + UPDATE torrents_group + SET TagList=( + SELECT REPLACE(GROUP_CONCAT(tags.Name SEPARATOR ' '),'.','_') + FROM torrents_tags AS t + INNER JOIN tags ON tags.ID=t.TagID + WHERE t.GroupID='$GroupID' + GROUP BY t.GroupID + ) WHERE ID='$GroupID'"); // Fetch album vote score @@ -404,10 +412,12 @@ public static function update_hash($GroupID) { } // Fetch album artists - $DB->query("SELECT GROUP_CONCAT(aa.Name separator ' ') + $DB->query(" + SELECT GROUP_CONCAT(aa.Name separator ' ') FROM torrents_artists AS ta JOIN artists_alias AS aa ON aa.AliasID=ta.AliasID - WHERE ta.GroupID=$GroupID AND ta.Importance IN ('1', '4', '5', '6') + WHERE ta.GroupID=$GroupID + AND ta.Importance IN ('1', '4', '5', '6') GROUP BY ta.GroupID"); if ($DB->record_count()) { list($ArtistName) = $DB->next_record(MYSQLI_NUM, false); @@ -415,7 +425,8 @@ public static function update_hash($GroupID) { $ArtistName = ''; } - $DB->query("REPLACE INTO sphinx_delta + $DB->query(" + REPLACE INTO sphinx_delta (ID, GroupID, GroupName, TagList, Year, CategoryID, Time, ReleaseType, RecordLabel, CatalogueNumber, VanityHouse, Size, Snatched, Seeders, Leechers, LogScore, Scene, HasLog, HasCue, FreeTorrent, Media, Format, Encoding, RemasterYear, RemasterTitle, @@ -428,21 +439,24 @@ public static function update_hash($GroupID) { RemasterYear, RemasterTitle, RemasterRecordLabel, RemasterCatalogueNumber, REPLACE(FileList, '_', ' ') AS FileList, $VoteScore, '".db_string($ArtistName)."' FROM torrents AS t - JOIN torrents_group AS g ON g.ID=t.GroupID + JOIN torrents_group AS g ON g.ID=t.GroupID WHERE g.ID=$GroupID"); -/* $DB->query("INSERT INTO sphinx_delta - (ID, ArtistName) - SELECT torrents.ID, artists.ArtistName FROM ( +/* $DB->query(" + INSERT INTO sphinx_delta + (ID, ArtistName) + SELECT torrents.ID, artists.ArtistName + FROM ( SELECT - GroupID, - GROUP_CONCAT(aa.Name separator ' ') AS ArtistName + GroupID, + GROUP_CONCAT(aa.Name separator ' ') AS ArtistName FROM torrents_artists AS ta - JOIN artists_alias AS aa ON aa.AliasID=ta.AliasID - WHERE ta.GroupID=$GroupID AND ta.Importance IN ('1', '4', '5', '6') + JOIN artists_alias AS aa ON aa.AliasID=ta.AliasID + WHERE ta.GroupID=$GroupID + AND ta.Importance IN ('1', '4', '5', '6') GROUP BY ta.GroupID ) AS artists - JOIN torrents USING(GroupID) + JOIN torrents USING(GroupID) ON DUPLICATE KEY UPDATE ArtistName=values(ArtistName)"); */ $Cache->delete_value('torrents_details_'.$GroupID); @@ -477,17 +491,20 @@ public static function regenerate_filelist($TorrentID) { list($GroupID, $Contents) = $DB->next_record(MYSQLI_NUM, false); if (Misc::is_new_torrent($Contents)) { $Tor = new BencodeTorrent($Contents); - $FilePath = isset($Tor->Dec['info']['files']) ? Format::make_utf8($Tor->get_name()) : ''; + $FilePath = (isset($Tor->Dec['info']['files']) ? Format::make_utf8($Tor->get_name()) : ''); } else { $Tor = new TORRENT(unserialize(base64_decode($Contents)), true); - $FilePath = isset($Tor->Val['info']->Val['files']) ? Format::make_utf8($Tor->get_name()) : ''; + $FilePath = (isset($Tor->Val['info']->Val['files']) ? Format::make_utf8($Tor->get_name()) : ''); } list($TotalSize, $FileList) = $Tor->file_list(); foreach ($FileList as $File) { $TmpFileList[] = self::filelist_format_file($File); } $FileString = implode("\n", $TmpFileList); - $DB->query("UPDATE torrents SET Size = ".$TotalSize.", FilePath = '".db_string($FilePath)."', FileList = '".db_string($FileString)."' WHERE ID = ".$TorrentID); + $DB->query(" + UPDATE torrents + SET Size = $TotalSize, FilePath = '".db_string($FilePath)."', FileList = '".db_string($FileString)."' + WHERE ID = $TorrentID"); $Cache->delete_value('torrents_details_'.$GroupID); } } @@ -511,10 +528,10 @@ public static function filelist_delim() { */ public static function filelist_format_file($File) { list($Size, $Name) = $File; - $Name = Format::make_utf8(strtr($Name, "\n\r\t", " ")); + $Name = Format::make_utf8(strtr($Name, "\n\r\t", ' ')); $ExtPos = strrpos($Name, '.'); // Should not be $ExtPos !== false. Extensionless files that start with a . should not get extensions - $Ext = $ExtPos ? trim(substr($Name, $ExtPos+1)) : ''; + $Ext = ($ExtPos ? trim(substr($Name, $ExtPos + 1)) : ''); return sprintf("%s s%ds %s %s", ".$Ext", $Size, $Name, self::filelist_delim()); } @@ -555,28 +572,28 @@ public static function filelist_get_file($File) { */ public static function torrent_info($Data, $ShowMedia = false, $ShowEdition = false) { $Info = array(); - if (!empty($Data['Format'])) { $Info[]=$Data['Format']; } - if (!empty($Data['Encoding'])) { $Info[]=$Data['Encoding']; } + if (!empty($Data['Format'])) { $Info[] = $Data['Format']; } + if (!empty($Data['Encoding'])) { $Info[] = $Data['Encoding']; } if (!empty($Data['HasLog'])) { $Str = 'Log'; if (!empty($Data['LogScore'])) { $Str.=' ('.$Data['LogScore'].'%)'; } - $Info[]=$Str; + $Info[] = $Str; } - if (!empty($Data['HasCue'])) { $Info[]='Cue'; } - if ($ShowMedia && !empty($Data['Media'])) { $Info[]=$Data['Media']; } - if (!empty($Data['Scene'])) { $Info[]='Scene'; } + if (!empty($Data['HasCue'])) { $Info[] = 'Cue'; } + if ($ShowMedia && !empty($Data['Media'])) { $Info[] = $Data['Media']; } + if (!empty($Data['Scene'])) { $Info[] = 'Scene'; } if ($ShowEdition) { $EditionInfo = array(); - if (!empty($Data['RemasterYear'])) { $EditionInfo[]=$Data['RemasterYear']; } - if (!empty($Data['RemasterTitle'])) { $EditionInfo[]=$Data['RemasterTitle']; } - if (count($EditionInfo)) { $Info[]=implode(' ',$EditionInfo); } + if (!empty($Data['RemasterYear'])) { $EditionInfo[] = $Data['RemasterYear']; } + if (!empty($Data['RemasterTitle'])) { $EditionInfo[] = $Data['RemasterTitle']; } + if (count($EditionInfo)) { $Info[] = implode(' ',$EditionInfo); } } - if ($Data['IsSnatched']) { $Info[]= Format::torrent_label('Snatched!'); } - if ($Data['FreeTorrent'] == '1') { $Info[]= Format::torrent_label('Freeleech!'); } - if ($Data['FreeTorrent'] == '2') { $Info[]= Format::torrent_label('Neutral Leech!'); } - if ($Data['PersonalFL']) { $Info[]= Format::torrent_label('Personal Freeleech!'); } + if ($Data['IsSnatched']) { $Info[] = Format::torrent_label('Snatched!'); } + if ($Data['FreeTorrent'] == '1') { $Info[] = Format::torrent_label('Freeleech!'); } + if ($Data['FreeTorrent'] == '2') { $Info[] = Format::torrent_label('Neutral Leech!'); } + if ($Data['PersonalFL']) { $Info[] = Format::torrent_label('Personal Freeleech!'); } return implode(' / ', $Info); } @@ -595,10 +612,15 @@ public static function freeleech_torrents($TorrentIDs, $FreeNeutral = 1, $FreeLe $TorrentIDs = array($TorrentIDs); } - $DB->query("UPDATE torrents SET FreeTorrent = '".$FreeNeutral."', FreeLeechType = '".$FreeLeechType - ."' WHERE ID IN (".implode(", ", $TorrentIDs).")"); + $DB->query(" + UPDATE torrents + SET FreeTorrent = '$FreeNeutral', FreeLeechType = '$FreeLeechType' + WHERE ID IN (".implode(', ', $TorrentIDs).')'); - $DB->query("SELECT ID, GroupID, info_hash FROM torrents WHERE ID IN (".implode(", ", $TorrentIDs).") ORDER BY GroupID ASC"); + $DB->query(' + SELECT ID, GroupID, info_hash + FROM torrents + WHERE ID IN ('.implode(', ', $TorrentIDs).') ORDER BY GroupID ASC'); $Torrents = $DB->to_array(false, MYSQLI_NUM, false); $GroupIDs = $DB->collect('GroupID'); @@ -606,8 +628,8 @@ public static function freeleech_torrents($TorrentIDs, $FreeNeutral = 1, $FreeLe list($TorrentID, $GroupID, $InfoHash) = $Torrent; Tracker::update_tracker('update_torrent', array('info_hash' => rawurlencode($InfoHash), 'freetorrent' => $FreeNeutral)); $Cache->delete_value('torrent_download_'.$TorrentID); - Misc::write_log($LoggedUser['Username']." marked torrent ".$TorrentID." freeleech type ".$FreeLeechType."!"); - Torrents::write_group_log($GroupID, $TorrentID, $LoggedUser['ID'], "marked as freeleech type ".$FreeLeechType."!", 0); + Misc::write_log($LoggedUser['Username']." marked torrent $TorrentID freeleech type $FreeLeechType!"); + Torrents::write_group_log($GroupID, $TorrentID, $LoggedUser['ID'], "marked as freeleech type $FreeLeechType!", 0); } foreach ($GroupIDs as $GroupID) { @@ -630,7 +652,10 @@ public static function freeleech_groups($GroupIDs, $FreeNeutral = 1, $FreeLeechT $GroupIDs = array($GroupIDs); } - $DB->query("SELECT ID from torrents WHERE GroupID IN (".implode(", ", $GroupIDs).")"); + $DB->query(' + SELECT ID + FROM torrents + WHERE GroupID IN ('.implode(', ', $GroupIDs).')'); if ($DB->record_count()) { $TorrentIDs = $DB->collect('ID'); Torrents::freeleech_torrents($TorrentIDs, $FreeNeutral, $FreeLeechType); @@ -655,7 +680,11 @@ public static function has_token($TorrentID) { if (!isset($TokenTorrents)) { $TokenTorrents = $Cache->get_value('users_tokens_'.$UserID); if ($TokenTorrents === false) { - $DB->query("SELECT TorrentID FROM users_freeleeches WHERE UserID=$UserID AND Expired=0"); + $DB->query(" + SELECT TorrentID + FROM users_freeleeches + WHERE UserID=$UserID + AND Expired=0"); $TokenTorrents = array_fill_keys($DB->collect('TorrentID', false), true); $Cache->cache_value('users_tokens_'.$UserID, $TokenTorrents); } @@ -781,7 +810,7 @@ public static function edition_string(array $Torrent, array $Group) { $AddExtra = ' / '; } } else { - $EditionName = "Unknown Release(s)"; + $EditionName = 'Unknown Release(s)'; } $EditionName .= $AddExtra . display_str($Torrent['Media']); } diff --git a/classes/script_start.php b/classes/script_start.php index 0da14b09..76dbf34e 100644 --- a/classes/script_start.php +++ b/classes/script_start.php @@ -366,7 +366,7 @@ } //A9 TODO: Clean up this messy solution - $LoggedUser['StyleName']=$Stylesheets[$LoggedUser['StyleID']]['Name']; + $LoggedUser['StyleName'] = $Stylesheets[$LoggedUser['StyleID']]['Name']; if (empty($LoggedUser['Username'])) { logout(); // Ghost @@ -384,9 +384,9 @@ */ function logout() { global $SessionID, $LoggedUser, $DB, $Cache; - setcookie('session','',time()-60*60*24*365,'/','',false); - setcookie('keeplogged','',time()-60*60*24*365,'/','',false); - setcookie('session','',time()-60*60*24*365,'/','',false); + setcookie('session', '', time() - 60 * 60 * 24 * 365, '/', '', false); + setcookie('keeplogged', '', time() - 60 * 60 * 24 * 365, '/', '', false); + setcookie('session', '', time() - 60 * 60 * 24 * 365, '/', '', false); if ($SessionID) { @@ -408,7 +408,7 @@ function logout() { function enforce_login() { global $SessionID, $LoggedUser; if (!$SessionID || !$LoggedUser) { - setcookie('redirect',$_SERVER['REQUEST_URI'],time()+60*30,'/','',false); + setcookie('redirect', $_SERVER['REQUEST_URI'], time() + 60 * 30, '/', '', false); logout(); } } @@ -435,7 +435,9 @@ function authorize($Ajax = false) { $Debug->set_flag('ending function definitions'); //Include /sections/*/index.php $Document = basename(parse_url($_SERVER['SCRIPT_FILENAME'], PHP_URL_PATH), '.php'); -if (!preg_match('/^[a-z0-9]+$/i', $Document)) { error(404); } +if (!preg_match('/^[a-z0-9]+$/i', $Document)) { + error(404); +} require(SERVER_ROOT.'/sections/'.$Document.'/index.php'); $Debug->set_flag('completed module execution'); diff --git a/sections/ajax/send_recommendation.php b/sections/ajax/send_recommendation.php index 2ad3d609..7687db14 100644 --- a/sections/ajax/send_recommendation.php +++ b/sections/ajax/send_recommendation.php @@ -29,7 +29,7 @@ $Type = strtolower($Type); $Link = ''; // "a" vs "an", english language is so confusing. -// http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an +// https://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an $Article = 'a'; switch ($Type) { case 'torrent': diff --git a/sections/donate/donate.php b/sections/donate/donate.php index 4271060c..9a3ef076 100644 --- a/sections/donate/donate.php +++ b/sections/donate/donate.php @@ -70,7 +70,7 @@ -

          What you will receive for a 5€ or 0.5 BTC minimum donation

          +

          What you will receive for a 5€ or 0.1 BTC minimum donation

          • ↑_ 2.1.7. Use only the allowed container formats for audio files. Use .m4a and .mp4 for AAC, and .flac for FLAC only. All other formats should not be encapsulated in random containers (e.g., FLAC must not be in an Ogg container, MP3 must not be in an .m4a container, and so forth). Exceptions: DTS CD-sourced audio rips, although contained in WAV, should have the .dts extension (see 2.7).
          • ↑_ 2.1.8. Music not sourced from vinyl must not contain pops, clicks, or skips. They will be deleted for rip/encode errors if reported. Music sourced from vinyl must follow the rules found here.
          • -
          • ↑_ 2.1.9. Freely available music is allowed. Uploaded music may be freely available on the web (come from official sources such as record labels, band web sites, or the Internet Archive). Uploads can come from other torrent sites, but you are responsible for determining the audio quality of the music (e.g., that it is not transcoded, that it does not contain an edited log, that it is not a user compilation, etc.). Users are highly encouraged to provide a link to the source of their upload when uploading freely available music. However, this is not required and the lack of such a link to further information is not grounds for reporting a torrent. All freely available music must conform to both quality rules and formatting rules. This means it must be tagged correctly, not be a transcode, have separate tracks, and so forth. Freely available music uploads should have the "WEB" media format if no other source media (e.g., CD, DVD, etc.) can be established for the files.
          • +
          • ↑_ 2.1.9. Freely available music is allowed. Uploaded music may be freely available on the web (come from official sources such as record labels, band web sites, or the Internet Archive). Uploads can come from other torrent sites, but you are responsible for determining the audio quality of the music (e.g., that it is not transcoded, that it does not contain an edited log, that it is not a user compilation, etc.). Users are highly encouraged to provide a link to the source of their upload when uploading freely available music. However, this is not required and the lack of such a link to further information is not grounds for reporting a torrent. All freely available music must conform to both quality rules and formatting rules. This means it must be tagged correctly, not be a transcode, have separate tracks, and so forth. Freely available music uploads should have the "WEB" media format if no other source media (e.g., CD, DVD, etc.) can be established for the files.
          • ↑_ 2.1.10. Clearly label water-marked or voice-over releases. Watermarks or voice-overs must be clearly indicated in the torrent description. The torrent will be deleted for quality misrepresentation if this information is not noted.
          • ↑_ 2.1.11. Music ripped from the radio (Satellite or FM), television, the web, or podcasts are not allowed. See this wiki for the difference between web rips and the WEB category.
          • ↑_ 2.1.12. No unofficial audience recordings may be uploaded. These include but are not limited to AUD (Audience), IEM (In Ear Monitor), ALD (Assistive Listening Device), Mini-Disc, and Matrix-sourced recordings (see 2.6.3).
          • @@ -245,7 +245,7 @@
          • ↑_ 2.2.1. Upload an allowed format if it doesn't already exist on the site. If there is no existing torrent of the album in the format you've chosen, you can upload it in any bitrate that averages at least 192 kbps.
          • ↑_ 2.2.2. Torrents that have the same bitrates, formats, and comparable or identical sampling rates for the same music release are duplicates. If a torrent is already present on the site in the format and bitrate you wanted to upload, you are not allowed to upload it - it's a duplicate (dupe). So if there's a 192 kbps CBR MP3 torrent on the site, you are not allowed to upload another 192 kbps CBR MP3 torrent for the same release. Similarly, if a torrent is already present on the site in the format and at the sampling rate you wanted to upload, you are not allowed to upload it - it's a duplicate (dupe). So if there's a 48 kHz WEB FLAC torrent on the site, you are not allowed to upload a 44.1 kHz WEB FLAC torrent for the same release. You cannot trump an existing torrent with another version solely because the new version includes album art. Exceptions: Different editions and source media do not count as dupes. See 2.2.11 for more information.
          • -
          • ↑_ 2.2.3. Report all trumped and duplicated torrents. If you trump a torrent or notice a duplicate torrent, please use the report link (RP) to notify staff for removal of the old or duplicate torrent. This process is particularly vital for lossless rips. If you are uploading a superior rip to the current one in the same format on the site, report the older torrent and include a link to your new torrent in the report. Your torrent will be deleted as a dupe if the older torrent is not reported. Note: Trump - This occurs when a new torrent is uploaded in a preferred bitrate or quality (as specified by the lossy-, lossless, and edition-specific rules below) and replaces the older version that exists on the site. Dupe - This occurs when a new torrent is uploaded in a bitrate or quality that is equal to the existing older version on the site. Because the two torrents cannot coexist, the most recent upload is considered a duplicate.
          • +
          • ↑_ 2.2.3. Report all trumped and duplicated torrents. If you trump a torrent or notice a duplicate torrent, please use the report link (RP) to notify staff for removal of the old or duplicate torrent. This process is particularly vital for lossless rips. If you are uploading a superior rip to the current one in the same format on the site, report the older torrent and include a link to your new torrent in the report. Your torrent will be deleted as a dupe if the older torrent is not reported. Note: Trump - This occurs when a new torrent is uploaded in a preferred bitrate or quality (as specified by the lossy-, lossless-, and edition-specific rules below) and replaces the older version that exists on the site. Dupe - This occurs when a new torrent is uploaded in a bitrate or quality that is equal to the existing older version on the site. Because the two torrents cannot coexist, the most recent upload is considered a duplicate.
          • ↑_ 2.2.4. Dupe rules also apply to previous uploads. All of the dupe rules below concerning music formats may apply to torrents uploaded at an earlier time. For example, if you upload an album in 192 kbps MP3, someone can upload the same album in 320 kbps at a later date and trump your 192 kbps MP3.
          • ↑_ 2.2.5. Scene and non-scene torrents for the same release, in the same bitrate and format, are dupes. The Scene label does not make the torrents unique from one another. If a scene V2 (VBR) of an album from CD is already uploaded, you may not upload another V2 (VBR) of the same album from CD.
          • ↑_ 2.2.6. All vinyl torrents must be ripped at the correct speed. You must rip all vinyl albums at the speed with which they were intended to be played (see 2.5.7).
          • @@ -253,7 +253,7 @@
          • ↑_ 2.2.8. Torrents that have been inactive (e.g., not seeded) for two weeks may be trumped by the identical torrent (e.g., reseeded) or by a brand new rip or encode (see this wiki for the torrent inactivity rules) of the album. If you have the original torrent files for the inactive torrent, it is preferable to reseed those original files instead of uploading a new torrent. Uploading a replacement torrent should be done only when the files from the original torrent cannot be recovered or are unavailable.
          • ↑_ 2.2.9. Lossy rules
              -
            • ↑_ 2.2.9.1. Higher bitrate CBR (Constant Bitrate) and ABR (Average Bitrate) torrents replace lower ones. Once a CBR (Constant Bitrate) rip has been uploaded, no CBR rips of that bitrate or lower can be uploaded. In the same manner, once an ABR (Average Bitrate) rip has been uploaded, no ABR rips of that bitrate or lower can be uploaded. For example, if a 320 kbps CBR rip is already on the site, you are not allowed to upload a 256 kbps CBR. ABR and CBR may be interchangeably trumped. A CBR can trump a lower bitrate ABR and an ABR may trump a lower bitrate CBR. You may not upload a 192 kbps CBR if a 256 kbps ABR of the same release is already up. See this wiki for more information.
            • +
            • ↑_ 2.2.9.1. Higher bitrate CBR (constant bitrate) and ABR (average bitrate) torrents replace lower ones. Once a CBR (constant bitrate) rip has been uploaded, no CBR rips of that bitrate or lower can be uploaded. In the same manner, once an ABR (average bitrate) rip has been uploaded, no ABR rips of that bitrate or lower can be uploaded. For example, if a 320 kbps CBR rip is already on the site, you are not allowed to upload a 256 kbps CBR. ABR and CBR may be interchangeably trumped. A CBR can trump a lower bitrate ABR and an ABR may trump a lower bitrate CBR. You may not upload a 192 kbps CBR if a 256 kbps ABR of the same release is already up. For more information, see the Wikipedia articles on average bitrate, constant bitrate, and variable bitrate.
            • ↑_ 2.2.9.2. Lossy format torrents with .log files do not replace equivalent existing torrents. If you want to upload a lossy format (e.g., MP3) torrent that contains a log, when that format already exists in the same medium and album edition (but without the log), your new torrent will be considered a dupe. For example, a V2 (VBR) MP3 torrent with a log cannot replace a V2 (VBR) MP3 without a log. The same standard applies for lossy audio torrents with .m3u, .cue, and other additions such as artwork. Exceptions: If an existing torrent contains encode/rip errors, you may upload another copy that does not have errors. The bad torrent needs to be reported (with clear information about which tracks and what time points are affected) or your torrent will be deleted as a dupe. Also, see 2.3.8 through 2.3.16 for replacing poorly named and tagged torrents.
            • ↑_ 2.2.9.3. V0 (VBR), V2 (VBR), and 320 CBR MP3 are allowed at any time. You may upload a V0 (VBR), V2 (VBR) or 320 CBR MP3 as long as another rip with the same bitrate and format doesn't already exist. So if a V0 (VBR) is on the site, you may still upload a V2 (VBR) or 320 CBR MP3 of the same release.
            • ↑_ 2.2.9.4. V2 (VBR) replaces APS (VBR), and both replace CBR rips under 256 kbps, 192 (ABR), and rips averaging 192 (VBR) to 210 (VBR). Once a rip with either the V2 (VBR) or APS (VBR) LAME encoding preset has been uploaded, you are not allowed to upload any CBR torrents under 256 kbps bitrate. Furthermore, a V2 (VBR) or APS (VBR) rip will trump all indiscriminate VBR rips of similar bitrate. A V2 (VBR) rip will replace a 192 (VBR) rip or 210 (VBR) rip, for example. Also, a V2 (VBR) will replace a 192 (ABR) torrent.
            • @@ -276,24 +276,24 @@
            • ↑_ 2.2.10.1.2. Exceptions: If the release is only distributed on CD-R by the label or artist, then that is acceptable. See this wiki for more information on CD-R releases.
          • -
          • ↑_ 2.2.10.2. A FLAC torrent without a log (or with a log from a non-EAC or non-XLD ripping tool like dBpoweramp or Rubyripper) may be trumped by a FLAC torrent with a log from an approved ripping tool that scores either 100% or <100% because of non-audio deductions. For example, an EAC log that scores 50% (because of CRC mismatches or other audio deductions) cannot trump a Rubyripper log. See this wiki for more information on approved ripping tools. Also, see this wiki for setting up EAC and this wiki for ripping with EAC. See this wiki for ripping with XLD. Please make sure the log file has the .log extension so that it can display properly on the torrent page.
          • -
          • ↑_ 2.2.10.3. A FLAC upload with an EAC or XLD rip log that scores 100% on the log checker replaces one with a lower score. No log scoring less than 100% can trump an already existing one that scores under 100%. For example, a FLAC+log rip that scores 50% in the log checker cannot be trumped by a FLAC+log rip that scores 80%. What.CD recommends this guide for EAC, and this guide for XLD. See this wiki for more information on the site log checker. Note: A FLAC upload with a log that scores 95% for not defeating the audio cache may be rescored to 100% following the procedure outlined in this wiki.
          • +
          • ↑_ 2.2.10.2. A FLAC torrent without a log (or with a log from a non-EAC or non-XLD ripping tool like dBpoweramp or Rubyripper) may be trumped by a FLAC torrent with a log from an approved ripping tool that scores either 100% or <100% because of non-audio deductions. For example, an EAC log that scores 50% (because of CRC mismatches or other audio deductions) cannot trump a Rubyripper log. See this wiki for more information on approved ripping tools. Also, see this wiki for setting up EAC and this wiki for ripping with EAC. See this wiki for ripping with XLD. Please make sure the log file has the ".log" extension so that it can display properly on the torrent page.
          • +
          • ↑_ 2.2.10.3. A FLAC upload with an EAC or XLD rip log that scores 100% on the log checker replaces one with a lower score. No log scoring less than 100% can trump an already existing one that scores under 100%. For example, a FLAC+log rip that scores 50% in the log checker cannot be trumped by a FLAC+log rip that scores 80%. What.CD recommends this guide for EAC, and this guide for XLD. See this wiki for more information on the site log checker. Note: A FLAC upload with a log that scores 95% for not defeating the audio cache may be rescored to 100% following the procedure outlined in this wiki.
          • ↑_ 2.2.10.4. A FLAC upload with only non-audio deductions in the log (see this wiki) may replace a FLAC upload with a log that scores 0% or contains audio deductions. For example, a range rip that has AccurateRip scores of two or higher and assorted non-audio deductions (e.g., burst mode, audio cache, pre-gaps, C2 pointers, etc.) can trump a log that has audio deductions for mismatching CRCs.
          • -
          • ↑_ 2.2.10.5. XLD and EAC logs in languages other than English require a manual log checker score adjustment by staff. The current log checker cannot parse non-English logs made by EAC and XLD. However, a special exception is made for foreign-language logs since the rip quality is equivalent to English logs. Please report your torrent with the RP link and select "Log Rescore Request" for the reason of the report so staff can check your torrent manually. Do not translate the log yourself (see 2.2.10.9).
          • +
          • ↑_ 2.2.10.5. XLD and EAC logs in languages other than English require a manual log checker score adjustment by staff. The current log checker cannot parse non-English logs made by EAC and XLD. However, a special exception is made for foreign-language logs since the rip quality is equivalent to English logs. Please report your torrent with the "RP" button and select "Log Rescore Request" for the reason of the report so staff can score your torrent manually. Do not translate the log yourself (see 2.2.10.9).
          • ↑_ 2.2.10.6. Range rips of hidden tracks or regular range rips (acceptable under strict conditions) require manual score adjustment.
            • ↑_ 2.2.10.6.1. The new log checker cannot accurately score range-ripped hidden tracks appended to proper rip logs. If you have created a 100% rip with a hidden track, but the log checker has decreased your score for the hidden track, report the torrent and the log score will be corrected by staff.
            • ↑_ 2.2.10.6.2. If you created a CD range rip that has matching CRCs for test and copy, and where every track has an AccurateRip score of 2 or more, then you may submit your torrent for manual score adjustment. It will be rescored, assuming no other problems, to 99%.
            • -
            • ↑_ 2.2.10.6.3. The CD image rip must be split with CUETools, XLD, or EAC. No other splitter is acceptable for a score adjustment. You will not receive a score adjustment for copy-only range rips approved with AccurateRip, nor for range rips done with test and copy without AccurateRip enabled. See this wiki for information on splitting image rips with EAC.
            • +
            • ↑_ 2.2.10.6.3. The CD image rip must be split with CUETools, XLD, or EAC. No other splitter is acceptable for a score adjustment. You will not receive a score adjustment for copy-only range rips approved with AccurateRip, nor for range rips done with test and copy without AccurateRip enabled. See this wiki for information on splitting image rips with EAC.
          • ↑_ 2.2.10.7. A 100% log rip lacking a cue sheet can be replaced by another 100% log rip with a noncompliant cue sheet. See this wiki for more information on cue sheets.
            • ↑_ 2.2.10.7.1. A 100% log rip without a cue sheet can be replaced by a 100% log rip with a noncompliant cue sheet ONLY when the included cue sheet is materially different from "a cue generated from the ripping log." Examples of a material difference include additional or correct indices, properly detected pre-gap lengths, and pre-emphasis flags. If you upload a torrent with a cue sheet that provides nothing additional beyond what is contained in the rip log of the preexisting torrent, it will be deleted as a dupe.
            • -
            • ↑_ 2.2.10.7.2. Exceptions: An EAC 0.95 rip with a 100% log and no cue file, uploaded before September 14, 2010, may be trumped by a torrent that scores 100% under the current log checker requirements.
            • +
            • ↑_ 2.2.10.7.2. Exceptions: An EAC 0.95 rip with a 100% log and no cue file, uploaded before September 14, 2010, may be trumped by a torrent that scores 100% under the current log checker requirements.
          • -
          • ↑_ 2.2.10.8. FLAC rips that contain ID3 tags or other non-compliant tags for FLAC may be trumped by rips with identical scores that have the faulty tags removed and replaced with the standard for each format. Enabling ID3 tags in EAC when ripping to FLAC may prevent some players from playing the files because of the inclusion of ID3 headers. If you wish to trump a FLAC rip that was ripped with ID3 tags enabled, upload the corrected torrent with the proper Vorbis comments and report the old torrent. Add information about your clean-up in the Release description, or your torrent may be deleted as a dupe. Do not edit the log and change the ID3 tag setting to "No." Note: A simple way of getting rid of the ID3 header is to decompress the files to WAV. Then compress the files to FLAC and again add the proper Vorbis comments.
          • +
          • ↑_ 2.2.10.8. FLAC rips that contain ID3 tags or other non-compliant tags for FLAC may be trumped by rips with identical scores that have the faulty tags removed and replaced with the standard for each format. Enabling ID3 tags in EAC when ripping to FLAC may prevent some players from playing the files because of the inclusion of ID3 headers. If you wish to trump a FLAC rip that was ripped with ID3 tags enabled, upload the corrected torrent with the proper Vorbis comments and report the old torrent. Add information about your tag clean-up in the "Release description", or your torrent may be deleted as a dupe. Do not edit the log and change the ID3 tag setting to "No." Note: A simple way of getting rid of the ID3 header is to decompress the files to WAV, then compressing the files to FLAC, and adding the proper Vorbis comments.
          • ↑_ 2.2.10.9. No log editing is permitted.
            • ↑_ 2.2.10.9.1. Forging log data is a serious misrepresentation of quality, and will result in a warning and the loss of your uploading privileges when the edited log is found. We recommend that you do not open the rip log file for any reason. However, if you must open the rip log, do not edit anything in the file for any reason. If you discover that one of your software settings is incorrect in the ripping software preferences, you must rip the CD again with the proper settings. Do not consolidate logs under any circumstances. If you must re-rip specific tracks or an entire disc and the rip results happen to have the new log appended to the original, leave them as is. Do not remove any part of either log, and never copy/paste parts of a new log over an old log.
            • @@ -364,8 +364,8 @@ Note: The "Year" tag is optional, but strongly encouraged. However, if missing or incorrect, this is not grounds for trumping a torrent.
            • ↑_ 2.3.17. The torrent artist for classical works should use the full composer name. Before uploading see this wiki for guidelines on uploading classical music torrents. Also, consult this wiki for a full explanation of the classical music tagging system.
            • -
            • ↑_ 2.3.18. Newly re-tagged torrents trumping badly tagged torrents must reflect a substantial improvement over the previous tags. Small changes that include replacing ASCII characters with proper foreign language characters with diacritical marks, fixing slight misspellings, or missing an alternate spelling of an artist (e.g., excluding "The" before a band name) are insufficient grounds for replacing other torrents. Artist names that are misspelled in the tags are grounds for trumping; this includes character accents and characters that mean one letter in one language and a different letter in another language. Improper capitalization in the tags is grounds for trumping; this includes artist tags (or composer tags) that contain names that are all capitalized or track titles that are all capitalized. Tags with multiple entries in the same tag (e.g., track number and track title in the track title tags; or track number, artist, and track title in the artist tags) are subject to trumping. You may trump a release if the tags do not follow the data from a reputable music cataloguing service such as MusicBrainz or Discogs. In the case of a conflict between reputable listings, either tagged version is equally preferred on the site and cannot trump the other. For example, an album is tagged differently in MusicBrainz and in Discogs. Either style of tagging is permitted; neither is "better" than the other. In that case, any newly tagged torrents replacing an already properly tagged torrent, which follows good tagging convention, will result in a dupe. Note: For classical music, please follow these tagging guidelines.
            • -
            • ↑_ 2.3.19. Avoid embedding large images if including cover art in the meta tags. Do not embed large images (in excess of 512 KB) in the file meta tags. It adds unnecessary bloat to the files. Include the artwork in a separate directory if it is too big or if it consists of high-resolution images. Should you include an image of over 512 KB as embedded artwork, your torrent will be trumpable.
            • +
            • ↑_ 2.3.18. Newly re-tagged torrents trumping badly tagged torrents must reflect a substantial improvement over the previous tags. Small changes that include replacing ASCII characters with proper foreign language characters with diacritical marks, fixing slight misspellings, or missing an alternate spelling of an artist (e.g., excluding "The" before a band name) are insufficient grounds for replacing other torrents. Artist names that are misspelled in the tags are grounds for trumping; this includes character accents and characters that mean one letter in one language and a different letter in another language. Improper capitalization in the tags is grounds for trumping; this includes artist tags (or composer tags) that contain names that are all capitalized or track titles that are all capitalized. Tags with multiple entries in the same tag (e.g., track number and track title in the track title tags; or track number, artist, and track title in the artist tags) are subject to trumping. You may trump a release if the tags do not follow the data from a reputable music cataloguing service such as MusicBrainz or Discogs. In the case of a conflict between reputable listings, either tagged version is equally preferred on the site and cannot trump the other. For example, an album is tagged differently in MusicBrainz and in Discogs. Either style of tagging is permitted; neither is "better" than the other. In that case, any newly tagged torrents replacing an already properly tagged torrent, which follows good tagging convention, will result in a dupe. Note: For classical music, please follow these tagging guidelines.
            • +
            • ↑_ 2.3.19. Avoid embedding large images if including cover art in the meta tags. Do not embed large images (in excess of 512 kB) in the file meta tags. It adds unnecessary bloat to the files. Include the artwork in a separate directory if it is too big or if it consists of high-resolution images. Should you include an image of over 512 kB as embedded artwork, your torrent will be trumpable.
            • ↑_ 2.3.20. Leading spaces are not allowed in any file or folder names. Leading spaces cause usability and interoperability problems among various operating systems and programs. Torrents with file or folder names that contain leading space characters are trumpable.
          @@ -484,7 +484,7 @@
        4. ↑_ 2.8.2. Analog SACD rips may have a sampling rate equal to 88.2 or 96 kHz and may be trumped at any time by a digital 24/88.2 SACD rip. If a digital SACD rip has frequencies higher than 44.1 kHz, contact a moderator privately for approval to upload a 24-bit rip with a sampling rate greater than 88.2 kHz.
        5. ↑_ 2.8.3. SACD hybrid rip sources must be properly labeled.
            -
          • ↑_ 2.8.3.1. SACD hybrid discs ripped from the CD layer should be labeled as CD and not SACD. If you used your CD/DVD drive and a CD ripper (such as EAC) to extract the audio, then label it as "CD" sourced because it is not true 24-bit audio.
          • +
          • ↑_ 2.8.3.1. SACD hybrid discs ripped from the CD layer should be labeled as CD and not SACD. If you used your CD/DVD drive and a CD ripper (such as EAC) to extract the audio, then label it as "CD" sourced because it is not true 24-bit audio.
          • ↑_ 2.8.3.2. If the rip came from the genuine digital SACD layer via a PS3 player or through a SACD player mod or line out, it should be 24-bit quality SACD. You may include "SACD Hybrid" in the Edition Information box on the upload page.
        6. @@ -675,7 +675,7 @@
          5.4. Formatting
            -
          • ↑_ 5.4.1. All comic page scans must have zero-padded numbers and may be archived in .pdf, .rar (.cbr) or .zip (.cbz) files. The contents of the archive or directory must be image files (either JPEG or PNG), which are named sequentially so that they display in the correct order by comic reading software such as CDisplay and FFView. The page numbers and books must be zero-padded for this same reason. For example, this constitutes good numbering: file01.jpg, file02.jpg,... file30.jpg; and this constitutes bad numbering: file1.jpg, file2.jpg, file3.jpg,... file30.jpg.
          • +
          • ↑_ 5.4.1. All comic page scans must have zero-padded numbers and may be archived in .pdf, .rar (.cbr) or .zip (.cbz) files. The contents of the archive or directory must be image files (either JPEG or PNG), which are named sequentially so that they display in the correct order by comic reading software such as CDisplay and FFView. The page numbers and books must be zero-padded for this same reason. For example, this constitutes good numbering: file01.jpg, file02.jpg,... file30.jpg; and this constitutes bad numbering: file1.jpg, file2.jpg, file3.jpg,... file30.jpg.
          • ↑_ 5.4.2. Comic book archive file names must be informative. The archive names should include at least the book's name (e.g., "Uncanny X-Men"), the volume (if there's more than one volume for that book), and the issue number. Including the cover year, scanner information (to differentiate between different scans of the same book), and the issue's title (e.g., "Days of Future Past") is strongly recommended. For example: Buffy the Vampire Slayer Season Eight - #01 - 2007 - The Long Way Home Part 1.cbr and Amazing Spiderman - Volume 1 - #10 - 1964.cbz.
          • ↑_ 5.4.3. The directory name should uniquely identify its contents. You should include the title, as well as the issue numbers included (if applicable). The title, volume, cover year, and story name can often be found in small type at the bottom of the page opposite the inside cover. Directories should be named with the title of the series and the issue numbers. For example: ../Buffy the Vampire Slayer Season Eight - #01-#08/ and ../Amazing Spiderman - Volume 1 - #10-#20/.
          diff --git a/sections/schedule/index.php b/sections/schedule/index.php index 42bfae25..4a902229 100644 --- a/sections/schedule/index.php +++ b/sections/schedule/index.php @@ -319,7 +319,7 @@ function next_hour() { //------------- 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)."'"); + $DB->query("DELETE FROM login_attempts WHERE LastAttempt<'".time_minus(3600 * 24 * 90)."'"); //------------- Remove expired warnings ---------------------------------// $DB->query("SELECT UserID FROM users_info WHERE Warned<'$sqltime'"); @@ -520,23 +520,25 @@ function next_hour() { // Put user on ratio watch if he doesn't meet the standards sleep(10); - $DB->query("SELECT m.ID, - m.Downloaded - FROM users_info AS i - JOIN users_main AS m ON m.ID=i.UserID - WHERE m.Uploaded/m.Downloaded < m.RequiredRatio - AND i.RatioWatchEnds='0000-00-00 00:00:00' - AND m.Enabled='1' - AND m.can_leech='1'"); + $DB->query(" + SELECT m.ID, + m.Downloaded + FROM users_info AS i + JOIN users_main AS m ON m.ID=i.UserID + WHERE m.Uploaded/m.Downloaded < m.RequiredRatio + AND i.RatioWatchEnds='0000-00-00 00:00:00' + AND m.Enabled='1' + AND m.can_leech='1'"); $OnRatioWatch = $DB->collect('ID'); - if (count($OnRatioWatch)>0) { - $DB->query("UPDATE users_info AS i - JOIN users_main AS m ON m.ID=i.UserID - SET i.RatioWatchEnds='".time_plus(60 * 60 * 24 * 14)."', - i.RatioWatchTimes = i.RatioWatchTimes+1, - i.RatioWatchDownload = m.Downloaded - WHERE m.ID IN(".implode(",", $OnRatioWatch).")"); + if (count($OnRatioWatch) > 0) { + $DB->query(" + UPDATE users_info AS i + JOIN users_main AS m ON m.ID=i.UserID + SET i.RatioWatchEnds='".time_plus(60 * 60 * 24 * 14)."', + i.RatioWatchTimes = i.RatioWatchTimes+1, + i.RatioWatchDownload = m.Downloaded + WHERE m.ID IN(".implode(',', $OnRatioWatch).')'); } foreach ($OnRatioWatch as $UserID) { @@ -551,17 +553,21 @@ function next_hour() { //------------- Rescore 0.95 logs of disabled users - $LogQuery = $DB->query("SELECT DISTINCT t.ID - FROM torrents AS t - JOIN users_main AS um ON t.UserID = um.ID - JOIN torrents_logs_new AS tl ON tl.TorrentID = t.ID - WHERE um.Enabled = '2' and t.HasLog = '1' and LogScore = 100 and Log LIKE 'EAC extraction logfile from%'"); + $LogQuery = $DB->query(" + SELECT DISTINCT t.ID + FROM torrents AS t + JOIN users_main AS um ON t.UserID = um.ID + JOIN torrents_logs_new AS tl ON tl.TorrentID = t.ID + WHERE um.Enabled = '2' + AND t.HasLog = '1' + AND LogScore = 100 + AND Log LIKE 'EAC extraction logfile from%'"); $Details = array(); $Details[] = "Ripped with EAC v0.95, -1 point [1]"; $Details = serialize($Details); while (list($TorrentID) = $DB->next_record()) { $DB->query("UPDATE torrents SET LogScore = 99 WHERE ID = ".$TorrentID); - $DB->query("UPDATE torrents_logs_new SET Score = 99, Details = '".$Details."' WHERE TorrentID = ".$TorrentID); + $DB->query("UPDATE torrents_logs_new SET Score = 99, Details = '$Details' WHERE TorrentID = ".$TorrentID); } sleep(5); @@ -569,21 +575,23 @@ function next_hour() { //------------- Disable downloading ability of users on ratio watch - $UserQuery = $DB->query("SELECT ID, torrent_pass - FROM users_info AS i - JOIN users_main AS m ON m.ID=i.UserID - WHERE i.RatioWatchEnds!='0000-00-00 00:00:00' - AND i.RatioWatchEnds<'$sqltime' - AND m.Enabled='1' - AND m.can_leech!='0'"); + $UserQuery = $DB->query(" + SELECT ID, torrent_pass + FROM users_info AS i + JOIN users_main AS m ON m.ID=i.UserID + WHERE i.RatioWatchEnds!='0000-00-00 00:00:00' + AND i.RatioWatchEnds<'$sqltime' + AND m.Enabled='1' + AND m.can_leech!='0'"); $UserIDs = $DB->collect('ID'); if (count($UserIDs) > 0) { - $DB->query("UPDATE users_info AS i - JOIN users_main AS m ON m.ID=i.UserID - SET m.can_leech='0', - i.AdminComment=CONCAT('$sqltime - Leeching ability disabled by ratio watch system - required ratio: ', m.RequiredRatio,'', i.AdminComment) - WHERE m.ID IN(".implode(',',$UserIDs).")"); + $DB->query(" + UPDATE users_info AS i + JOIN users_main AS m ON m.ID=i.UserID + SET m.can_leech='0', + i.AdminComment=CONCAT('$sqltime - Leeching ability disabled by ratio watch system - required ratio: ', m.RequiredRatio,'', i.AdminComment) + WHERE m.ID IN(".implode(',',$UserIDs).")"); $DB->query("DELETE FROM users_torrent_history WHERE UserID IN (".implode(',',$UserIDs).")"); diff --git a/sections/tools/index.php b/sections/tools/index.php index 178cae92..26768799 100644 --- a/sections/tools/index.php +++ b/sections/tools/index.php @@ -97,15 +97,15 @@ break; case 'email_blacklist': - include('managers/eb.php'); + include('managers/email_blacklist.php'); break; - case 'eb_alter': - include('managers/eb_alter.php'); + case 'email_blacklist_alter': + include('managers/email_blacklist_alter.php'); break; - case 'eb_search': - include('managers/eb_search.php'); + case 'email_blacklist_search': + include('managers/email_blacklist_search.php'); break; case 'dnu': @@ -237,25 +237,30 @@ if (!$Err) { if (!is_numeric($_REQUEST['id'])) { - $DB->query("INSERT INTO permissions (Level,Name,Secondary,PermittedForums,`Values`,DisplayStaff) - VALUES ('".db_string($Level)."', - '".db_string($Name)."', - ".$Secondary.", - '".db_string($Forums)."', - '".db_string(serialize($Values))."', - '".db_string($DisplayStaff)."')"); + $DB->query(" + INSERT INTO permissions (Level,Name,Secondary,PermittedForums,`Values`,DisplayStaff) + VALUES ('".db_string($Level)."', + '".db_string($Name)."', + $Secondary, + '".db_string($Forums)."', + '".db_string(serialize($Values))."', + '".db_string($DisplayStaff)."')"); } else { - $DB->query("UPDATE permissions - SET Level='".db_string($Level)."', - Name='".db_string($Name)."', - Secondary=".$Secondary.", - PermittedForums='".db_string($Forums)."', - `Values`='".db_string(serialize($Values))."', - DisplayStaff='".db_string($DisplayStaff)."' - WHERE ID='".db_string($_REQUEST['id'])."'"); + $DB->query(" + UPDATE permissions + SET Level='".db_string($Level)."', + Name='".db_string($Name)."', + Secondary=$Secondary, + PermittedForums='".db_string($Forums)."', + `Values`='".db_string(serialize($Values))."', + DisplayStaff='".db_string($DisplayStaff)."' + WHERE ID='".db_string($_REQUEST['id'])."'"); $Cache->delete_value('perm_'.$_REQUEST['id']); if ($Secondary) { - $DB->query("SELECT DISTINCT UserID FROM users_levels WHERE PermissionID = ".db_string($_REQUEST['id'])); + $DB->query(" + SELECT DISTINCT UserID + FROM users_levels + WHERE PermissionID = ".db_string($_REQUEST['id'])); while ($UserID = $DB->next_record()) { $Cache->delete_value('user_info_heavy_'.$UserID); } @@ -309,7 +314,7 @@ include('data/donation_log.php'); break; - + case 'upscale_pool': include('data/upscale_pool.php'); break; @@ -317,6 +322,7 @@ case 'invite_pool': include('data/invite_pool.php'); break; + case 'torrent_stats': include('data/torrent_stats.php'); break; @@ -348,9 +354,9 @@ case 'browser_support': include('data/browser_support.php'); break; - //END Data + //END Data - //Misc + //Misc case 'update_geoip': include('misc/update_geoip.php'); break; @@ -378,10 +384,10 @@ case 'analysis': include('misc/analysis.php'); break; - + case 'rerender_gallery': - include('misc/rerender_gallery.php'); - break; + include('misc/rerender_gallery.php'); + break; case 'sandbox1': include('misc/sandbox1.php'); diff --git a/sections/tools/managers/dnu_list.php b/sections/tools/managers/dnu_list.php index 22ffb400..86de603d 100644 --- a/sections/tools/managers/dnu_list.php +++ b/sections/tools/managers/dnu_list.php @@ -2,8 +2,9 @@ if (!check_perms('admin_dnu')) { error(403); } +$Title = 'Manage the "Do Not Upload" list'; -View::show_header('Manage "Do Not Upload" list'); +View::show_header($Title); $DB->query(" SELECT d.ID, @@ -16,9 +17,27 @@ ORDER BY d.Time DESC"); ?>
          -

          Do Not Uploads

          +

          + + + + + + + + + + + + @@ -39,7 +58,7 @@ - - - - - - - - - - - -
          Add an entry to the "Do Not Upload" list
          + + + + + +
          Name Comment
          - +
          @@ -48,23 +67,5 @@
          Add Do Not Upload
          - - - - - -
          diff --git a/sections/tools/managers/eb.php b/sections/tools/managers/email_blacklist.php similarity index 90% rename from sections/tools/managers/eb.php rename to sections/tools/managers/email_blacklist.php index 2489107c..dfc9cbd7 100644 --- a/sections/tools/managers/eb.php +++ b/sections/tools/managers/email_blacklist.php @@ -39,11 +39,11 @@ Submit - Add Email or Domain to Blacklist + Add email address or domain to blacklist
          - + @@ -57,7 +57,7 @@ - + diff --git a/sections/tools/managers/eb_alter.php b/sections/tools/managers/email_blacklist_alter.php similarity index 80% rename from sections/tools/managers/eb_alter.php rename to sections/tools/managers/email_blacklist_alter.php index 5284cba0..626f87fe 100644 --- a/sections/tools/managers/eb_alter.php +++ b/sections/tools/managers/email_blacklist_alter.php @@ -5,12 +5,12 @@ authorize(); -if ($_POST['submit'] == 'Delete') { //Delete +if ($_POST['submit'] == 'Delete') { // Delete if (!is_number($_POST['id']) || $_POST['id'] == '') { error(0); } $DB->query('DELETE FROM email_blacklist WHERE ID='.$_POST['id']); -} else { //Edit & Create, Shared Validation +} else { // Edit & Create, Shared Validation $Val->SetFields('email', '1','string','The email must be set', array('minlength'=>1)); $Val->SetFields('comment', '0','string','The description has a max length of 255 characters', array('maxlength'=>255)); $Err = $Val->ValidateForm($_POST); // Validate the form @@ -21,7 +21,7 @@ $P = array(); $P = db_array($_POST); // Sanitize the form - if ($_POST['submit'] == 'Edit') { //Edit + if ($_POST['submit'] == 'Edit') { // Edit if (!is_number($_POST['id']) || $_POST['id'] == '') { error(0); } @@ -33,11 +33,10 @@ UserID='$LoggedUser[ID]', Time='".sqltime()."' WHERE ID='$P[id]'"); - } else { //Create + } else { // Create $DB->query(" INSERT INTO email_blacklist (Email, Comment, UserID, Time) - VALUES - ('$P[email]','$P[comment]','$LoggedUser[ID]','".sqltime()."')"); + VALUES ('$P[email]','$P[comment]','$LoggedUser[ID]','".sqltime()."')"); } } diff --git a/sections/tools/managers/eb_search.php b/sections/tools/managers/email_blacklist_search.php similarity index 53% rename from sections/tools/managers/eb_search.php rename to sections/tools/managers/email_blacklist_search.php index 132776a1..31934b28 100644 --- a/sections/tools/managers/eb_search.php +++ b/sections/tools/managers/email_blacklist_search.php @@ -2,22 +2,23 @@ $Search = db_string($_GET['email']); $JSON = array(); if (!check_perms('users_view_email') || empty($Search)) { - $JSON['status'] = "error"; + $JSON['status'] = 'error'; echo json_encode($JSON); exit(); } else { - $JSON['status'] = "success"; + $JSON['status'] = 'success'; } -$DB->query("SELECT - eb.ID, - eb.UserID, - eb.Time, - eb.Email, - eb.Comment - FROM email_blacklist AS eb - WHERE eb.Email LIKE '%$Search%'"); +$DB->query(" + SELECT + eb.ID, + eb.UserID, + eb.Time, + eb.Email, + eb.Comment + FROM email_blacklist AS eb + WHERE eb.Email LIKE '%$Search%'"); $EmailResults = $DB->to_array(false, MYSQLI_ASSOC, false); @@ -29,13 +30,16 @@ if ($Count > 0) { foreach ($EmailResults as $Email) { - $Emails[] = array("id" => (int) $Email['ID'], "email" => $Email['Email'], - "comment" => $Email['Comment'], "userid" => (int) $Email['UserID'], - "time" => $Email['Time']); + $Emails[] = array( + 'id' => (int) $Email['ID'], + 'email' => $Email['Email'], + 'comment' => $Email['Comment'], + 'userid' => (int) $Email['UserID'], + 'time' => $Email['Time']); } } $Results['emails'] = $Emails; $JSON['results'] = $Results; echo json_encode($JSON); -exit(); \ No newline at end of file +exit(); diff --git a/sections/tools/tools.php b/sections/tools/tools.php index cc166c93..ece44b85 100644 --- a/sections/tools/tools.php +++ b/sections/tools/tools.php @@ -24,7 +24,7 @@ News - Do not upload list + "Do Not Upload" list Vanity House additions diff --git a/sections/user/takemoderate.php b/sections/user/takemoderate.php index 4b616fca..ed6dc59f 100644 --- a/sections/user/takemoderate.php +++ b/sections/user/takemoderate.php @@ -560,7 +560,7 @@ Tools::disable_users($UserID, '', 1); } elseif ($EnableUser == '1') { $Cache->increment('stats_user_count'); - Tracker::update_tracker('add_user', array('id' => $UserID, 'passkey' => $Cur['torrent_pass'])); + Tracker::update_tracker('add_user', array('id' => $UserID, 'passkey' => $Cur['torrent_pass']), true); if (($Cur['Downloaded'] == 0) || ($Cur['Uploaded']/$Cur['Downloaded'] >= $Cur['RequiredRatio'])) { $UpdateSet[] = "i.RatioWatchEnds='0000-00-00 00:00:00'"; $CanLeech = 1; @@ -573,7 +573,7 @@ $UpdateSet[] = "i.RatioWatchDownload=m.Downloaded"; $CanLeech = 0; } - Tracker::update_tracker('update_user', array('passkey' => $Cur['torrent_pass'], 'can_leech' => '0')); + Tracker::update_tracker('update_user', array('passkey' => $Cur['torrent_pass'], 'can_leech' => '0'), true); } $UpdateSet[] = "Enabled='1'"; $LightUpdates['Enabled'] = 1;