mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-01-18 12:11:36 +00:00
<No commit messages entered>
This commit is contained in:
parent
e02ee62aa9
commit
e61aa7c115
@ -125,13 +125,6 @@ function foot() {
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="grace">
|
||||
<td class="label">Extended Grace</td>
|
||||
<td>
|
||||
<input type="checkbox" name="extendedgrace"<?=$Torrent['ExtendedGrace']? ' checked="checked"' : ''?> /> Checking this box extendes the grace period for this torrent.
|
||||
</td>
|
||||
</tr>
|
||||
<?
|
||||
}
|
||||
}
|
||||
|
@ -1439,6 +1439,11 @@ function check_perms($PermissionName,$MinClass = 0) {
|
||||
return (isset($LoggedUser['Permissions'][$PermissionName]) && $LoggedUser['Permissions'][$PermissionName] && $LoggedUser['Class']>=$MinClass)?true:false;
|
||||
}
|
||||
|
||||
// TODO: make stricter, e.g. on all whitespace characters or Unicode normalisation
|
||||
function normalise_artist_name($ArtistName) {
|
||||
return trim(preg_replace('/ +/', ' ', $ArtistName));
|
||||
}
|
||||
|
||||
function get_artists($GroupIDs, $Escape = array()) {
|
||||
global $Cache, $DB;
|
||||
$Results = array();
|
||||
|
@ -78,6 +78,10 @@ CREATE TABLE `artists_tags` (
|
||||
KEY `UserID` (`UserID`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `bad_passwords` (
|
||||
`Password` char(32) NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
CREATE TABLE `blog` (
|
||||
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`UserID` int(10) unsigned NOT NULL,
|
||||
|
@ -4,7 +4,7 @@
|
||||
if(!check_perms('torrents_edit')) { error(403); }
|
||||
$ArtistID = $_POST['artistid'];
|
||||
$Redirect = $_POST['redirect'];
|
||||
$AliasName = db_string($_POST['name']);
|
||||
$AliasName = db_string(normalise_artist_name($_POST['name']));
|
||||
if(!$Redirect) { $Redirect = 0; }
|
||||
|
||||
if(!is_number($ArtistID) || !($Redirect === 0 || is_number($Redirect)) || !$ArtistID) {
|
||||
|
@ -23,7 +23,7 @@
|
||||
authorize();
|
||||
|
||||
$ArtistID = $_POST['artistid'];
|
||||
$NewName = $_POST['name'];
|
||||
$NewName = normalise_artist_name($_POST['name']);
|
||||
|
||||
if(!$ArtistID || !is_number($ArtistID)) { error(404); }
|
||||
|
||||
|
@ -103,11 +103,12 @@ function compare($X, $Y){
|
||||
// Start an output buffer, so we can store this output in $TorrentTable
|
||||
ob_start();
|
||||
if(count($Torrents)>1 || $GroupCategoryID==1) {
|
||||
// Grouped torrents
|
||||
// Grouped torrents
|
||||
$ShowGroups = !(!empty($LoggedUser['TorrentGrouping']) && $LoggedUser['TorrentGrouping'] == 1);
|
||||
?>
|
||||
<tr class="group discog" id="group_<?=$GroupID?>">
|
||||
<td class="center">
|
||||
<div title="View" id="showimg_<?=$GroupID?>" class="hide_torrents">
|
||||
<div title="View" id="showimg_<?=$GroupID?>" class="<?=($ShowGroups ? 'hide' : 'show')?>_torrents">
|
||||
<a href="#" class="show_torrents_link" onclick="ToggleGroup(<?=$GroupID?>); return false;"></a>
|
||||
</div>
|
||||
</td>
|
||||
|
@ -33,7 +33,7 @@
|
||||
if($FeaturedAlbum === false) {
|
||||
$DB->query("SELECT fa.GroupID, tg.Name, tg.WikiImage, fa.ThreadID, fa.Title FROM featured_albums AS fa JOIN torrents_group AS tg ON tg.ID=fa.GroupID WHERE Ended = 0");
|
||||
$FeaturedAlbum = $DB->next_record();
|
||||
$FeaturedAlbum['WikiImage'] = 'http://i.imgur.com/4xaAx.png';
|
||||
|
||||
$Cache->cache_value('featured_album', $FeaturedAlbum, 0);
|
||||
}
|
||||
if(is_number($FeaturedAlbum['GroupID'])) {
|
||||
|
@ -13,7 +13,7 @@
|
||||
$Changed = false;
|
||||
|
||||
for($i = 0; $i < count($AliasNames); $i++) {
|
||||
$AliasName = trim($AliasNames[$i]);
|
||||
$AliasName = normalise_artist_name($AliasNames[$i]);
|
||||
$Importance = $Importances[$i];
|
||||
|
||||
if($Importance!='1' && $Importance!='2' && $Importance!='3') {
|
||||
|
@ -695,7 +695,7 @@ function header_link($SortKey,$DefaultWay="desc") {
|
||||
<tr class="group">
|
||||
<td class="center">
|
||||
<?
|
||||
$ShowGroups = !(!empty($LoggedUser['TorrentGrouping']) && $LoggedUser['TorrentGrouping'] == 1)
|
||||
$ShowGroups = !(!empty($LoggedUser['TorrentGrouping']) && $LoggedUser['TorrentGrouping'] == 1);
|
||||
?>
|
||||
<div title="View" id="showimg_<?=$GroupID?>" class="<?=($ShowGroups ? 'hide' : 'show')?>_torrents">
|
||||
<a href="#" class="show_torrents_link" onclick="ToggleGroup(<?=$GroupID?>); return false;"></a>
|
||||
|
@ -293,7 +293,7 @@ function filelist($Str) {
|
||||
|
||||
list($TorrentID, $Media, $Format, $Encoding, $Remastered, $RemasterYear, $RemasterTitle, $RemasterRecordLabel, $RemasterCatalogueNumber,
|
||||
$Scene, $HasLog, $HasCue, $LogScore, $FileCount, $Size, $Seeders, $Leechers, $Snatched, $FreeTorrent, $TorrentTime, $Description,
|
||||
$FileList, $FilePath, $UserID, $Username, $LastActive, $BadTags, $BadFolders, $BadFiles, $LastReseedRequest, $LogInDB, $HasFile, $ExtendedGrace) = $Torrent;
|
||||
$FileList, $FilePath, $UserID, $Username, $LastActive, $BadTags, $BadFolders, $BadFiles, $LastReseedRequest, $LogInDB, $HasFile) = $Torrent;
|
||||
|
||||
if($Remastered && !$RemasterYear) {
|
||||
if(!isset($FirstUnknown)) {
|
||||
@ -372,7 +372,6 @@ function filelist($Str) {
|
||||
if(!empty($BadTags)) { $ExtraInfo.=$AddExtra.'<strong>Bad Tags</strong>'; $AddExtra=' / '; }
|
||||
if(!empty($BadFolders)) { $ExtraInfo.=$AddExtra.'<strong>Bad Folders</strong>'; $AddExtra=' / '; }
|
||||
if(!empty($BadFiles)) { $ExtraInfo.=$AddExtra.'<strong>Bad File Names</strong>'; $AddExtra=' / '; }
|
||||
if (!empty($ExtendedGrace)) { $ExtraInfo.=$AddExtra.'<strong>Extended Grace Period</strong>'; $AddExtra=' / '; }
|
||||
|
||||
if($GroupCategoryID == 1
|
||||
&& ($RemasterTitle != $LastRemasterTitle
|
||||
|
@ -38,7 +38,6 @@
|
||||
t.HasLog,
|
||||
t.HasCue,
|
||||
t.LogScore,
|
||||
t.ExtendedGrace,
|
||||
bt.TorrentID AS BadTags,
|
||||
bf.TorrentID AS BadFolders,
|
||||
bfi.TorrentID AS BadFiles
|
||||
|
@ -87,8 +87,7 @@ function get_group_info($GroupID, $Return = true, $RevisionID = 0) {
|
||||
tfi.TorrentID,
|
||||
t.LastReseedRequest,
|
||||
tln.TorrentID AS LogInDB,
|
||||
t.ID AS HasFile,
|
||||
t.ExtendedGrace
|
||||
t.ID AS HasFile
|
||||
FROM torrents AS t
|
||||
LEFT JOIN users_main AS um ON um.ID=t.UserID
|
||||
LEFT JOIN torrents_bad_tags AS tbt ON tbt.TorrentID=t.ID
|
||||
|
@ -61,7 +61,6 @@
|
||||
}
|
||||
$Properties['FreeLeech'] = $Free;
|
||||
}
|
||||
$Properties['ExtendedGrace'] = (isset($_POST['extendedgrace']))? 1 : 0;
|
||||
|
||||
//******************************************************************************//
|
||||
//--------------- Validate data in edit form -----------------------------------//
|
||||
@ -260,8 +259,7 @@
|
||||
RemasterRecordLabel=$T[RemasterRecordLabel],
|
||||
RemasterCatalogueNumber=$T[RemasterCatalogueNumber],
|
||||
Scene=$T[Scene],
|
||||
Description=$T[TorrentDescription],
|
||||
ExtendedGrace=$T[ExtendedGrace],";
|
||||
Description=$T[TorrentDescription],";
|
||||
|
||||
if(check_perms('torrents_freeleech')) {
|
||||
$SQL .= "FreeTorrent=$T[FreeLeech],";
|
||||
|
@ -270,7 +270,7 @@
|
||||
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' => trim($Artists[$i]));
|
||||
$ArtistForm[$Importance[$i]][] = array('name' => normalise_artist_name($Artists[$i]));
|
||||
if($Importance[$i] == 1) {
|
||||
$MainArtistCount++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user