2011-03-28 14:21:28 +00:00
< ?
/************************************************************************
||------------|| Edit artist wiki page ||------------------------------||
2013-02-22 08:00:24 +00:00
This page is the page that is displayed when someone feels like editing
2011-03-28 14:21:28 +00:00
an artist ' s wiki page .
2013-02-22 08:00:24 +00:00
It is called when $_GET [ 'action' ] == 'edit' . $_GET [ 'artistid' ] is the
2011-03-28 14:21:28 +00:00
ID of the artist , and must be set .
************************************************************************/
$ArtistID = $_GET [ 'artistid' ];
2013-05-05 08:00:31 +00:00
if ( ! is_number ( $ArtistID )) {
error ( 0 );
}
2011-03-28 14:21:28 +00:00
// Get the artist name and the body of the last revision
2013-05-05 08:00:31 +00:00
$DB -> query ( "
SELECT
Name ,
Image ,
Body ,
VanityHouse
2011-03-28 14:21:28 +00:00
FROM artists_group AS a
2013-05-05 08:00:31 +00:00
LEFT JOIN wiki_artists ON wiki_artists . RevisionID = a . RevisionID
2011-03-28 14:21:28 +00:00
WHERE a . ArtistID = '$ArtistID' " );
2013-05-05 08:00:31 +00:00
if ( $DB -> record_count () < 1 ) {
2011-03-28 14:21:28 +00:00
error ( " Cannot find the artist with the ID " . $ArtistID . ': See the <a href="log.php?search=Artist+' . $ArtistID . '">log</a>.' );
}
2011-08-09 21:03:28 +00:00
list ( $Name , $Image , $Body , $VanityHouse ) = $DB -> next_record ( MYSQLI_NUM , true );
2011-03-28 14:21:28 +00:00
// Start printing form
2012-10-11 08:00:15 +00:00
View :: show_header ( 'Edit artist' );
2011-03-28 14:21:28 +00:00
?>
< div class = " thin " >
2012-08-19 08:00:19 +00:00
< div class = " header " >
< h2 > Edit < a href = " artist.php?id=<?= $ArtistID ?> " >< ? = $Name ?> </a></h2>
</ div >
2011-03-28 14:21:28 +00:00
< div class = " box pad " >
2012-09-15 08:00:25 +00:00
< form class = " edit_form " name = " artist " action = " artist.php " method = " post " >
2011-03-28 14:21:28 +00:00
< input type = " hidden " name = " action " value = " edit " />
< input type = " hidden " name = " auth " value = " <?= $LoggedUser['AuthKey'] ?> " />
< input type = " hidden " name = " artistid " value = " <?= $ArtistID ?> " />
< div >
< h3 > Image </ h3 >
< input type = " text " name = " image " size = " 92 " value = " <?= $Image ?> " />< br />
< h3 > Artist info </ h3 >
< textarea name = " body " cols = " 91 " rows = " 20 " >< ? = $Body ?> </textarea> <br />
2013-05-05 08:00:31 +00:00
< h3 > Vanity House < input type = " checkbox " name = " vanity_house " value = " 1 " < ? = ( check_perms ( 'artist_edit_vanityhouse' ) ? '' : ' disabled="disabled"' ) ?> <?=($VanityHouse ? ' checked="checked"' : '')?> /></h3>
2011-03-28 14:21:28 +00:00
< h3 > Edit summary </ h3 >
< input type = " text " name = " summary " size = " 92 " />< br />
< div style = " text-align: center; " >
< input type = " submit " value = " Submit " />
</ div >
</ div >
</ form >
</ div >
2013-05-05 08:00:31 +00:00
< ? if ( check_perms ( 'torrents_edit' )) { ?>
2011-03-28 14:21:28 +00:00
< h2 > Rename </ h2 >
< div class = " box pad " >
2012-09-15 08:00:25 +00:00
< form class = " rename_form " name = " artist " action = " artist.php " method = " post " >
2011-03-28 14:21:28 +00:00
< input type = " hidden " name = " action " value = " rename " />
< input type = " hidden " name = " auth " value = " <?= $LoggedUser['AuthKey'] ?> " />
< input type = " hidden " name = " artistid " value = " <?= $ArtistID ?> " />
< div >
< input type = " text " name = " name " size = " 92 " value = " <?= $Name ?> " />
< div style = " text-align: center; " >
< input type = " submit " value = " Rename " />
</ div >
2013-02-22 08:00:24 +00:00
2011-03-28 14:21:28 +00:00
</ div >
</ form >
</ div >
2013-02-22 08:00:24 +00:00
2012-04-02 08:00:21 +00:00
< h2 > Make into non - redirecting alias </ h2 >
< div class = " box pad " >
2012-09-15 08:00:25 +00:00
< form class = " merge_form " name = " artist " action = " artist.php " method = " post " >
2012-04-02 08:00:21 +00:00
< input type = " hidden " name = " action " value = " change_artistid " />
< input type = " hidden " name = " auth " value = " <?= $LoggedUser['AuthKey'] ?> " />
< input type = " hidden " name = " artistid " value = " <?= $ArtistID ?> " />
< div >
2012-05-18 13:35:17 +00:00
< em > Merges this artist ( < ? = $Name ?> ) into the artist specified below (without redirection), so that "<?=$Name?>" (and its aliases) will appear as a non-redirecting alias of the artist entered in the text box below.</em><br /><br />
2012-04-02 08:00:21 +00:00
< div style = " text-align: center; " >
2013-02-09 08:01:01 +00:00
< label for = " newartistid " > Artist ID :</ label >& nbsp ; < input type = " text " id = " newartistid " name = " newartistid " size = " 40 " value = " " />< br />
2012-04-02 08:00:21 +00:00
< strong > OR </ strong >< br />
2013-02-09 08:01:01 +00:00
< label for = " newartistid " > Artist name :</ label >& nbsp ; < input type = " text " id = " newartistname " name = " newartistname " size = " 40 " value = " " />
2012-04-02 08:00:21 +00:00
< br />< br />
2013-03-09 08:00:18 +00:00
< input type = " submit " value = " Change artist ID " />
2012-04-02 08:00:21 +00:00
</ div >
</ div >
</ form >
</ div >
2013-02-22 08:00:24 +00:00
2011-03-28 14:21:28 +00:00
< h2 > Aliases </ h2 >
< div class = " box pad " >
< ul >
2013-02-22 08:00:24 +00:00
2011-03-28 14:21:28 +00:00
< ?
$DB -> query ( " SELECT AliasID, Name, UserID, Redirect FROM artists_alias WHERE ArtistID=' $ArtistID ' " );
2013-05-05 08:00:31 +00:00
while ( list ( $AliasID , $AliasName , $User , $Redirect ) = $DB -> next_record ( MYSQLI_NUM , true )) {
if ( $AliasName == $Name ) {
$DefaultRedirectID = $AliasID ;
}
2011-03-28 14:21:28 +00:00
?>
2013-05-05 08:00:31 +00:00
< li >
< span title = " Alias ID " >< ? = $AliasID ?> </span>. <span title="Alias name"><?=$AliasName?></span>
< ? if ( $User ) { ?>
< a href = " user.php?id=<?= $User ?> " title = " Alias creator " class = " brackets " > User </ a >
< ? }
if ( $Redirect ) { ?>
( writes redirect to < span title = " Target alias ID " >< ? = $Redirect ?> </span>)
< ? } ?>
< a href = " artist.php?action=delete_alias&aliasid=<?= $AliasID ?>&auth=<?= $LoggedUser['AuthKey'] ?> " title = " Delete this alias " class = " brackets " > X </ a >
2011-03-28 14:21:28 +00:00
</ li >
< ? }
?>
</ ul >
2012-09-15 08:00:25 +00:00
< form class = " add_form " name = " aliases " action = " artist.php " method = " post " >
< input type = " hidden " name = " action " value = " add_alias " />
< input type = " hidden " name = " auth " value = " <?= $LoggedUser['AuthKey'] ?> " />
< input type = " hidden " name = " artistid " value = " <?= $ArtistID ?> " />
< h3 > Name :</ h3 >
< input type = " text " name = " name " size = " 40 " value = " <?= $Name ?> " />< br />
2013-02-09 08:01:01 +00:00
< h3 > Writes redirect to ( enter an Alias ID ; leave blank or enter " 0 " for no redirect ) :</ h3 >
2012-09-15 08:00:25 +00:00
< input type = " text " name = " redirect " size = " 40 " value = " <?= $DefaultRedirectID ?> " />< br />
2013-01-16 08:00:31 +00:00
< em > This redirects artist names as they are written ( e . g . when new torrents are uploaded or artists added ) . All uses of this new alias will be redirected to the alias ID you enter here . Use for common misspellings , etc .</ em >< br />
2012-09-15 08:00:25 +00:00
< input type = " submit " value = " Add alias " />
2011-03-28 14:21:28 +00:00
</ form >
</ div >
2013-02-22 08:00:24 +00:00
< ? } ?>
2011-03-28 14:21:28 +00:00
</ div >
2013-01-16 08:00:31 +00:00
< ? View :: show_footer () ?>