diff --git a/classes/class_torrents.php b/classes/class_torrents.php
index 2f7e09c4..b018a406 100644
--- a/classes/class_torrents.php
+++ b/classes/class_torrents.php
@@ -27,11 +27,19 @@ class Torrents {
* Seeders, Snatched, Time, HasFile, PersonalFL, IsSnatched
* }
* }
+ * Artists => {
+ * {
+ * id, name, aliasid // Only main artists
+ * }
+ * }
* ExtendedArtists => {
* [1-6] => { // See documentation on Artists::get_artists
* id, name, aliasid
* }
* }
+ * Flags => {
+ * IsSnatched
+ * }
*/
public static function get_groups($GroupIDs, $Return = true, $GetArtists = true, $Torrents = true) {
global $DB, $Cache, $Debug;
@@ -128,8 +136,11 @@ public static function get_groups($GroupIDs, $Return = true, $GetArtists = true,
}
// Fetch all user specific torrent properties
foreach ($Found as &$Group) {
+ $Group['Flags'] = array('IsSnatched' => false);
if (!empty($Group['Torrents'])) {
- array_walk($Group['Torrents'], 'self::torrent_properties');
+ foreach ($Group['Torrents'] as &$Torrent) {
+ self::torrent_properties($Torrent, $Group['Flags']);
+ }
}
}
@@ -146,9 +157,11 @@ public static function get_groups($GroupIDs, $Return = true, $GetArtists = true,
* @param array $Torrent torrent array preferably in the form used by Torrents::get_groups() or get_group_info()
* @param int $TorrentID
*/
- public static function torrent_properties(&$Torrent, $TorrentID) {
- $Torrent['PersonalFL'] = empty($Torrent['FreeTorrent']) && self::has_token($TorrentID);
- $Torrent['IsSnatched'] = self::has_snatched($TorrentID);
+ public static function torrent_properties(&$Torrent, &$Flags) {
+ $Torrent['PersonalFL'] = empty($Torrent['FreeTorrent']) && self::has_token($Torrent['ID']);
+ if ($Torrent['IsSnatched'] = self::has_snatched($Torrent['ID'])) {
+ $Flags['IsSnatched'] = true;
+ }
}
diff --git a/design/privateheader.php b/design/privateheader.php
index 022d4638..9e9aa9d7 100644
--- a/design/privateheader.php
+++ b/design/privateheader.php
@@ -304,13 +304,18 @@
$Alerts[] = ''.'You have '.$NewCollages.(($NewCollages > 1) ? ' new collage updates' : ' new collage update').'';
}
}
-
-if (check_perms('users_mod')) {
+if(check_perms('users_mod')) {
$ModBar[] = ''.'Toolbox'.'';
-
+}
+if (check_perms('users_mod') || $LoggedUser['PermissionID'] == FORUM_MOD) {
$NumStaffPMs = $Cache->get_value('num_staff_pms_'.$LoggedUser['ID']);
if ($NumStaffPMs === false) {
- $DB->query("SELECT COUNT(ID) FROM staff_pm_conversations WHERE Status='Unanswered' AND (AssignedToUser=".$LoggedUser['ID']." OR (Level >= ".max(700,$Classes[MOD]['Level'])." AND Level <=".$LoggedUser['Class']."))");
+ if(check_perms('users_mod')) {
+ $DB->query("SELECT COUNT(ID) FROM staff_pm_conversations WHERE Status='Unanswered' AND (AssignedToUser=".$LoggedUser['ID']." OR (Level >= ".max(700,$Classes[MOD]['Level'])." AND Level <=".$LoggedUser['Class']."))");
+ }
+ if($LoggedUser['PermissionID'] == FORUM_MOD) {
+ $DB->query("SELECT COUNT(ID) FROM staff_pm_conversations WHERE Status='Unanswered' AND (AssignedToUser=".$LoggedUser['ID']." OR Level = '". $Classes[FORUM_MOD]['Level'] . "')");
+ }
list($NumStaffPMs) = $DB->next_record();
$Cache->cache_value('num_staff_pms_'.$LoggedUser['ID'], $NumStaffPMs , 1000);
}
diff --git a/sections/artist/artist.php b/sections/artist/artist.php
index 7517f14e..657200ea 100644
--- a/sections/artist/artist.php
+++ b/sections/artist/artist.php
@@ -286,7 +286,7 @@ function compare($X, $Y){
$LastReleaseType = 0;
foreach ($Importances as $Group) {
- list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists, $ExtendedArtists) = array_values($TorrentList[$Group['GroupID']]);
+ list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists, $ExtendedArtists, $GroupFlags) = array_values($TorrentList[$Group['GroupID']]);
$ReleaseType = $Group['ReleaseType'];
$GroupVanityHouse = $Group['VanityHouse'];
@@ -392,8 +392,9 @@ function compare($X, $Y){
if($GroupVanityHouse) { $DisplayName .= ' [VH]'; }
+ $SnatchedGroupClass = $GroupFlags['IsSnatched'] ? ' snatched_group' : '';
?>
-
@@ -418,6 +419,7 @@ function compare($X, $Y){
if ($Torrent['Remastered'] && !$Torrent['RemasterYear']) {
$FirstUnknown = !isset($FirstUnknown);
}
+ $SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : '';
if($Torrent['RemasterTitle'] != $LastRemasterTitle || $Torrent['RemasterYear'] != $LastRemasterYear ||
$Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber || $FirstUnknown || $Torrent['Media'] != $LastMedia) {
@@ -433,7 +435,7 @@ function compare($X, $Y){
$RemasterName .= $AddExtra.display_str($Torrent['Media']);
?>
-
+
− =$RemasterName?> |
@@ -448,7 +450,7 @@ function compare($X, $Y){
}
$MasterName .= $AddExtra.display_str($Torrent['Media']);
?>
-
+
− =$MasterName?> |
@@ -460,7 +462,7 @@ function compare($X, $Y){
$LastRemasterCatalogueNumber = $Torrent['RemasterCatalogueNumber'];
$LastMedia = $Torrent['Media'];
?>
-
+
[ =$Torrent['HasFile'] ? 'DL' : 'Missing'?>
diff --git a/sections/better/files.php b/sections/better/files.php
index 27af98c4..4ce22a88 100644
--- a/sections/better/files.php
+++ b/sections/better/files.php
@@ -27,9 +27,9 @@
?>
-
There are =count($TorrentsInfo)?> torrents remaining
-foreach($TorrentsInfo as $TorrentID => $Info) {
- list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TorrentTags, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists) = array_values($Results[$Info['GroupID']]);
-
- $DisplayName = '';
- if(count($Artists)>0) {
- $DisplayName = Artists::display_artists(array('1'=>$Artists));
+foreach ($TorrentsInfo as $TorrentID => $Info) {
+ list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TorrentTags, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists, $ExtendedArtists, $GroupFlags) = array_values($Results[$Info['GroupID']]);
+ if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) {
+ unset($ExtendedArtists[2]);
+ unset($ExtendedArtists[3]);
+ $DisplayName = Artists::display_artists($ExtendedArtists);
+ } else {
+ $DisplayName = '';
}
$DisplayName.=''.$GroupName.'';
- if($GroupYear>0) {
- $DisplayName.=" [".$GroupYear."]";
- }
+ if($GroupYear>0) { $DisplayName.=" [".$GroupYear."]"; }
if($ReleaseType>0) { $DisplayName.=" [".$ReleaseTypes[$ReleaseType]."]"; }
+
$ExtraInfo = Torrents::torrent_info($Torrents[$TorrentID]);
if($ExtraInfo) {
$DisplayName.=' - '.$ExtraInfo;
@@ -74,16 +74,19 @@
$TorrentTags='
'.$TagList.' ';
}
?>
- =$DisplayName?>
- [ DL ]
- if(check_perms('admin_reports')) { ?>
- [X]
+ | ">
+
+
+ [ DL ]
+
+ =$DisplayName?>
+ if (check_perms('admin_reports')) { ?>
+ [X]
} ?>
- =$TorrentTags?>
- |
-
-}
-?>
+ =$TorrentTags?>
+
+
+ } ?>
diff --git a/sections/better/single.php b/sections/better/single.php
index 5e2acce7..38613931 100644
--- a/sections/better/single.php
+++ b/sections/better/single.php
@@ -25,17 +25,25 @@
$Results = $Results['matches'];
foreach ($Results as $GroupID=>$Group) {
- list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TorrentTags, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists) = array_values($Group);
- $FlacID = $GroupIDs[$GroupID]['TorrentID'];
-
- $DisplayName = '';
- if(count($Artists)>0) {
- $DisplayName = Artists::display_artists(array('1'=>$Artists));
+ list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TorrentTags, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists, $ExtendedArtists, $GroupFlags) = array_values($Group);
+ if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) {
+ unset($ExtendedArtists[2]);
+ unset($ExtendedArtists[3]);
+ $DisplayName = Artists::display_artists($ExtendedArtists);
+ } else {
+ $DisplayName = '';
}
+ $FlacID = $GroupIDs[$GroupID]['TorrentID'];
+
$DisplayName.=''.$GroupName.'';
if($GroupYear>0) { $DisplayName.=" [".$GroupYear."]"; }
if($ReleaseType>0) { $DisplayName.=" [".$ReleaseTypes[$ReleaseType]."]"; }
+ $ExtraInfo = Torrents::torrent_info($Torrents[$FlacID]);
+ if($ExtraInfo) {
+ $DisplayName.=' - '.$ExtraInfo;
+ }
+
$TagList=array();
if($TorrentTags!='') {
$TorrentTags=explode(' ',$TorrentTags);
@@ -48,10 +56,12 @@
$TorrentTags='
'.$TagList.' ';
}
?>
-
+ ">
- =$DisplayName?>
- [ DL ]
+
+ [ DL ]
+
+ =$DisplayName?>
=$TorrentTags?>
|
diff --git a/sections/better/snatch.php b/sections/better/snatch.php
index fcf35f78..361820be 100644
--- a/sections/better/snatch.php
+++ b/sections/better/snatch.php
@@ -77,6 +77,7 @@
$TorRemIdent => array(
'FlacID' => 0,
'Formats' => array(),
+ 'IsSnatched' => $Torrent['IsSnatched'],
'Medium' => $Torrent['Media'],
'RemasterTitle' => $Torrent['RemasterTitle'],
'RemasterYear' => $Torrent['RemasterYear'],
@@ -88,6 +89,7 @@
$TorrentGroups[$Group['ID']][$TorRemIdent] = array(
'FlacID' => 0,
'Formats' => array(),
+ 'IsSnatched' => $Torrent['IsSnatched'],
'Medium' => $Torrent['Media'],
'RemasterTitle' => $Torrent['RemasterTitle'],
'RemasterYear' => $Torrent['RemasterYear'],
@@ -178,7 +180,7 @@
}
$ExtraInfo .= implode(' / ', $EditionInfo);
?>
- >
+
[ DL ]
diff --git a/sections/better/tags.php b/sections/better/tags.php
index 86136a28..9006f101 100644
--- a/sections/better/tags.php
+++ b/sections/better/tags.php
@@ -46,16 +46,18 @@
foreach($TorrentsInfo as $TorrentID => $Info) {
- list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TorrentTags, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists) = array_values($Results[$Info['GroupID']]);
- $DisplayName = '';
- if(count($Artists)>0) {
- $DisplayName = Artists::display_artists(array('1'=>$Artists));
- }
- $DisplayName.=''.$GroupName.'';
- if($GroupYear>0) {
- $DisplayName.=" [".$GroupYear."]";
+ list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TorrentTags, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists, $ExtendedArtists, $GroupFlags) = array_values($Results[$Info['GroupID']]);
+ if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) {
+ unset($ExtendedArtists[2]);
+ unset($ExtendedArtists[3]);
+ $DisplayName = Artists::display_artists($ExtendedArtists);
+ } else {
+ $DisplayName = '';
}
+ $DisplayName.=''.$GroupName.'';
+ if($GroupYear>0) { $DisplayName.=" [".$GroupYear."]"; }
if($ReleaseType>0) { $DisplayName.=" [".$ReleaseTypes[$ReleaseType]."]"; }
+
$ExtraInfo = Torrents::torrent_info($Torrents[$TorrentID]);
if($ExtraInfo) {
$DisplayName.=' - '.$ExtraInfo;
@@ -73,13 +75,18 @@
$TorrentTags='
'.$TagList.' ';
}
?>
- =$DisplayName?>
- [ DL ]
+ |
+
+
+ [ DL ]
+
+ =$DisplayName?>
if(check_perms('admin_reports')) { ?>
- [X]
+ [X]
} ?>
- =$TorrentTags?>
- |
+ =$TorrentTags?>
+
+
}
?>
diff --git a/sections/better/upload.php b/sections/better/upload.php
index a5e102a9..f4c498f5 100644
--- a/sections/better/upload.php
+++ b/sections/better/upload.php
@@ -58,16 +58,28 @@
$Results = $Results['matches'];
foreach ($Results as $GroupID=>$Group) {
- list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TorrentTags, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists) = array_values($Group);
+ list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TorrentTags, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists, $ExtendedArtists, $GroupFlags) = array_values($Group);
+ if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) {
+ unset($ExtendedArtists[2]);
+ unset($ExtendedArtists[3]);
+ $DisplayName = Artists::display_artists($ExtendedArtists);
+ } else {
+ $DisplayName = '';
+ }
$FlacID = $Uploads[$GroupID]['ID'];
$DisplayName = '';
if(count($Artists)>0) {
$DisplayName = Artists::display_artists(array('1'=>$Artists));
}
- $DisplayName.=''.$GroupName.'';
+ $DisplayName.=''.$GroupName.'';
if($GroupYear>0) { $DisplayName.=" [".$GroupYear."]"; }
if($ReleaseType>0) { $DisplayName.=" [".$ReleaseTypes[$ReleaseType]."]"; }
+
+ $ExtraInfo = Torrents::torrent_info($Torrents[$FlacID]);
+ if($ExtraInfo) {
+ $DisplayName.=' - '.$ExtraInfo;
+ }
$MissingEncodings = array('V0 (VBR)'=>1, 'V2 (VBR)'=>1, '320'=>1);
@@ -89,10 +101,12 @@
$TorrentTags='
'.$TagList.' ';
}
?>
-
+ >
+
+ [ DL ]
+
=$DisplayName?>
- [ DL ]
=$TorrentTags?>
|
=($MissingEncodings['V2 (VBR)'] == 0)?'YES':'NO'?> |
diff --git a/sections/bookmarks/torrents.php b/sections/bookmarks/torrents.php
index 324ce2de..2ce17ab4 100644
--- a/sections/bookmarks/torrents.php
+++ b/sections/bookmarks/torrents.php
@@ -37,7 +37,7 @@ function compare($X, $Y){
$Tags = array();
foreach ($TorrentList as $GroupID=>$Group) {
- list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse, $Torrents, $GroupArtists, $ExtendedArtists) = array_values($Group);
+ list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse, $Torrents, $GroupArtists, $ExtendedArtists, $GroupFlags) = array_values($Group);
list($GroupID2, $Sort, $Image, $GroupCategoryID, $AddedTime) = array_values($CollageDataList[$GroupID]);
// Handle stats and stuff
@@ -80,6 +80,7 @@ function compare($X, $Y){
$DisplayName .= ''.$GroupName.'';
if($GroupYear>0) { $DisplayName = $DisplayName. ' ['. $GroupYear .']';}
if($GroupVanityHouse) { $DisplayName .= ' [VH]'; }
+ $SnatchedGroupClass = $GroupFlags['IsSnatched'] ? ' snatched_group' : '';
// Start an output buffer, so we can store this output in $TorrentTable
ob_start();
@@ -87,7 +88,7 @@ function compare($X, $Y){
// Grouped torrents
$ShowGroups = !(!empty($LoggedUser['TorrentGrouping']) && $LoggedUser['TorrentGrouping'] == 1);
?>
-
+
@@ -123,6 +124,7 @@ function compare($X, $Y){
if ($Torrent['Remastered'] && !$Torrent['RemasterYear']) {
$FirstUnknown = !isset($FirstUnknown);
}
+ $SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : '';
if($Torrent['RemasterTitle'] != $LastRemasterTitle || $Torrent['RemasterYear'] != $LastRemasterYear ||
$Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber || $FirstUnknown || $Torrent['Media'] != $LastMedia) {
@@ -138,7 +140,7 @@ function compare($X, $Y){
$RemasterName .= $AddExtra.display_str($Torrent['Media']);
?>
-
+
− =$RemasterName?> |
@@ -153,7 +155,7 @@ function compare($X, $Y){
}
$MasterName .= $AddExtra.display_str($Torrent['Media']);
?>
-
+
− =$MasterName?> |
@@ -165,7 +167,7 @@ function compare($X, $Y){
$LastRemasterCatalogueNumber = $Torrent['RemasterCatalogueNumber'];
$LastMedia = $Torrent['Media'];
?>
-
+
[ DL
if (Torrents::can_use_token($Torrent)) { ?>
@@ -197,10 +199,11 @@ function compare($X, $Y){
} elseif ($Torrent['FreeTorrent'] == '2') {
$DisplayName .= ' Neutral Leech!';
} elseif ($Torrent['PersonalFL']) {
- $DisplayName .= 'Personal Freeleech!';
+ $DisplayName .= ' Personal Freeleech!';
}
+ $SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : '';
?>
-
+
|
diff --git a/sections/collages/collage.php b/sections/collages/collage.php
index f84b334c..782a889b 100644
--- a/sections/collages/collage.php
+++ b/sections/collages/collage.php
@@ -101,7 +101,7 @@ function compare($X, $Y){
$Number = 0;
foreach ($TorrentList as $GroupID=>$Group) {
- list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse, $Torrents, $GroupArtists, $ExtendedArtists) = array_values($Group);
+ list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse, $Torrents, $GroupArtists, $ExtendedArtists, $GroupFlags) = array_values($Group);
list($GroupID2, $Image, $GroupCategoryID, $UserID, $Username) = array_values($CollageDataList[$GroupID]);
// Handle stats and stuff
@@ -163,6 +163,7 @@ function compare($X, $Y){
$DisplayName .= ' '.$GroupName.'';
if($GroupYear>0) { $DisplayName = $DisplayName. ' ['. $GroupYear .']';}
if($GroupVanityHouse) { $DisplayName .= ' [ VH]'; }
+ $SnatchedGroupClass = $GroupFlags['IsSnatched'] ? ' snatched_group' : '';
// Start an output buffer, so we can store this output in $TorrentTable
ob_start();
@@ -170,7 +171,7 @@ function compare($X, $Y){
// Grouped torrents
$ShowGroups = !(!empty($LoggedUser['TorrentGrouping']) && $LoggedUser['TorrentGrouping'] == 1);
?>
-
+
@@ -199,6 +200,7 @@ function compare($X, $Y){
if ($Torrent['Remastered'] && !$Torrent['RemasterYear']) {
$FirstUnknown = !isset($FirstUnknown);
}
+ $SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : '';
if($Torrent['RemasterTitle'] != $LastRemasterTitle || $Torrent['RemasterYear'] != $LastRemasterYear ||
$Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber || $FirstUnknown || $Torrent['Media'] != $LastMedia) {
@@ -212,7 +214,7 @@ function compare($X, $Y){
$RemasterName .= $AddExtra.display_str($Torrent['Media']);
?>
-
+
− =$RemasterName?> |
@@ -227,7 +229,7 @@ function compare($X, $Y){
}
$MasterName .= $AddExtra.display_str($Torrent['Media']);
?>
-
+
− =$MasterName?> |
@@ -239,7 +241,7 @@ function compare($X, $Y){
$LastRemasterCatalogueNumber = $Torrent['RemasterCatalogueNumber'];
$LastMedia = $Torrent['Media'];
?>
-
+
[ DL
@@ -272,10 +274,11 @@ function compare($X, $Y){
} elseif ($Torrent['FreeTorrent'] == '2') {
$DisplayName .= ' Neutral Leech!';
} elseif ($Torrent['PersonalFL']) {
- $DisplayName .= 'Personal Freeleech!';
+ $DisplayName .= ' Personal Freeleech!';
}
+ $SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : '';
?>
-
+
|
diff --git a/sections/tools/index.php b/sections/tools/index.php
index a81ad6c4..1819355b 100644
--- a/sections/tools/index.php
+++ b/sections/tools/index.php
@@ -316,7 +316,6 @@
include('data/special_users.php');
break;
-
case 'browser_support':
include('data/browser_support.php');
break;
diff --git a/sections/top10/votes.php b/sections/top10/votes.php
index b52d0abf..41c7bef8 100644
--- a/sections/top10/votes.php
+++ b/sections/top10/votes.php
@@ -166,7 +166,7 @@
foreach ($TopVotes as $GroupID=>$Group) {
list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel,
$GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse,
- $Torrents, $GroupArtists, $ExtendedArtists, $GroupCategoryID,$Ups,$Total,$Score) = array_values($Group);
+ $Torrents, $GroupArtists, $ExtendedArtists, $GroupFlags, $GroupCategoryID,$Ups,$Total,$Score) = array_values($Group);
$IsBookmarked = in_array($GroupID, $Bookmarks);
@@ -200,9 +200,16 @@
ob_start();
if(count($Torrents)>1 || $GroupCategoryID==1) {
- // Grouped torrents
+ // Grouped torrents
+ $GroupSnatched = false;
+ foreach ($Torrents as &$Torrent) {
+ if (($Torrent['IsSnatched'] = Torrents::has_snatched($Torrent['ID'])) && !$GroupSnatched) {
+ $GroupSnatched = true;
+ }
+ }
+ $SnatchedGroupClass = $GroupSnatched ? ' snatched_group' : '';
?>
-
+
@@ -233,11 +240,10 @@
unset($FirstUnknown);
foreach ($Torrents as $TorrentID => $Torrent) {
-
- $Torrent['IsSnatched'] = Torrents::has_snatched($TorrentID);
if ($Torrent['Remastered'] && !$Torrent['RemasterYear']) {
$FirstUnknown = !isset($FirstUnknown);
}
+ $SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : '';
if($Torrent['RemasterTitle'] != $LastRemasterTitle || $Torrent['RemasterYear'] != $LastRemasterYear ||
$Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber || $FirstUnknown || $Torrent['Media'] != $LastMedia) {
@@ -251,7 +257,7 @@
$RemasterName .= $AddExtra.display_str($Torrent['Media']);
?>
-
+
− =$RemasterName?> |
@@ -266,7 +272,7 @@
}
$MasterName .= $AddExtra.display_str($Torrent['Media']);
?>
-
+
− =$MasterName?> |
@@ -278,7 +284,7 @@
$LastRemasterCatalogueNumber = $Torrent['RemasterCatalogueNumber'];
$LastMedia = $Torrent['Media'];
?>
-
+
[ DL
@@ -311,11 +317,11 @@
} elseif ($Torrent['FreeTorrent'] == '2') {
$DisplayName .= ' Neutral Leech!';
} elseif (Torrents::has_token($TorrentID)) {
- $DisplayName .= 'Personal Freeleech!';
+ $DisplayName .= ' Personal Freeleech!';
}
-
+ $SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : '';
?>
-
+
|
diff --git a/sections/torrents/browse2.php b/sections/torrents/browse2.php
index 9146a65f..8d3e16f8 100644
--- a/sections/torrents/browse2.php
+++ b/sections/torrents/browse2.php
@@ -923,6 +923,8 @@ function header_link($SortKey,$DefaultWay="desc") {
} else {
$DisplayName = '';
}
+ $SnatchedGroupClass = $GroupInfo['Flags']['IsSnatched'] ? ' snatched_group' : '';
+
if ($GroupResults && (count($Torrents)>1 || isset($GroupedCategories[$CategoryID-1]))) {
// These torrents are in a group
$DisplayName .= ' '.$GroupName.'';
@@ -934,7 +936,7 @@ function header_link($SortKey,$DefaultWay="desc") {
}
$DisplayName .= ' ['.$ReleaseTypes[$ReleaseType].']';
?>
-
+
$ShowGroups = !(!empty($LoggedUser['TorrentGrouping']) && $LoggedUser['TorrentGrouping'] == 1);
?>
@@ -986,6 +988,7 @@ function header_link($SortKey,$DefaultWay="desc") {
if ($Data['Remastered'] && !$Data['RemasterYear']) {
$FirstUnknown = !isset($FirstUnknown);
}
+ $SnatchedTorrentClass = $Data['IsSnatched'] ? ' snatched_torrent' : '';
if (isset($GroupedCategories[$CategoryID-1])
&& ($Data['RemasterTitle'] != $LastRemasterTitle
@@ -1006,7 +1009,7 @@ function header_link($SortKey,$DefaultWay="desc") {
$RemasterName .= $AddExtra.display_str($Data['Media']);
?>
-
+
− =$RemasterName?> |
@@ -1021,7 +1024,7 @@ function header_link($SortKey,$DefaultWay="desc") {
}
$MasterName .= $AddExtra.display_str($Data['Media']);
?>
-
+
− =$MasterName?> |
@@ -1033,7 +1036,7 @@ function header_link($SortKey,$DefaultWay="desc") {
$LastRemasterCatalogueNumber = $Data['RemasterCatalogueNumber'];
$LastMedia = $Data['Media'];
?>
-
+
[ =$Data['HasFile'] ? 'DL' : 'Missing'?>
@@ -1071,11 +1074,12 @@ function header_link($SortKey,$DefaultWay="desc") {
} else {
$ExtraInfo = '';
}
+ $SnatchedTorrentClass = $Data['IsSnatched'] ? ' snatched_torrent' : '';
?>
-
- if ($GroupResults) { ?>
+
+ if ($GroupResults) { ?>
|
- } ?>
+ } ?>
|
diff --git a/sections/torrents/details.php b/sections/torrents/details.php
index 631823ab..3e2afd1d 100644
--- a/sections/torrents/details.php
+++ b/sections/torrents/details.php
@@ -27,7 +27,7 @@ function compare($X, $Y){
list($WikiBody, $WikiImage, $GroupID, $GroupName, $GroupYear,
$GroupRecordLabel, $GroupCatalogueNumber, $ReleaseType, $GroupCategoryID,
$GroupTime, $GroupVanityHouse, $TorrentTags, $TorrentTagIDs, $TorrentTagUserIDs,
- $TagPositiveVotes, $TagNegativeVotes) = array_values($TorrentDetails);
+ $TagPositiveVotes, $TagNegativeVotes, $GroupFlags) = array_values($TorrentDetails);
$DisplayName=$GroupName;
$AltName=$GroupName; // Goes in the alt text of the image
@@ -368,7 +368,7 @@ function compare($X, $Y){
?>
-
+
Torrents |
Size |
@@ -531,7 +531,7 @@ function filelist($Str) {
$LastMedia = $Media;
?>
-
+
[ =$HasFile ? 'DL' : 'Missing'?>
if (Torrents::can_use_token($Torrent)) { ?>
diff --git a/sections/torrents/functions.php b/sections/torrents/functions.php
index 54b27594..30647450 100644
--- a/sections/torrents/functions.php
+++ b/sections/torrents/functions.php
@@ -122,8 +122,11 @@ function get_group_info($GroupID, $Return = true, $RevisionID = 0) {
$TorrentList = $TorrentCache[1];
}
- // Fetch all user specific torrent properties
- array_walk($TorrentList, 'Torrents::torrent_properties');
+ // Fetch all user specific torrent and group properties
+ $TorrentDetails['Flags'] = array('IsSnatched' => false);
+ foreach ($TorrentList as &$Torrent) {
+ Torrents::torrent_properties($Torrent, $TorrentDetails['Flags']);
+ }
if ($Return) {
return array($TorrentDetails, $TorrentList);
diff --git a/sections/torrents/notify.php b/sections/torrents/notify.php
index cd3f62a9..a362d3f1 100644
--- a/sections/torrents/notify.php
+++ b/sections/torrents/notify.php
@@ -262,7 +262,7 @@ function header_link($SortKey, $DefaultWay = "desc") {
// print row
?>
- >
+ >
|
|
diff --git a/sections/torrents/user.php b/sections/torrents/user.php
index 6df41fd2..26ef8f25 100644
--- a/sections/torrents/user.php
+++ b/sections/torrents/user.php
@@ -425,10 +425,9 @@ function header_link($SortKey,$DefaultWay="DESC") {
foreach($TorrentsInfo as $TorrentID=>$Info) {
list($GroupID,, $Time, $CategoryID) = array_values($Info);
- list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists, $ExtendedArtists) = array_values($Results[$GroupID]);
+ list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists, $ExtendedArtists, $GroupFlags) = array_values($Results[$GroupID]);
$Torrent = $Torrents[$TorrentID];
-
$TagList = explode(' ',str_replace('_','.',$TagList));
$TorrentTags = array();
@@ -454,10 +453,8 @@ function header_link($SortKey,$DefaultWay="DESC") {
if($ExtraInfo) {
$DisplayName.=' - '.$ExtraInfo;
}
-
-
?>
- |
+
|
diff --git a/sections/userhistory/subscribed_collages.php b/sections/userhistory/subscribed_collages.php
index e91fda19..9abeb68b 100644
--- a/sections/userhistory/subscribed_collages.php
+++ b/sections/userhistory/subscribed_collages.php
@@ -105,7 +105,7 @@
// $DisplayName = Artists::display_artists($Artists[$GroupID]);
// $AltName=$GroupName;
foreach ($TorrentList as $GroupID => $Group) {
- list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse, $Torrents, $GroupArtists, $ExtendedArtists) = array_values($Group);
+ list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse, $Torrents, $GroupArtists, $ExtendedArtists, $GroupFlags) = array_values($Group);
list($GroupID2, $Image, $GroupCategoryID) = array_values($CollageDataList[$GroupID]);
unset($DisplayName);
@@ -135,12 +135,14 @@
$DisplayName .= ''.$GroupName.'';
if($GroupYear>0) { $DisplayName = $DisplayName. ' ['. $GroupYear .']';}
if($GroupVanityHouse) { $DisplayName .= ' [VH]'; }
+
+ $SnatchedGroupClass = $GroupFlags['IsSnatched'] ? ' snatched_group' : '';
// Start an output buffer, so we can store this output in $TorrentTable
ob_start();
if(count($Torrents)>1 || $GroupCategoryID==1) {
?>
-
+
@@ -179,6 +181,7 @@
if ($Torrent['Remastered'] && !$Torrent['RemasterYear']) {
$FirstUnknown = !isset($FirstUnknown);
}
+ $SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : '';
if($Torrent['RemasterTitle'] != $LastRemasterTitle || $Torrent['RemasterYear'] != $LastRemasterYear ||
$Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber || $FirstUnknown || $Torrent['Media'] != $LastMedia) {
@@ -194,7 +197,7 @@
$RemasterName .= $AddExtra.display_str($Torrent['Media']);
?>
-
+
− =$RemasterName?> |
@@ -209,7 +212,7 @@
}
$MasterName .= $AddExtra.display_str($Torrent['Media']);
?>
-
+
− =$MasterName?> |
@@ -221,7 +224,7 @@
$LastRemasterCatalogueNumber = $Torrent['RemasterCatalogueNumber'];
$LastMedia = $Torrent['Media'];
?>
-
+
[ DL ]
@@ -242,14 +245,15 @@
$DisplayName = ''.$GroupName.'';
- if(!$Torrent['IsSnatched']) {
+ if($Torrent['IsSnatched']) {
$DisplayName .=' Snatched!';
}
if(!empty($Torrent['FreeTorrent'])) {
$DisplayName .=' Freeleech!';
}
+ $SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : '';
?>
-
+
|
| | | | | | | | | | | | | | | | |