get_value("artist_$ArtistID"."_revision_$RevisionID", true); } else { // viewing the live version $Data = $Cache->get_value('artist_'.$ArtistID, true); $RevisionID = false; } if($Data) { if (!is_array($Data)) { $Data = unserialize($Data); } list($K, list($Name, $Image, $Body, $NumSimilar, $SimilarArray, , , $VanityHouseArtist)) = each($Data); } else { if ($RevisionID) { $sql = "SELECT a.Name, wiki.Image, wiki.body, a.VanityHouse FROM wiki_artists AS wiki LEFT JOIN artists_group AS a ON wiki.RevisionID=a.RevisionID WHERE wiki.RevisionID='$RevisionID' "; } else { $sql = "SELECT a.Name, wiki.Image, wiki.body, a.VanityHouse FROM artists_group AS a LEFT JOIN wiki_artists AS wiki ON wiki.RevisionID=a.RevisionID WHERE a.ArtistID='$ArtistID' "; } $sql .= " GROUP BY a.ArtistID"; $DB->query($sql); if($DB->record_count()==0) { error(404); } list($Name, $Image, $Body, $VanityHouseArtist) = $DB->next_record(MYSQLI_NUM, array(0)); } //----------------- Build list and get stats ob_start(); // Requests $Requests = $Cache->get_value('artists_requests_'.$ArtistID); if(!is_array($Requests)) { $DB->query("SELECT r.ID, r.CategoryID, r.Title, r.Year, r.TimeAdded, COUNT(rv.UserID) AS Votes, SUM(rv.Bounty) AS Bounty FROM requests AS r LEFT JOIN requests_votes AS rv ON rv.RequestID=r.ID LEFT JOIN requests_artists AS ra ON r.ID=ra.RequestID WHERE ra.ArtistID = ".$ArtistID." AND r.TorrentID = 0 GROUP BY r.ID ORDER BY Votes DESC"); if($DB->record_count() > 0) { $Requests = $DB->to_array(); } else { $Requests = array(); } $Cache->cache_value('artists_requests_'.$ArtistID, $Requests); } $NumRequests = count($Requests); if (($Importances = $Cache->get_value('artist_groups_'.$ArtistID)) === false) { $DB->query("SELECT DISTINCTROW ta.GroupID, ta.Importance, tg.VanityHouse, tg.Year FROM torrents_artists AS ta JOIN torrents_group AS tg ON tg.ID=ta.GroupID WHERE ta.ArtistID='$ArtistID' ORDER BY tg.Year DESC, tg.Name DESC"); $GroupIDs = $DB->collect('GroupID'); $Importances = $DB->to_array(false, MYSQLI_BOTH, false); $Cache->cache_value('artist_groups_'.$ArtistID, $Importances, 0); } else { $GroupIDs = array(); foreach ($Importances as $Group) { $GroupIDs[] = $Group['GroupID']; } } if (count($GroupIDs) > 0) { $TorrentList = Torrents::get_groups($GroupIDs, true,true); $TorrentList = $TorrentList['matches']; } else { $TorrentList = array(); } $NumGroups = count($TorrentList); if (!empty($TorrentList)) { ?>
$Group) { switch ($Importances[$ID]['Importance']) { case '2': $Importances[$ID]['ReleaseType'] = 1024; //$TorrentList[$GroupID]['ReleaseType'] = 1024; $GuestAlbums = true; break; case '3': $Importances[$ID]['ReleaseType'] = 1023; //$TorrentList[$GroupID]['ReleaseType'] = 1023; $RemixerAlbums = true; break; case '4': $Importances[$ID]['ReleaseType'] = 1022; //$TorrentList[$GroupID]['ReleaseType'] = 1022; $ComposerAlbums = true; break; case '7': $Importances[$ID]['ReleaseType'] = 1021; //$TorrentList[$GroupID]['ReleaseType'] = 1021; $ProducerAlbums = true; break; default: $Importances[$ID]['ReleaseType'] = $TorrentList[$Group['GroupID']]['ReleaseType']; } if (!isset($UsedReleases[$Importances[$ID]['ReleaseType']])) { $UsedReleases[$Importances[$ID]['ReleaseType']] = true; } $Importances[$ID]['Sort'] = $ID; } if (!empty($GuestAlbums)) { $ReleaseTypes[1024] = "Guest Appearance"; } if (!empty($RemixerAlbums)) { $ReleaseTypes[1023] = "Remixed By"; } if (!empty($ComposerAlbums)) { $ReleaseTypes[1022] = "Composition"; } if (!empty($ProducerAlbums)) { $ReleaseTypes[1021] = "Produced By"; } //Custom sorting for releases if (!empty($LoggedUser['SortHide'])) { $SortOrder = array_flip(array_keys($LoggedUser['SortHide'])); } else { $SortOrder = $ReleaseTypes; } // If the $SortOrder array doesn't have all release types, put the missing ones at the end if (count($SortOrder) != count($ReleaseTypes)) { $MaxOrder = max($SortOrder); foreach (array_keys(array_diff_key($ReleaseTypes, $SortOrder)) as $Missing) { $SortOrder[$Missing] = ++$MaxOrder; } } uasort($Importances, function ($A, $B) use ($SortOrder) { if ($SortOrder[$A['ReleaseType']] == $SortOrder[$B['ReleaseType']]) { return $A['Sort'] < $B['Sort'] ? -1 : 1; } return $SortOrder[$A['ReleaseType']] < $SortOrder[$B['ReleaseType']] ? -1 : 1; }); // Sort the anchors at the top of the page the same way as release types $UsedReleases = array_flip(array_intersect_key($SortOrder, $UsedReleases)); reset($TorrentList); if (!empty($UsedReleases)) { ?>
">[] 0) { ?> [Requests]
$Group) { $TagList = explode(' ',str_replace('_','.',$Group['TagList'])); $TorrentTags = array(); // $Tags array is for the sidebar on the right. Skip compilations and soundtracks. if ($Group['ReleaseType'] != 7 && $Group['ReleaseType'] != 3) { foreach($TagList as $Tag) { if(!isset($Tags[$Tag])) { $Tags[$Tag] = array('name'=>$Tag, 'count'=>1); } else { $Tags[$Tag]['count']++; } } } $TorrentTags = implode(', ', $TorrentTags); $TorrentTags = '
'.$TorrentTags.'
'; foreach ($Group['Torrents'] as $TorrentID => $Torrent) { $NumTorrents++; $Torrent['Seeders'] = (int)$Torrent['Seeders']; $Torrent['Leechers'] = (int)$Torrent['Leechers']; $Torrent['Snatched'] = (int)$Torrent['Snatched']; $NumSeeders+=$Torrent['Seeders']; $NumLeechers+=$Torrent['Leechers']; $NumSnatches+=$Torrent['Snatched']; } } $OpenTable = false; $ShowGroups = !isset($LoggedUser['TorrentGrouping']) || $LoggedUser['TorrentGrouping'] == 0; $HideTorrents = ($ShowGroups ? '' : ' hidden'); $OldGroupID = 0; $ReleaseType = 0; $LastReleaseType = 0; foreach ($Importances as $Group) { list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists, $ExtendedArtists, $GroupFlags) = array_values($TorrentList[$Group['GroupID']]); $ReleaseType = $Group['ReleaseType']; $GroupVanityHouse = $Group['VanityHouse']; if ($GroupID == $OldGroupID && $ReleaseType == $OldReleaseType) { continue; } else { $OldGroupID = $GroupID; $OldReleaseType = $ReleaseType; } /* if (!empty($LoggedUser['DiscogView']) || (isset($LoggedUser['HideTypes']) && in_array($ReleaseType, $LoggedUser['HideTypes']))) { $HideDiscog = ' hidden'; } else { $HideDiscog = ''; } */ if (!empty($LoggedUser['DiscogView']) || (isset($LoggedUser['SortHide']) && array_key_exists($ReleaseType, $LoggedUser['SortHide']) && $LoggedUser['SortHide'][$ReleaseType] == 1)) { $HideDiscog = ' hidden'; } else { $HideDiscog = ''; } $TagList = explode(' ',str_replace('_','.',$TagList)); $TorrentTags = array(); // $Tags array is for the sidebar on the right. Skip compilations and soundtracks. foreach($TagList as $Tag) { $TorrentTags[] = ''.$Tag.''; } $TorrentTags = implode(', ', $TorrentTags); $TorrentTags = '
'.$TorrentTags.'
'; if($ReleaseType!=$LastReleaseType) { switch($ReleaseTypes[$ReleaseType]) { case "Remix" : $DisplayName = "Remixes"; break; case "Anthology" : $DisplayName = "Anthologies"; break; case "DJ Mix" : $DisplayName = "DJ Mixes"; break; default : $DisplayName = $ReleaseTypes[$ReleaseType]."s"; break; } $ReleaseTypeLabel = strtolower(str_replace(' ','_',$ReleaseTypes[$ReleaseType])); if($OpenTable) { ?> '.$GroupName.''; if(check_perms('users_mod') || check_perms('torrents_fix_ghosts')) { $DisplayName .= ' [Fix]'; } switch($ReleaseType){ case 1023: // Remixes, DJ Mixes, Guest artists, and Producers need the artist name case 1024: case 1021: case 8: if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) { unset($ExtendedArtists[2]); unset($ExtendedArtists[3]); $DisplayName = Artists::display_artists($ExtendedArtists).$DisplayName; } elseif(count($GroupArtists)>0) { $DisplayName = Artists::display_artists(array(1 => $Artists), true, true).$DisplayName; } break; case 1022: // Show performers on composer pages if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5])) { unset($ExtendedArtists[4]); unset($ExtendedArtists[3]); unset($ExtendedArtists[6]); $DisplayName = Artists::display_artists($ExtendedArtists).$DisplayName; } elseif(count($GroupArtists)>0) { $DisplayName = Artists::display_artists(array(1 => $Artists), true, true).$DisplayName; } break; default: // Show composers otherwise if (!empty($ExtendedArtists[4])) { $DisplayName = Artists::display_artists(array(4 => $ExtendedArtists[4]), true, true).$DisplayName; } } if($GroupYear>0) { $DisplayName = $GroupYear. ' - '.$DisplayName; } if($GroupVanityHouse) { $DisplayName .= ' [VH]'; } $SnatchedGroupClass = $GroupFlags['IsSnatched'] ? ' snatched_group' : ''; ?> $Torrent) { 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) { $EditionID++; if($Torrent['Remastered'] && $Torrent['RemasterYear'] != 0) { $RemasterName = $Torrent['RemasterYear']; $AddExtra = " - "; if($Torrent['RemasterRecordLabel']) { $RemasterName .= $AddExtra.display_str($Torrent['RemasterRecordLabel']); $AddExtra=' / '; } if($Torrent['RemasterCatalogueNumber']) { $RemasterName .= $AddExtra.display_str($Torrent['RemasterCatalogueNumber']); $AddExtra=' / '; } if($Torrent['RemasterTitle']) { $RemasterName .= $AddExtra.display_str($Torrent['RemasterTitle']); $AddExtra=' / '; } $RemasterName .= $AddExtra.display_str($Torrent['Media']); ?> >
  (View) Size Snatches Seeders Leechers
[ | FL ]   » 

(Revision #) [Vanity House]

0) { ?> ".$Title." [".$Year."]"; } else if($CategoryName == "Audiobooks" || $CategoryName == "Comedy") { $FullName = "".$Title." [".$Year."]"; } else { $FullName ="".$Title.""; } $Row = ($Row == 'a') ? 'b' : 'a'; $Tags = get_request_tags($RequestID); ?>
  Request Name Vote Bounty Added
$TagName) { $TagList[] = "".display_str($TagName).""; } $TagList = implode(', ', $TagList); ?>
   (+)
0) { if($SimilarData = $Cache->get_value('similar_positions_'.$ArtistID)) { $Similar = new ARTISTS_SIMILAR($ArtistID, $Name); $Similar->load_data($SimilarData); if(!(current($Similar->Artists)->NameLength)) { unset($Similar); } } if(empty($Similar) || empty($Similar->Artists)) { include(SERVER_ROOT.'/classes/class_image.php'); $Img = new IMAGE; $Img->create(WIDTH, HEIGHT); $Img->color(255,255,255, 127); $Similar = new ARTISTS_SIMILAR($ArtistID, $Name); $Similar->set_up(); $Similar->set_positions(); $Similar->background_image(); $SimilarData = $Similar->dump_data(); $Cache->cache_value('similar_positions_'.$ArtistID, $SimilarData, 3600*24); } ?>
  Similar Artist Map [Switch to Cloud]
write_artists(); ?>
0 ?>
  Artist info [Toggle]
full_format($Body)?>
get_value('artist_comments_'.$ArtistID); if($Results === false) { $DB->query("SELECT COUNT(c.ID) FROM artist_comments as c WHERE c.ArtistID = '$ArtistID'"); list($Results) = $DB->next_record(); $Cache->cache_value('artist_comments_'.$ArtistID, $Results, 0); } if(isset($_GET['postid']) && is_number($_GET['postid']) && $Results > TORRENT_COMMENTS_PER_PAGE) { $DB->query("SELECT COUNT(ID) FROM artist_comments WHERE ArtistID = $ArtistID AND ID <= $_GET[postid]"); list($PostNum) = $DB->next_record(); list($Page,$Limit) = Format::page_limit(TORRENT_COMMENTS_PER_PAGE,$PostNum); } else { list($Page,$Limit) = Format::page_limit(TORRENT_COMMENTS_PER_PAGE,$Results); } //Get the cache catalogue $CatalogueID = floor((TORRENT_COMMENTS_PER_PAGE*$Page-TORRENT_COMMENTS_PER_PAGE)/THREAD_CATALOGUE); $CatalogueLimit=$CatalogueID*THREAD_CATALOGUE . ', ' . THREAD_CATALOGUE; //---------- Get some data to start processing // Cache catalogue from which the page is selected, allows block caches and future ability to specify posts per page $Catalogue = $Cache->get_value('artist_comments_'.$ArtistID.'_catalogue_'.$CatalogueID); if($Catalogue === false) { $DB->query("SELECT c.ID, c.AuthorID, c.AddedTime, c.Body, c.EditedUserID, c.EditedTime, u.Username FROM artist_comments as c LEFT JOIN users_main AS u ON u.ID=c.EditedUserID WHERE c.ArtistID = '$ArtistID' ORDER BY c.ID LIMIT $CatalogueLimit"); $Catalogue = $DB->to_array(false,MYSQLI_ASSOC); $Cache->cache_value('artist_comments_'.$ArtistID.'_catalogue_'.$CatalogueID, $Catalogue, 0); } //This is a hybrid to reduce the catalogue down to the page elements: We use the page limit % catalogue $Thread = array_slice($Catalogue,((TORRENT_COMMENTS_PER_PAGE*$Page-TORRENT_COMMENTS_PER_PAGE)%THREAD_CATALOGUE),TORRENT_COMMENTS_PER_PAGE,true); ?> $Post) { list($PostID, $AuthorID, $AddedTime, $CommentBody, $EditedUserID, $EditedTime, $EditedUsername) = array_values($Post); list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(Users::user_info($AuthorID)); ?>
[Report] = $AuthorInfo['Class']) { ?> - [Warn]  
full_format($CommentBody)?>

« Last edited by

Post reply


cache_value($Key, $Data, 3600); ?>