diff --git a/classes/class_time.php b/classes/class_time.php index 5a851a5d..6f1488ad 100644 --- a/classes/class_time.php +++ b/classes/class_time.php @@ -144,8 +144,11 @@ function time_minus($Offset, $Fuzzy = false) { } } -function sqltime() { - return date('Y-m-d H:i:s'); +function sqltime($timestamp = false) { + if ($timestamp === false) { + $timestamp = time(); + } + return date('Y-m-d H:i:s', $timestamp); } function validDate($DateString) { diff --git a/classes/script_start.php b/classes/script_start.php index 59a383c3..6e4572be 100644 --- a/classes/script_start.php +++ b/classes/script_start.php @@ -1498,16 +1498,17 @@ function get_artist($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)) { + $ampersand = ($Escape) ? ' & ' : ' & '; switch(count($Artists[1])) { case 0: return ''; case 1: - $link = display_artist($Artists[1][0], $MakeLink); + $link = display_artist($Artists[1][0], $MakeLink, $Escape); break; 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; default: $link = 'Various Artists'; @@ -1515,10 +1516,10 @@ function display_artists($Artists, $MakeLink = true, $IncludeHyphen = true) { if(!empty($Artists[2]) && (count($Artists[1]) < 3)) { switch(count($Artists[2])) { case 1: - $link .= ' with '.display_artist($Artists[2][0], $MakeLink); + $link .= ' with '.display_artist($Artists[2][0], $MakeLink, $Escape); break; 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; } } @@ -1528,11 +1529,15 @@ function display_artists($Artists, $MakeLink = true, $IncludeHyphen = true) { } } -function display_artist($Artist, $MakeLink = true) { - if($MakeLink) { +function display_artist($Artist, $MakeLink = true, $Escape = true) { + if ($MakeLink && !$Escape) { + error('Invalid parameters to display_artist()'); + } elseif ($MakeLink) { return ''.display_str($Artist['name']).''; - } else { + } elseif ($Escape) { return display_str($Artist['name']); + } else { + return $Artist['name']; } } diff --git a/sections/artist/download.php b/sections/artist/download.php index 3aeeb985..23949876 100644 --- a/sections/artist/download.php +++ b/sections/artist/download.php @@ -127,7 +127,7 @@ $Zip = new ZIP(file_string($ArtistName)); foreach($Downloads as $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) { $Skips[] = $Artist.$Album.' '.$Year; continue; diff --git a/sections/collages/collage.php b/sections/collages/collage.php index eb0bd558..73eedc94 100644 --- a/sections/collages/collage.php +++ b/sections/collages/collage.php @@ -129,11 +129,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); ?>