From 1a22e4247cde345f942277d4587fe7fd89b98521 Mon Sep 17 00:00:00 2001 From: Git Date: Mon, 5 Sep 2011 08:00:07 +0000 Subject: [PATCH] 84 changes from Sun Aug 21 14:42:15 2011 -0400 to Mon Sep 5 00:15:20 2011 +0000 Fixes a bug showing the Disable Avatars box for users with the "Can disable users' posting rights" permission Revert "#trying to fix mono" fix unknown release (try 1) trying to roll this out with dirty cache support Go back to memcached's internal incr/decr functions fixed nextElementSibling() patappatch g [patapper] --- classes/script_start.php | 6 +++--- sections/artist/artist.php | 25 ++++++++++++++++--------- sections/bookmarks/torrents.php | 19 ++++++++++++++----- sections/collages/collage.php | 19 ++++++++++++++----- sections/peerupdate/index.php | 4 ++-- sections/torrents/browse2.php | 22 ++++++++++++++++------ sections/torrents/details.php | 20 ++++++-------------- sections/user/index.php | 1 - sections/user/user.php | 5 +++-- static/styles/mono/style.css | 14 +++++++++----- 10 files changed, 83 insertions(+), 52 deletions(-) diff --git a/classes/script_start.php b/classes/script_start.php index 333f29fb..9ae9ceef 100644 --- a/classes/script_start.php +++ b/classes/script_start.php @@ -1618,7 +1618,7 @@ function get_groups($GroupIDs, $Return = true, $GetArtists = true) { foreach($GroupIDs as $GroupID) { $Data = $Cache->get_value('torrent_group_'.$GroupID, true); - if(!empty($Data) && (@$Data['ver'] >= 2)) { + if(!empty($Data) && (@$Data['ver'] >= 4)) { unset($NotFound[$GroupID]); $Found[$GroupID] = $Data['d']; } @@ -1645,11 +1645,11 @@ function get_groups($GroupIDs, $Return = true, $GetArtists = true) { $DB->query("SELECT ID, GroupID, Media, Format, Encoding, RemasterYear, Remastered, RemasterTitle, RemasterRecordLabel, RemasterCatalogueNumber, Scene, HasLog, HasCue, LogScore, FileCount, FreeTorrent, Size, Leechers, Seeders, Snatched, Time, ID AS HasFile - FROM torrents AS t WHERE GroupID IN($IDs) ORDER BY GroupID, RemasterYear, RemasterTitle, RemasterRecordLabel, RemasterCatalogueNumber, Media, Format, Encoding"); + FROM torrents AS t WHERE GroupID IN($IDs) ORDER BY GroupID, Remastered, (RemasterYear <> 0) DESC, RemasterYear, RemasterTitle, RemasterRecordLabel, RemasterCatalogueNumber, Media, Format, Encoding, ID"); while($Torrent = $DB->next_record(MYSQLI_ASSOC, true)) { $Found[$Torrent['GroupID']]['Torrents'][$Torrent['ID']] = $Torrent; - $Cache->cache_value('torrent_group_'.$Torrent['GroupID'], array('ver'=>2, 'd'=>$Found[$Torrent['GroupID']]), 0); + $Cache->cache_value('torrent_group_'.$Torrent['GroupID'], array('ver'=>4, 'd'=>$Found[$Torrent['GroupID']]), 0); } } diff --git a/sections/artist/artist.php b/sections/artist/artist.php index 8b19e2a6..354422ab 100644 --- a/sections/artist/artist.php +++ b/sections/artist/artist.php @@ -180,9 +180,7 @@ function compare($X, $Y){ foreach ($TorrentList as $GroupID=>$Group) { list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists) = array_values($Group); $GroupVanityHouse = $Importances[$GroupID]['VanityHouse']; - - - + $TagList = explode(' ',str_replace('_','.',$TagList)); $TorrentTags = array(); @@ -225,7 +223,7 @@ function compare($X, $Y){ - + @@ -270,9 +268,14 @@ function compare($X, $Y){ $LastMedia = ''; $EditionID = 0; + unset($FirstUnknown); foreach ($Torrents as $TorrentID => $Torrent) { $NumTorrents++; + + if ($Torrent['Remastered'] && !$Torrent['RemasterYear']) { + $FirstUnknown = !isset($FirstUnknown); + } $Torrent['Seeders'] = (int)$Torrent['Seeders']; $Torrent['Leechers'] = (int)$Torrent['Leechers']; @@ -283,11 +286,11 @@ function compare($X, $Y){ $NumSnatches+=$Torrent['Snatched']; if($Torrent['RemasterTitle'] != $LastRemasterTitle || $Torrent['RemasterYear'] != $LastRemasterYear || - $Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber || $Torrent['Media'] != $LastMedia) { + $Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber || $FirstUnknown || $Torrent['Media'] != $LastMedia) { $EditionID++; - if($Torrent['RemasterTitle'] || $Torrent['RemasterYear'] || $Torrent['RemasterRecordLabel'] || $Torrent['RemasterCatalogueNumber']) { + if($Torrent['Remastered'] && $Torrent['RemasterYear'] != 0) { $RemasterName = $Torrent['RemasterYear']; $AddExtra = " - "; @@ -302,10 +305,14 @@ function compare($X, $Y){ diff --git a/sections/bookmarks/torrents.php b/sections/bookmarks/torrents.php index f72cee98..dcf07a41 100644 --- a/sections/bookmarks/torrents.php +++ b/sections/bookmarks/torrents.php @@ -135,14 +135,19 @@ function compare($X, $Y){ $LastMedia = ''; $EditionID = 0; + unset($FirstUnknown); foreach ($Torrents as $TorrentID => $Torrent) { + + if ($Torrent['Remastered'] && !$Torrent['RemasterYear']) { + $FirstUnknown = !isset($FirstUnknown); + } if($Torrent['RemasterTitle'] != $LastRemasterTitle || $Torrent['RemasterYear'] != $LastRemasterYear || - $Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber || $Torrent['Media'] != $LastMedia) { + $Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber || $FirstUnknown || $Torrent['Media'] != $LastMedia) { $EditionID++; - if($Torrent['RemasterTitle'] || $Torrent['RemasterYear'] || $Torrent['RemasterRecordLabel'] || $Torrent['RemasterCatalogueNumber']) { + if($Torrent['Remastered'] && $Torrent['RemasterYear'] != 0) { $RemasterName = $Torrent['RemasterYear']; $AddExtra = " - "; @@ -157,10 +162,14 @@ function compare($X, $Y){ diff --git a/sections/collages/collage.php b/sections/collages/collage.php index 289d04b4..fe5ff90f 100644 --- a/sections/collages/collage.php +++ b/sections/collages/collage.php @@ -155,12 +155,17 @@ function compare($X, $Y){ $LastMedia = ''; $EditionID = 0; + unset($FirstUnknown); foreach ($Torrents as $TorrentID => $Torrent) { + + if ($Torrent['Remastered'] && !$Torrent['RemasterYear']) { + $FirstUnknown = !isset($FirstUnknown); + } if($Torrent['RemasterTitle'] != $LastRemasterTitle || $Torrent['RemasterYear'] != $LastRemasterYear || - $Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber || $Torrent['Media'] != $LastMedia) { - if($Torrent['RemasterTitle'] || $Torrent['RemasterYear'] || $Torrent['RemasterRecordLabel'] || $Torrent['RemasterCatalogueNumber']) { + $Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber || $FirstUnknown || $Torrent['Media'] != $LastMedia) { + if($Torrent['Remastered'] && $Torrent['RemasterYear'] != 0) { $EditionID++; @@ -177,10 +182,14 @@ function compare($X, $Y){ diff --git a/sections/peerupdate/index.php b/sections/peerupdate/index.php index 7c829d0a..a3e88f37 100644 --- a/sections/peerupdate/index.php +++ b/sections/peerupdate/index.php @@ -30,7 +30,7 @@ while(list($GroupID,$Seeders,$Leechers,$Snatched) = $DB->next_record(MYSQLI_NUM)) { $Data = $Cache->get_value('torrent_group_'.$GroupID); - if (!(is_array($Data) && (@$Data['ver'] >= 2))) { continue; } + if (!(is_array($Data) && (@$Data['ver'] >= 4))) { continue; } $Data = $Data['d']; $Changed = false; @@ -74,7 +74,7 @@ $TotalSnatched=$Val; } if($Changed) { - $Cache->cache_value('torrent_group_'.$GroupID, $Data, 0); + $Cache->cache_value('torrent_group_'.$GroupID, array('ver'=>4,'d'=>$Data), 0); } unset($Data); } diff --git a/sections/torrents/browse2.php b/sections/torrents/browse2.php index 4bb243ad..949b2a54 100644 --- a/sections/torrents/browse2.php +++ b/sections/torrents/browse2.php @@ -734,6 +734,7 @@ function header_link($SortKey,$DefaultWay="desc") { $LastMedia = ''; $EditionID = 0; + unset($FirstUnknown); foreach($Torrents as $TorrentID => $Data) { // All of the individual torrents in the group @@ -828,10 +829,15 @@ function header_link($SortKey,$DefaultWay="desc") { continue; } + if ($Data['Remastered'] && !$Data['RemasterYear']) { + $FirstUnknown = !isset($FirstUnknown); + } + if($CategoryID == 1 && ($Data['RemasterTitle'] != $LastRemasterTitle || $Data['RemasterYear'] != $LastRemasterYear || - $Data['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Data['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber) || $Data['Media'] != $LastMedia) { - if($Data['RemasterTitle'] || $Data['RemasterYear'] || $Data['RemasterRecordLabel'] || $Data['RemasterCatalogueNumber']) { - $EditionID++; + $Data['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Data['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber) || $FirstUnknown || $Data['Media'] != $LastMedia) { + $EditionID++; + + if($Data['Remastered'] && $Data['RemastedYear'] != 0) { $RemasterName = $Data['RemasterYear']; $AddExtra = " - "; @@ -846,10 +852,14 @@ function header_link($SortKey,$DefaultWay="desc") { diff --git a/sections/torrents/details.php b/sections/torrents/details.php index 7882c576..791f7f9c 100644 --- a/sections/torrents/details.php +++ b/sections/torrents/details.php @@ -294,11 +294,7 @@ function filelist($Str) { $BadTags, $BadFolders, $BadFiles, $CassetteApproved, $LossymasterApproved, $LastReseedRequest, $LogInDB, $HasFile) = $Torrent; if($Remastered && !$RemasterYear) { - if(!isset($FirstUnknown)) { - $FirstUnknown = true; - } else { - $FirstUnknown = false; - } + $FirstUnknown = !isset($FirstUnknown); } $Reported = false; @@ -397,24 +393,20 @@ function filelist($Str) { - - - -
  (View) Size Snatches
Unknown Release(s)
Disable: - checked="checked" /> + checked="checked" /> | + checked="checked" /> | checked="checked" /> | - checked="checked" /> | + checked="checked" /> | checked="checked" /> | checked="checked" /> diff --git a/static/styles/mono/style.css b/static/styles/mono/style.css index 188cc1b1..23cd83d8 100644 --- a/static/styles/mono/style.css +++ b/static/styles/mono/style.css @@ -496,14 +496,18 @@ table[width="100%"] .colhead td,table[width="100%"] .colhead_dark td,.torrent_ta border: 1px solid #aeaeae !important; } +#bookmarks .torrent_table .colhead_dark td:nth-child(3) { + width: 60%; +} + +#bookmarks .torrent_table .colhead_dark td:first-child, #bookmarks .torrent_table .colhead_dark td:nth-child(2) { + width: 5%; +} +/* .torrent_table .colhead_dark td:first-child { width: 70%; } - -#bookmarks .torrent_table .colhead_dark td:first-child { - width: 5%; -} - +*/ table[width="100%"] td:first-child,.torrent_table td:first-child,#requests td:first-child,#collages td:first-child,.forum_index td:first-child,#torrent_table td:first-child,table.border td:first-child,.linkbox+table td:first-child,form#messageform table td:first-child,#inbox form table td:first-child { border-left: 1px solid #aeaeae; }