mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-12 11:43:01 +02:00
feature #379 multiple format, step 1: add formats
* new table piwigo_image_format (each photo can have 0 to many formats) * only compatible with synchronization for now. Formats must be in sub-directory pwg_format * formats are visible on edition page only for now
This commit is contained in:
@@ -306,6 +306,25 @@ SELECT
|
||||
$intro_vars['stats'].= ', '.sprintf(l10n('Rated %d times, score : %.2f'), $row['nb_rates'], $row['rating_score']);
|
||||
}
|
||||
|
||||
$query = '
|
||||
SELECT *
|
||||
FROM '.IMAGE_FORMAT_TABLE.'
|
||||
WHERE image_id = '.$row['id'].'
|
||||
;';
|
||||
$formats = query2array($query);
|
||||
|
||||
if (!empty($formats))
|
||||
{
|
||||
$format_strings = array();
|
||||
|
||||
foreach ($formats as $format)
|
||||
{
|
||||
$format_strings[] = sprintf('%s (%.2fMB)', $format['ext'], $format['filesize']/1024);
|
||||
}
|
||||
|
||||
$intro_vars['formats'] = l10n('Formats: %s', implode(', ', $format_strings));
|
||||
}
|
||||
|
||||
$template->assign('INTRO', $intro_vars);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user