mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-01 20:04:51 +02:00
feature #379, multiple format, hide formats when disabled
This commit is contained in:
+1
-1
@@ -57,7 +57,7 @@ function do_error( $code, $str )
|
||||
exit();
|
||||
}
|
||||
|
||||
if (isset($_GET['format']))
|
||||
if ($conf['enable_formats'] and isset($_GET['format']))
|
||||
{
|
||||
check_input_parameter('format', $_GET, false, PATTERN_ID);
|
||||
|
||||
|
||||
+13
-10
@@ -663,25 +663,28 @@ if ($conf['picture_download_icon'] and !empty($picture['current']['download_url'
|
||||
{
|
||||
$template->append('current', array('U_DOWNLOAD' => $picture['current']['download_url']), true);
|
||||
|
||||
$query = '
|
||||
if ($conf['enable_formats'])
|
||||
{
|
||||
$query = '
|
||||
SELECT *
|
||||
FROM '.IMAGE_FORMAT_TABLE.'
|
||||
WHERE image_id = '.$picture['current']['id'].'
|
||||
;';
|
||||
$formats = query2array($query);
|
||||
$formats = query2array($query);
|
||||
|
||||
if (!empty($formats))
|
||||
{
|
||||
foreach ($formats as &$format)
|
||||
if (!empty($formats))
|
||||
{
|
||||
$format['download_url'] = 'action.php?format='.$format['format_id'];
|
||||
$format['download_url'].= '&download='.substr(md5(time()), 0, 6); // a random string to avoid browser cache
|
||||
foreach ($formats as &$format)
|
||||
{
|
||||
$format['download_url'] = 'action.php?format='.$format['format_id'];
|
||||
$format['download_url'].= '&download='.substr(md5(time()), 0, 6); // a random string to avoid browser cache
|
||||
|
||||
$format['filesize'] = sprintf('%.1fMB', $format['filesize']/1024);
|
||||
$format['filesize'] = sprintf('%.1fMB', $format['filesize']/1024);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$template->append('current', array('formats' => $formats), true);
|
||||
$template->append('current', array('formats' => $formats), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user