diff --git a/classes/class_torrent_form.php b/classes/class_torrent_form.php index 59c8cea7..9d882858 100644 --- a/classes/class_torrent_form.php +++ b/classes/class_torrent_form.php @@ -226,6 +226,7 @@ function music_form($GenreTags) { + [+] [-] collect('GroupID'); $Importances = $DB->to_array('GroupID', MYSQLI_BOTH, false); @@ -137,6 +138,14 @@ function compare($X, $Y){ $TorrentList[$GroupID]['ReleaseType'] = 1023; $RemixerAlbums = true; } + if($Importances[$GroupID]['Importance'] == '4') { + $TorrentList[$GroupID]['ReleaseType'] = 1022; + $ComposerAlbums = true; + } + if($Importances[$GroupID]['Importance'] == '7') { + $TorrentList[$GroupID]['ReleaseType'] = 1021; + $ProducerAlbums = true; + } if(!in_array($TorrentList[$GroupID]['ReleaseType'], $UsedReleases)) { $UsedReleases[] = $TorrentList[$GroupID]['ReleaseType']; } @@ -148,13 +157,18 @@ function compare($X, $Y){ if(!empty($RemixerAlbums)) { $ReleaseTypes[1023] = "Remixed By"; } - +if(!empty($ComposerAlbums)) { + $ReleaseTypes[1022] = "Composition"; +} +if(!empty($ProducerAlbums)) { + $ReleaseTypes[1021] = "Produced By"; +} reset($TorrentList); $JsonTorrents = array(); foreach ($TorrentList as $GroupID=>$Group) { - list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists) = array_values($Group); + list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists, $ExtendedArtists) = array_values($Group); $GroupVanityHouse = $Importances[$GroupID]['VanityHouse']; $TagList = explode(' ',str_replace('_','.',$TagList)); @@ -175,8 +189,33 @@ function compare($X, $Y){ $DisplayName .= ' [Fix]'; } - if (($ReleaseType == 1023) || ($ReleaseType == 1024)) { - $DisplayName = display_artists(array(1 => $Artists), true, true).$DisplayName; + 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 = display_artists($ExtendedArtists).$DisplayName; + } elseif(count($GroupArtists)>0) { + $DisplayName = 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 = display_artists($ExtendedArtists).$DisplayName; + } elseif(count($GroupArtists)>0) { + $DisplayName = display_artists(array(1 => $Artists), true, true).$DisplayName; + } + break; + default: // Show composers otherwise + if (!empty($ExtendedArtists[4])) { + $DisplayName = display_artists(array(4 => $ExtendedArtists[4]), true, true).$DisplayName; + } } if($GroupYear>0) { $DisplayName = $GroupYear. ' - '.$DisplayName; } diff --git a/sections/ajax/request.php b/sections/ajax/request.php index 626bb912..37810378 100644 --- a/sections/ajax/request.php +++ b/sections/ajax/request.php @@ -115,7 +115,8 @@ 'artists' => $ArtistForm[1] == null ? array() : pullmediainfo($ArtistForm[1]), 'with' => $ArtistForm[2] == null ? array() : pullmediainfo($ArtistForm[2]), 'conductor' => $ArtistForm[5] == null ? array() : pullmediainfo($ArtistForm[5]), - 'remixedBy' => $ArtistForm[3] == null ? array() : pullmediainfo($ArtistForm[3]) + 'remixedBy' => $ArtistForm[3] == null ? array() : pullmediainfo($ArtistForm[3]), + 'producer' => $ArtistForm[7] == null ? array() : pullmediainfo($ArtistForm[7]) ); } diff --git a/sections/ajax/torrentgroup.php b/sections/ajax/torrentgroup.php index 1b89fd6d..b44b6588 100644 --- a/sections/ajax/torrentgroup.php +++ b/sections/ajax/torrentgroup.php @@ -32,6 +32,7 @@ function filter_by_key($input, $keys) { return array_intersect_key($input, array 'categoryId' => (int) $TorrentDetails['CategoryID'], 'time' => $TorrentDetails['Time'], 'vanityHouse' => $TorrentDetails['VanityHouse'] == 1, + 'artists' => get_artist($GroupID), ); $TorrentList = array(); foreach ($TorrentCache[1] as $Torrent) { diff --git a/sections/artist/artist.php b/sections/artist/artist.php index bc10e9f5..5358512e 100644 --- a/sections/artist/artist.php +++ b/sections/artist/artist.php @@ -106,7 +106,7 @@ function compare($X, $Y){ FROM torrents_artists AS ta JOIN torrents_group AS tg ON tg.ID=ta.GroupID WHERE ta.ArtistID='$ArtistID' - ORDER BY IF(ta.Importance = '2' OR ta.Importance = '3' OR ta.Importance = '4',ta.Importance, 1), + ORDER BY IF(ta.Importance IN ('2', '3', '4', '7'),ta.Importance, 1), tg.ReleaseType ASC, tg.Year DESC, tg.Name DESC"); $GroupIDs = $DB->collect('GroupID'); @@ -141,6 +141,10 @@ function compare($X, $Y){ $TorrentList[$GroupID]['ReleaseType'] = 1022; $ComposerAlbums = true; } + if($Importances[$GroupID]['Importance'] == '7') { + $TorrentList[$GroupID]['ReleaseType'] = 1021; + $ProducerAlbums = true; + } if(!in_array($TorrentList[$GroupID]['ReleaseType'], $UsedReleases)) { $UsedReleases[] = $TorrentList[$GroupID]['ReleaseType']; } @@ -155,6 +159,9 @@ function compare($X, $Y){ if(!empty($ComposerAlbums)) { $ReleaseTypes[1022] = "Composition"; } +if(!empty($ProducerAlbums)) { + $ReleaseTypes[1021] = "Produced By"; +} reset($TorrentList); @@ -270,8 +277,9 @@ function compare($X, $Y){ switch($ReleaseType){ - case 1023: // Remixes, DJ Mixes, and Guest artists need the artist name + 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]); diff --git a/sections/requests/new_edit.php b/sections/requests/new_edit.php index 37c3bb3e..34b1f3a1 100644 --- a/sections/requests/new_edit.php +++ b/sections/requests/new_edit.php @@ -168,6 +168,7 @@ + [+] [-]
diff --git a/sections/requests/request.php b/sections/requests/request.php index 96f835ab..bdb25955 100644 --- a/sections/requests/request.php +++ b/sections/requests/request.php @@ -175,6 +175,17 @@ ?>
  • Remixed by:
  • +
  • + +
  • + 0) { +?> +
  • Produced by:
  • +
  • diff --git a/sections/torrents/add_alias.php b/sections/torrents/add_alias.php index 506ded3c..227f55de 100644 --- a/sections/torrents/add_alias.php +++ b/sections/torrents/add_alias.php @@ -16,7 +16,7 @@ $AliasName = normalise_artist_name($AliasNames[$i]); $Importance = $Importances[$i]; - if($Importance!='1' && $Importance!='2' && $Importance!='3' && $Importance!='4' && $Importance!='5' && $Importance!='6') { + if($Importance!='1' && $Importance!='2' && $Importance!='3' && $Importance!='4' && $Importance!='5' && $Importance!='6' && $Importance!='7') { break; } diff --git a/sections/torrents/details.php b/sections/torrents/details.php index dcfd8693..dfad885a 100644 --- a/sections/torrents/details.php +++ b/sections/torrents/details.php @@ -252,6 +252,26 @@ function compare($X, $Y){ [X]
  • + 0) { + print '
  • Produced By:
  • '; + foreach($Artists[7] as $Artist) { +?> +
  • + +query("SELECT AliasID FROM artists_alias WHERE ArtistID = ".$Artist['id']." AND ArtistID != AliasID AND Name = '".db_string($Artist['name'])."'"); + list($AliasID) = $DB->next_record(); + if (empty($AliasID)) { + $AliasID = $Artist['id']; + } +?> +  ()  + [X] + +
  • Conductor + diff --git a/static/functions/browse.js b/static/functions/browse.js index c53a08ff..caa33666 100644 --- a/static/functions/browse.js +++ b/static/functions/browse.js @@ -176,7 +176,7 @@ function AddArtistField() { x.appendChild(document.createTextNode(' ')); var Importance = document.createElement("select"); Importance.name = "importance[]"; - Importance.innerHTML = ''; + Importance.innerHTML = ''; x.appendChild(Importance); ArtistFieldCount++; } diff --git a/static/functions/requests.js b/static/functions/requests.js index a02d3657..ec7d1826 100644 --- a/static/functions/requests.js +++ b/static/functions/requests.js @@ -84,6 +84,7 @@ function AddArtistField() { ImportanceField.options[3] = new Option("Conductor", "5"); ImportanceField.options[4] = new Option("DJ / Compiler", "6"); ImportanceField.options[5] = new Option("Remixer", "3"); + ImportanceField.options[6] = new Option("Producer", "7"); var x = $('#artistfields').raw(); x.appendChild(document.createElement("br")); diff --git a/static/functions/torrent.js b/static/functions/torrent.js index 0c804d34..1005d422 100644 --- a/static/functions/torrent.js +++ b/static/functions/torrent.js @@ -54,6 +54,9 @@ function ArtistManager() { case 'artists_dj': importance = 6; break; + case 'artists_producer': + importance = 7; + break; } if(elArtistList.children[i].children[0].tagName.toUpperCase() == 'A') { var ArtistID = elArtistList.children[i].children[0].href.match(/[?&]id=(\d+)/)[1]; @@ -129,6 +132,10 @@ function ArtistManager() { elOpt.value = 3; elOpt.innerHTML = 'Remixer'; elImportance.appendChild(elOpt); + elOpt = document.createElement('option'); + elOpt.value = 7; + elOpt.innerHTML = 'Producer'; + elImportance.appendChild(elOpt); elSubmitDiv.appendChild(elImportance); elSubmitDiv.appendChild(document.createTextNode(' ')); diff --git a/static/functions/upload.js b/static/functions/upload.js index c062e15b..c0722869 100644 --- a/static/functions/upload.js +++ b/static/functions/upload.js @@ -195,6 +195,7 @@ function AddArtistField() { ImportanceField.options[3] = new Option("Conductor", "5"); ImportanceField.options[4] = new Option("DJ / Compiler", "6"); ImportanceField.options[5] = new Option("Remixer", "3"); + ImportanceField.options[6] = new Option("Producer", "7"); var x = $('#artistfields').raw(); x.appendChild(document.createElement("br"));