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:
plegall
2015-12-03 16:04:02 +01:00
parent 27389102d1
commit 8e098d502a
10 changed files with 191 additions and 0 deletions
+19
View File
@@ -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);