mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-01-07 06:50:10 +00:00
indenting
[collages] respect user grouping setting changed sqltime fix HTML character codes appearing in filenames
This commit is contained in:
parent
e61aa7c115
commit
8c7e564b47
@ -144,8 +144,11 @@ function time_minus($Offset, $Fuzzy = false) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function sqltime() {
|
function sqltime($timestamp = false) {
|
||||||
return date('Y-m-d H:i:s');
|
if ($timestamp === false) {
|
||||||
|
$timestamp = time();
|
||||||
|
}
|
||||||
|
return date('Y-m-d H:i:s', $timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
function validDate($DateString) {
|
function validDate($DateString) {
|
||||||
|
@ -1498,16 +1498,17 @@ function get_artist($GroupID) {
|
|||||||
return $Results[$GroupID];
|
return $Results[$GroupID];
|
||||||
}
|
}
|
||||||
|
|
||||||
function display_artists($Artists, $MakeLink = true, $IncludeHyphen = true) {
|
function display_artists($Artists, $MakeLink = true, $IncludeHyphen = true, $Escape = true) {
|
||||||
if(!empty($Artists)) {
|
if(!empty($Artists)) {
|
||||||
|
$ampersand = ($Escape) ? ' & ' : ' & ';
|
||||||
switch(count($Artists[1])) {
|
switch(count($Artists[1])) {
|
||||||
case 0:
|
case 0:
|
||||||
return '';
|
return '';
|
||||||
case 1:
|
case 1:
|
||||||
$link = display_artist($Artists[1][0], $MakeLink);
|
$link = display_artist($Artists[1][0], $MakeLink, $Escape);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
$link = display_artist($Artists[1][0], $MakeLink).' & '.display_artist($Artists[1][1], $MakeLink);
|
$link = display_artist($Artists[1][0], $MakeLink, $Escape).$ampersand.display_artist($Artists[1][1], $MakeLink, $Escape);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$link = 'Various Artists';
|
$link = 'Various Artists';
|
||||||
@ -1515,10 +1516,10 @@ function display_artists($Artists, $MakeLink = true, $IncludeHyphen = true) {
|
|||||||
if(!empty($Artists[2]) && (count($Artists[1]) < 3)) {
|
if(!empty($Artists[2]) && (count($Artists[1]) < 3)) {
|
||||||
switch(count($Artists[2])) {
|
switch(count($Artists[2])) {
|
||||||
case 1:
|
case 1:
|
||||||
$link .= ' with '.display_artist($Artists[2][0], $MakeLink);
|
$link .= ' with '.display_artist($Artists[2][0], $MakeLink, $Escape);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
$link .= ' with '.display_artist($Artists[2][0], $MakeLink).' & '.display_artist($Artists[2][1], $MakeLink);
|
$link .= ' with '.display_artist($Artists[2][0], $MakeLink, $Escape).$ampersand.display_artist($Artists[2][1], $MakeLink, $Escape);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1528,11 +1529,15 @@ function display_artists($Artists, $MakeLink = true, $IncludeHyphen = true) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function display_artist($Artist, $MakeLink = true) {
|
function display_artist($Artist, $MakeLink = true, $Escape = true) {
|
||||||
if($MakeLink) {
|
if ($MakeLink && !$Escape) {
|
||||||
|
error('Invalid parameters to display_artist()');
|
||||||
|
} elseif ($MakeLink) {
|
||||||
return '<a href="artist.php?id='.$Artist['id'].'">'.display_str($Artist['name']).'</a>';
|
return '<a href="artist.php?id='.$Artist['id'].'">'.display_str($Artist['name']).'</a>';
|
||||||
} else {
|
} elseif ($Escape) {
|
||||||
return display_str($Artist['name']);
|
return display_str($Artist['name']);
|
||||||
|
} else {
|
||||||
|
return $Artist['name'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@
|
|||||||
$Zip = new ZIP(file_string($ArtistName));
|
$Zip = new ZIP(file_string($ArtistName));
|
||||||
foreach($Downloads as $Download) {
|
foreach($Downloads as $Download) {
|
||||||
list($Rank, $GroupID, $Media, $Format, $Encoding, $ReleaseType, $Year, $Album, $Size, $Contents) = $Download;
|
list($Rank, $GroupID, $Media, $Format, $Encoding, $ReleaseType, $Year, $Album, $Size, $Contents) = $Download;
|
||||||
$Artist = display_artists($Artists[$GroupID],false);
|
$Artist = display_artists($Artists[$GroupID],false,true,false);
|
||||||
if ($Rank == 100) {
|
if ($Rank == 100) {
|
||||||
$Skips[] = $Artist.$Album.' '.$Year;
|
$Skips[] = $Artist.$Album.' '.$Year;
|
||||||
continue;
|
continue;
|
||||||
|
@ -129,11 +129,12 @@ function compare($X, $Y){
|
|||||||
// Start an output buffer, so we can store this output in $TorrentTable
|
// Start an output buffer, so we can store this output in $TorrentTable
|
||||||
ob_start();
|
ob_start();
|
||||||
if(count($Torrents)>1 || $GroupCategoryID==1) {
|
if(count($Torrents)>1 || $GroupCategoryID==1) {
|
||||||
// Grouped torrents
|
// Grouped torrents
|
||||||
|
$ShowGroups = !(!empty($LoggedUser['TorrentGrouping']) && $LoggedUser['TorrentGrouping'] == 1);
|
||||||
?>
|
?>
|
||||||
<tr class="group discog" id="group_<?=$GroupID?>">
|
<tr class="group discog" id="group_<?=$GroupID?>">
|
||||||
<td class="center">
|
<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>
|
<a href="#" class="show_torrents_link" onclick="ToggleGroup(<?=$GroupID?>); return false;"></a>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
@ -127,7 +127,7 @@
|
|||||||
$Zip = new ZIP(file_string($CollageName));
|
$Zip = new ZIP(file_string($CollageName));
|
||||||
foreach($Downloads as $Download) {
|
foreach($Downloads as $Download) {
|
||||||
list($Rank, $GroupID, $Media, $Format, $Encoding, $Year, $Album, $Size, $Contents) = $Download;
|
list($Rank, $GroupID, $Media, $Format, $Encoding, $Year, $Album, $Size, $Contents) = $Download;
|
||||||
$Artist = display_artists($Artists[$GroupID],false);
|
$Artist = display_artists($Artists[$GroupID],false,true,false);
|
||||||
if ($Rank == 100) {
|
if ($Rank == 100) {
|
||||||
$Skips[] = $Artist.$Album.' '.$Year;
|
$Skips[] = $Artist.$Album.' '.$Year;
|
||||||
continue;
|
continue;
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
if (!is_number($TorrentID)){ error(0); }
|
if (!is_number($TorrentID)){ error(0); }
|
||||||
|
|
||||||
$Info = $Cache->get_value('torrent_download_'.$TorrentID);
|
$Info = $Cache->get_value('torrent_download_'.$TorrentID);
|
||||||
if(!is_array($Info)) {
|
if(!is_array($Info) || !array_key_exists('PlainArtists', $Info)) {
|
||||||
$DB->query("SELECT
|
$DB->query("SELECT
|
||||||
t.Media,
|
t.Media,
|
||||||
t.Format,
|
t.Format,
|
||||||
@ -46,7 +46,9 @@
|
|||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
$Info = array($DB->next_record(MYSQLI_NUM, array(4,5,6)));
|
$Info = array($DB->next_record(MYSQLI_NUM, array(4,5,6)));
|
||||||
$Info['Artists'] = display_artists(get_artist($Info[0][4],false), false, true);
|
$Artists = get_artist($Info[0][4],false);
|
||||||
|
$Info['Artists'] = display_artists($Artists, false, true);
|
||||||
|
$Info['PlainArtists'] = display_artists($Artists, false, true, false);
|
||||||
$Cache->cache_value('torrent_download_'.$TorrentID, $Info, 0);
|
$Cache->cache_value('torrent_download_'.$TorrentID, $Info, 0);
|
||||||
}
|
}
|
||||||
if(!is_array($Info[0])) {
|
if(!is_array($Info[0])) {
|
||||||
@ -93,7 +95,7 @@
|
|||||||
$TorrentName='';
|
$TorrentName='';
|
||||||
$TorrentInfo='';
|
$TorrentInfo='';
|
||||||
|
|
||||||
$TorrentName = $Artists;
|
$TorrentName = $Info['PlainArtists'];
|
||||||
|
|
||||||
$TorrentName.=$Name;
|
$TorrentName.=$Name;
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@
|
|||||||
$Zip = new ZIP($Username.'\'s '.ucfirst($_GET['type']));
|
$Zip = new ZIP($Username.'\'s '.ucfirst($_GET['type']));
|
||||||
foreach($Downloads as $Download) {
|
foreach($Downloads as $Download) {
|
||||||
list($Month, $GroupID, $Media, $Format, $Encoding, $Year, $Album, $Size, $Contents) = $Download;
|
list($Month, $GroupID, $Media, $Format, $Encoding, $Year, $Album, $Size, $Contents) = $Download;
|
||||||
$Artist = display_artists($Artists[$GroupID],false);
|
$Artist = display_artists($Artists[$GroupID],false,true,false);
|
||||||
$Contents = unserialize(base64_decode($Contents));
|
$Contents = unserialize(base64_decode($Contents));
|
||||||
$Tor = new TORRENT($Contents, true);
|
$Tor = new TORRENT($Contents, true);
|
||||||
$Tor->set_announce_url(ANNOUNCE_URL.'/'.$LoggedUser['torrent_pass'].'/announce');
|
$Tor->set_announce_url(ANNOUNCE_URL.'/'.$LoggedUser['torrent_pass'].'/announce');
|
||||||
|
Loading…
Reference in New Issue
Block a user