$Err = "You seem to have put something other than an EAC or XLD log file into an upload field. (".$FileType.")"; break; } } */ } //Multiple artists! $LogName = ''; if (empty($Properties['GroupID']) && empty($ArtistForm) && $Type == 'Music') { $MainArtistCount = 0; $ArtistNames = array(); $ArtistForm = array(1 => array(), 2 => array(), 3 => array(), 4 => array(), 5 => array(), 6 => array()); for ($i = 0, $il = count($Artists); $i < $il; $i++) { if (trim($Artists[$i]) != '') { if (!in_array($Artists[$i], trim($ArtistNames))) { $ArtistForm[$Importance[$i]][] = array('name' => Artists::normalise_artist_name($Artists[$i])); if ($Importance[$i] == 1) { $MainArtistCount++; } $ArtistNames[] = trim($Artists[$i]); } } } if ($MainArtistCount < 1) { $Err = 'Please enter at least one main artist'; $ArtistForm = array(); } $LogName .= Artists::display_artists($ArtistForm, false, true, false); } elseif ($Type == 'Music' && empty($ArtistForm)) { $DB->query("\n\t\tSELECT ta.ArtistID, aa.Name, ta.Importance\n\t\tFROM torrents_artists AS ta\n\t\t\tJOIN artists_alias AS aa ON ta.AliasID = aa.AliasID\n\t\tWHERE ta.GroupID = " . $Properties['GroupID'] . "\n\t\tORDER BY ta.Importance ASC, aa.Name ASC;"); while (list($ArtistID, $ArtistName, $ArtistImportance) = $DB->next_record(MYSQLI_BOTH, false)) {
authorize(); $UserID = $LoggedUser['ID']; $GroupID = db_string($_POST['groupid']); $Importances = $_POST['importance']; $AliasNames = $_POST['aliasname']; if (!is_number($GroupID) || !$GroupID) { error(0); } $DB->query("\n\tSELECT Name\n\tFROM torrents_group\n\tWHERE ID = {$GroupID}"); if (!$DB->has_results()) { error(404); } list($GroupName) = $DB->next_record(MYSQLI_NUM, false); $Changed = false; for ($i = 0; $i < count($AliasNames); $i++) { $AliasName = Artists::normalise_artist_name($AliasNames[$i]); $Importance = $Importances[$i]; if ($Importance != '1' && $Importance != '2' && $Importance != '3' && $Importance != '4' && $Importance != '5' && $Importance != '6' && $Importance != '7') { break; } if (strlen($AliasName) > 0) { $DB->query("\n\t\t\tSELECT AliasID, ArtistID, Redirect, Name\n\t\t\tFROM artists_alias\n\t\t\tWHERE Name = '" . db_string($AliasName) . "'"); while (list($AliasID, $ArtistID, $Redirect, $FoundAliasName) = $DB->next_record(MYSQLI_NUM, false)) { if (!strcasecmp($AliasName, $FoundAliasName)) { if ($Redirect) { $AliasID = $Redirect; } break; } } if (!$AliasID) {
<?php authorize(); if (!check_perms('torrents_edit')) { error(403); } $ArtistID = $_POST['artistid']; $Redirect = $_POST['redirect']; $AliasName = Artists::normalise_artist_name($_POST['name']); $DBAliasName = db_string($AliasName); if (!$Redirect) { $Redirect = 0; } if (!is_number($ArtistID) || !($Redirect === 0 || is_number($Redirect)) || !$ArtistID) { error(0); } if ($AliasName == '') { error('Blank artist name.'); } /* * In the case of foo, who released an album before changing his name to bar and releasing another * the field shared to make them appear on the same artist page is the ArtistID * 1. For a normal artist, there'll be one entry, with the ArtistID, the same name as the artist and a 0 redirect * 2. For Celine Dion (C�line Dion), there's two, same ArtistID, diff Names, one has a redirect to the alias of the first * 3. For foo, there's two, same ArtistID, diff names, no redirect */ $DB->query("\n\tSELECT AliasID, ArtistID, Name, Redirect\n\tFROM artists_alias\n\tWHERE Name = '{$DBAliasName}'"); if ($DB->has_results()) { while (list($CloneAliasID, $CloneArtistID, $CloneAliasName, $CloneRedirect) = $DB->next_record(MYSQLI_NUM, false)) { if (!strcasecmp($CloneAliasName, $AliasName)) { break;