diff options
author | plegall <plg@piwigo.org> | 2015-12-17 14:08:53 +0100 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2015-12-17 14:08:53 +0100 |
commit | 0f8d85491f656440e7cc66ecca70f7af8dff0022 (patch) | |
tree | d3d9f9b3f79892f00604b974e9548bfb92f0074b /picture.php | |
parent | b1b91992581b769fba5dae51aa5fb17b155516ba (diff) |
feature #379, multiple format, hide formats when disabled
Diffstat (limited to 'picture.php')
-rw-r--r-- | picture.php | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/picture.php b/picture.php index a6c6defb7..f2dfecf0e 100644 --- a/picture.php +++ b/picture.php @@ -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 - - $format['filesize'] = sprintf('%.1fMB', $format['filesize']/1024); + 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); + } } - } - $template->append('current', array('formats' => $formats), true); + $template->append('current', array('formats' => $formats), true); + } } |