Empty commit

This commit is contained in:
Git 2012-02-22 08:00:31 +00:00
parent 3edfb6e111
commit 5d9b6c6406
8 changed files with 49 additions and 13 deletions

View File

@ -393,16 +393,15 @@ function music_form($GenreTags) {
</span>
</td>
</tr>
<? if (check_perms('torrents_edit_vanityhouse') && $this->NewTorrent) { ?>
<tr>
<td class="label">Vanity House</td>
<td>
<label><input type="checkbox" id="vanity_house" name="vanity_house" <?=( check_perms('torrents_edit_vanityhouse') ? $this->DisabledInputA : 'disabled="disabled"' )?> <? if($Torrent['VanityHouse']){ echo "checked='checked' ";}?>/>
<label><input type="checkbox" id="vanity_house" name="vanity_house" <? if(!$Torrent['GroupID']) { echo 'disabled '; }?><? if($Torrent['VanityHouse']){ echo "checked='checked' ";}?>/>
Check this only if you are the submitting artist or submitting on behalf of the artist and this is intended to be a Vanity House release. Checking this will also automatically add the group as a recommendation.</label>
<? if ( ! check_perms('torrents_edit_vanityhouse') ) { ?>
<p>You do not have permission to mark albums as vanity house. <a href="wiki.php?action=article&id=282">More information about vanity house</a></p>
<? } ?>
</td>
</tr>
<? } ?>
<tr>
<td class="label">Media</td>
<td>

View File

@ -1579,6 +1579,10 @@ function check_perms($PermissionName,$MinClass = 0) {
// TODO: make stricter, e.g. on all whitespace characters or Unicode normalisation
function normalise_artist_name($ArtistName) {
// \u200e is &lrm;
$ArtistName = trim($ArtistName);
$ArtistName = preg_replace('/^(\xE2\x80\x8E)+/', '', $ArtistName);
$ArtistName = preg_replace('/(\xE2\x80\x8E)+$/', '', $ArtistName);
return trim(preg_replace('/ +/', ' ', $ArtistName));
}

View File

@ -62,7 +62,7 @@
$Cache->cache_value('toprequesttag_'.$Limit,$TopRequestTags,3600*12);
}
generate_tag_table('Most Used Request Tags', 'ur', $TopRequestTags, $Limit, false);
generate_tag_table('Most Used Request Tags', 'ur', $TopRequestTags, $Limit, false, true);
}
if ($Details=='all' || $Details=='v') {
@ -90,7 +90,12 @@
exit;
// generate a table based on data from most recent query to $DB
function generate_tag_table($Caption, $Tag, $Details, $Limit, $ShowVotes=true) {
function generate_tag_table($Caption, $Tag, $Details, $Limit, $ShowVotes=true, $RequestsTable = false) {
if ($RequestsTable) {
$URLString = 'requests.php?tags=';
} else {
$URLString = 'torrents.php?taglist=';
}
?>
<h3>Top <?=$Limit.' '.$Caption?>
<small>
@ -129,7 +134,7 @@ function generate_tag_table($Caption, $Tag, $Details, $Limit, $ShowVotes=true) {
?>
<tr class="row<?=$Highlight?>">
<td class="center"><?=$Rank?></td>
<td><a href="torrents.php?taglist=<?=$Detail['Name']?>"><?=$Detail['Name']?></a></td>
<td><a href="<?=$URLString?><?=$Detail['Name']?>"><?=$Detail['Name']?></a></td>
<td style="text-align:right"><?=$Detail['Uses']?></td>
<? if($ShowVotes) { ?>
<td style="text-align:right"><?=$Detail['PosVotes']?></td>

View File

@ -60,9 +60,12 @@
<?=$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>
<? } ?>
</select>
<? if (check_perms('torrents_edit_vanityhouse')) { ?>
<br />
<h3>Vanity House <input type="checkbox" name="vanity_house" value="1" <?=($VanityHouse ? 'checked="checked"' : '')?> /></h3>
<? }
} ?>
<h3>Edit summary</h3>
<input type="text" name="summary" size="92" /><br />
<div style="text-align: center;">
@ -87,7 +90,6 @@
<tr>
<td class="label">Year</td>
<td>
<input type="text" name="year" size="10" value="<?=$Year?>" />
</td>
</tr>

View File

@ -40,6 +40,10 @@
$RecordLabel = db_string($_POST['record_label']);
$CatalogueNumber = db_string($_POST['catalogue_number']);
// Get some info for the group log
$DB->query("SELECT Year FROM torrents_group WHERE ID = $GroupID");
list($OldYear) = $DB->next_record();
$DB->query("UPDATE torrents_group SET
@ -48,6 +52,11 @@
CatalogueNumber = '".$CatalogueNumber."'
WHERE ID = ".$GroupID);
if ($OldYear != $Year) {
$DB->query("INSERT INTO group_log (GroupID, UserID, Time, Info)
VALUES ('$GroupID',".$LoggedUser['ID'].",'".sqltime()."','".db_string("Year changed from $OldYear to $Year")."')");
}
$DB->query("SELECT ID FROM torrents WHERE GroupID='$GroupID'");
while(list($TorrentID) = $DB->next_record()) {
$Cache->delete_value('torrent_download_'.$TorrentID);

View File

@ -40,7 +40,7 @@
$InfoHash = unpack("H*", $InfoHash);
delete_torrent($TorrentID, $GroupID);
write_log('Torrent '.$TorrentID.' ('.$Name.') ('.number_format($Size/(1024*1024), 2).' MB) ('.strtoupper($InfoHash[1]).') was deleted by '.$LoggedUser['Username'].': ' .$_POST['reason'].' '.$_POST['extra']);
write_group_log($GroupID, $TorrentID, $LoggedUser['ID'], "deleted torrent (".number_format($Size/(1024*1024), 2)."' MB, ".strtoupper($InfoHash[1]).") for reason: ".$_POST['reason']." ".$_POST['extra'], 0);
write_group_log($GroupID, $TorrentID, $LoggedUser['ID'], "deleted torrent (".number_format($Size/(1024*1024), 2)." MB, ".strtoupper($InfoHash[1]).") for reason: ".$_POST['reason']." ".$_POST['extra'], 0);
show_header('Torrent deleted');
?>

View File

@ -17,6 +17,12 @@
$UserID = $LoggedUser['ID'];
$GroupID = $_REQUEST['groupid'];
// Get information for the group log
$DB->query("SELECT VanityHouse FROM torrents_group WHERE ID = '$GroupID'");
if (!(list($OldVH) = $DB->next_record())) {
error(404);
}
if(!empty($_GET['action']) && $_GET['action'] == 'revert') { // if we're reverting to a previous revision
$RevisionID=$_GET['revisionid'];
if(!is_number($RevisionID)) { error(0); }
@ -84,6 +90,11 @@
WikiBody='$Body',
WikiImage='$Image'
WHERE ID='$GroupID'");
// Log VH changes
if ($OldVH != $VanityHouse && check_perms('torrents_edit_vanityhouse')) {
$DB->query("INSERT INTO group_log (GroupID, UserID, Time, Info)
VALUES ('$GroupID',".$LoggedUser['ID'].",'".sqltime()."','".db_string('Vanity house status changed to '.($VanityHouse?'true':'false'))."')");
}
// There we go, all done!

View File

@ -570,6 +570,10 @@
$Cache->delete_value('torrent_group_'.$GroupID);
$Cache->delete_value('torrents_details_'.$GroupID);
$Cache->delete_value('detail_files_'.$GroupID);
if($Type == 'Music') {
$DB->query("SELECT ReleaseType FROM torrents_group WHERE ID='$GroupID'");
list($Properties['ReleaseType']) = $DB->next_record();
}
}
// Description
@ -701,7 +705,9 @@
if($Type == 'Music'){ $Announce .= display_artists($ArtistForm, false); }
$Announce .= trim($Properties['Title'])." ";
if($Type == 'Music'){
$Announce .= "[".trim($Properties['Year'])."] - ";
$Announce .= '['.trim($Properties['Year']).']';
if (($Type == 'Music') && ($Properties['ReleaseType'] > 0)) { $Announce .= ' ['.$ReleaseTypes[$Properties['ReleaseType']].']'; }
$Announce .= " - ";
$Announce .= trim($Properties['Format'])." / ".trim($Properties['Bitrate']);
if ($HasLog == "'1'") { $Announce .= " / Log"; }
if ($LogInDB) { $Announce .= " / ".$LogScoreAverage.'%'; }