Gazelle/sections/torrents/editgroup.php
What.CD 6273679d49 86 changes from Wed Jul 27 01:50:24 2011 -0400 to Tue Aug 9 12:47:47 2011 -0400
fix typo I introduced in schedule.php
Print to LAB_CHAN if sphinx connection fails
nice bitcoin display
Corrects [#] tag for Mono  [hateradio]
bitcoin donation
Fix torrent unbookmarking
upgraded sphinxapi.php to r2876 as the site is running r2902
Added options to block Tor, Opera Turbo and Opera Mini
check for stale cache
vanity house  [clone00]
bookmark almost anything  [patapper]
new torrent edit flags  [rattvis]
permissions stuff from patappatch c
[BBCode] new [important] tag  [DutchDude]
Fixed images flowing past their boxes  [hateradio]
[BBCode] Tag for ordered lists.  [hateradio]
finally fixed that annoying textarea-resizing thing
renamed temporary tables

fixes http://what.cd/forums.php?action=viewthread&threadid=137432&page=1#post3408738
implements http://what.cd/forums.php?action=viewthread&threadid=122832
fixes http://what.cd/forums.php?action=viewthread&threadid=136553
fixes http://what.cd/forums.php?action=viewthread&threadid=112967
implements http://what.cd/forums.php?action=viewthread&threadid=110395
2011-08-09 21:03:28 +00:00

167 lines
5.5 KiB
PHP

<?
/************************************************************************
||------------|| Edit artist wiki page ||------------------------------||
This page is the page that is displayed when someone feels like editing
an artist's wiki page.
It is called when $_GET['action'] == 'edit'. $_GET['artistid'] is the
ID of the artist, and must be set.
The page inserts a new revision into the wiki_artists table, and clears
the cache for the artist page.
************************************************************************/
$GroupID = $_GET['groupid'];
if(!is_number($GroupID) || !$GroupID) { error(0); }
// Get the artist name and the body of the last revision
$DB->query("SELECT
tg.Name,
wt.Image,
wt.Body,
tg.WikiImage,
tg.WikiBody,
tg.Year,
tg.RecordLabel,
tg.CatalogueNumber,
tg.ReleaseType,
tg.CategoryID,
tg.VanityHouse
FROM torrents_group AS tg
LEFT JOIN wiki_torrents AS wt ON wt.RevisionID=tg.RevisionID
WHERE tg.ID='$GroupID'");
if($DB->record_count() == 0) { error(404); }
list($Name, $Image, $Body, $WikiImage, $WikiBody, $Year, $RecordLabel, $CatalogueNumber, $ReleaseType, $CategoryID, $VanityHouse) = $DB->next_record();
if(!$Body) { $Body = $WikiBody; $Image = $WikiImage; }
show_header('Edit torrent group');
// Start printing form
?>
<div class="thin">
<h2>Edit <a href="torrents.php?id=<?=$GroupID?>"><?=$Name?></a></h2>
<div class="box pad">
<form action="torrents.php" method="post">
<div>
<input type="hidden" name="action" value="takegroupedit" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<input type="hidden" name="groupid" value="<?=$GroupID?>" />
<h3>Image</h3>
<input type="text" name="image" size="92" value="<?=$Image?>" /><br />
<h3>Description</h3>
<textarea name="body" cols="91" rows="20"><?=$Body?></textarea><br />
<? if($CategoryID == 1) { ?>
<select id="releasetype" name="releasetype">
<? foreach ($ReleaseTypes as $Key => $Val) { ?>
<option value='<?=$Key?>' <?=($Key == $ReleaseType ? " selected='selected'" : '')?>>
<?=$Val?>
</option>
<? } ?>
</select><br />
<h3>Vanity House <input type="checkbox" name="vanity_house" value="1" <?=( check_perms('torrents_edit_vanityhouse') ? '' : 'disabled="disabled"' )?> <?=($VanityHouse ? 'checked="checked"' : '')?> /></h3>
<? } ?>
<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>
<? $DB->query("SELECT UserID FROM torrents WHERE GroupID = ".$GroupID);
//Users can edit the group info if they've uploaded a torrent to the group or have torrents_edit
if(in_array($LoggedUser['ID'], $DB->collect('UserID')) || check_perms('torrents_edit')) { ?>
<h2>Non-wiki group editing</h2>
<div class="box pad">
<form action="torrents.php" method="post">
<input type="hidden" name="action" value="nonwikiedit" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<input type="hidden" name="groupid" value="<?=$GroupID?>" />
<table cellpadding="3" cellspacing="1" border="0" class="border" width="100%">
<tr>
<td colspan="2" class="center">This is for editing the information related to the <strong>original release</strong> only.</td>
</tr>
<tr>
<td class="label">Year</td>
<td>
<input type="text" name="year" size="10" value="<?=$Year?>" />
</td>
</tr>
<tr>
<td class="label">Record label</td>
<td>
<input type="text" name="record_label" size="40" value="<?=$RecordLabel?>" />
</td>
</tr>
<tr>
<td class="label">Catalogue Number</td>
<td>
<input type="text" name="catalogue_number" size="40" value="<?=$CatalogueNumber?>" />
</td>
</tr>
<? if(check_perms('torrents_freeleech')) { ?>
<tr>
<td class="label">Freeleech <strong>Group</strong></td>
<td>
<input type="checkbox" name="unfreeleech" /> Reset
<input type="checkbox" name="freeleech" /> Freeleech
<input type="checkbox" name="neutralleech" /> Neutralleech
because
<select name="freeleechtype">
<? $FL = array("N/A", "Staff Pick", "Perma-FL", "Vanity House");
foreach($FL as $Key => $FLType) { ?>
<option value="<?=$Key?>" <?=($Key == $Torrent['FreeLeechType'] ? ' selected="selected"' : '')?>><?=$FLType?></option>
<? } ?>
</select>
</td>
</tr>
<? } ?>
</table>
<input type="submit" value="Edit" />
</form>
</div>
<?
}
if(check_perms('torrents_edit')) {
?>
<h2>Rename (won't merge)</h2>
<div class="box pad">
<form action="torrents.php" method="post">
<div>
<input type="hidden" name="action" value="rename" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<input type="hidden" name="groupid" value="<?=$GroupID?>" />
<input type="text" name="name" size="92" value="<?=$Name?>" />
<div style="text-align: center;">
<input type="submit" value="Rename" />
</div>
</div>
</form>
</div>
<h2>Merge with another group</h2>
<div class="box pad">
<form action="torrents.php" method="post">
<div>
<input type="hidden" name="action" value="merge" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<input type="hidden" name="groupid" value="<?=$GroupID?>" />
<h3>Target Group ID</h3>
<input type="text" name="targetgroupid" size="10" />
<div style="text-align: center;">
<input type="submit" value="Merge" />
</div>
</div>
</form>
</div>
<? } ?>
</div>
<?
show_footer();
?>