aboutsummaryrefslogtreecommitdiffstats
path: root/include/category_cats.inc.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2011-11-04 23:54:12 +0000
committerplegall <plg@piwigo.org>2011-11-04 23:54:12 +0000
commita808d23130a5afd2673d794d983f5071089d6d71 (patch)
treeb5f5401df7f132fb89e1cda42ec9a3586140e010 /include/category_cats.inc.php
parentee79c8516a31978e72be5aaa4cdb999ddc960871 (diff)
merge r12545 from branch 2.3 to trunk
feature 2397 added: add details about the album thumbnail for extra templates. Algorithm changed for FILE_HAS_HD : we don't care about the $user['enabled_high'] Fields added in category_default : high_filesize, high_width, high_height, rating_score We send the same fields on category_cats but for album thumbnail only. git-svn-id: http://piwigo.org/svn/trunk@12546 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/category_cats.inc.php')
-rw-r--r--include/category_cats.inc.php33
1 files changed, 27 insertions, 6 deletions
diff --git a/include/category_cats.inc.php b/include/category_cats.inc.php
index cdaddf8c6..a6a686477 100644
--- a/include/category_cats.inc.php
+++ b/include/category_cats.inc.php
@@ -176,11 +176,11 @@ if ($page['section']=='recent_cats')
}
if (count($categories) > 0)
{
- $thumbnail_src_of = array();
+ $infos_of_image = array();
$new_image_ids = array();
$query = '
-SELECT id, path, tn_ext, level
+SELECT *
FROM '.IMAGES_TABLE.'
WHERE id IN ('.implode(',', $image_ids).')
;';
@@ -189,7 +189,8 @@ SELECT id, path, tn_ext, level
{
if ($row['level'] <= $user['level'])
{
- $thumbnail_src_of[$row['id']] = get_thumbnail_url($row);
+ $row['tn_src'] = get_thumbnail_url($row);
+ $infos_of_image[$row['id']] = $row;
}
else
{
@@ -228,14 +229,15 @@ SELECT id, path, tn_ext, level
if (count($new_image_ids) > 0)
{
$query = '
-SELECT id, path, tn_ext
+SELECT *
FROM '.IMAGES_TABLE.'
WHERE id IN ('.implode(',', $new_image_ids).')
;';
$result = pwg_query($query);
while ($row = pwg_db_fetch_assoc($result))
{
- $thumbnail_src_of[$row['id']] = get_thumbnail_url($row);
+ $row['tn_src'] = get_thumbnail_url($row);
+ $infos_of_image[$row['id']] = $row;
}
}
}
@@ -304,10 +306,12 @@ if (count($categories) > 0)
$name = $category['name'];
}
+ $representative_infos = $infos_of_image[ $category['representative_picture_id'] ];
+
$tpl_var =
array(
'ID' => $category['id'],
- 'TN_SRC' => $thumbnail_src_of[$category['representative_picture_id']],
+ 'TN_SRC' => $representative_infos['tn_src'],
'TN_ALT' => strip_tags($category['name']),
'URL' => make_index_url(
@@ -329,6 +333,23 @@ if (count($categories) > 0)
@$category['comment'],
'subcatify_category_description')),
'NAME' => $name,
+
+ // Extra fields for usage in extra themes
+ 'FILE_PATH' => $representative_infos['path'],
+ 'FILE_POSTED' => $representative_infos['date_available'],
+ 'FILE_CREATED' => $representative_infos['date_creation'],
+ 'FILE_DESC' => $representative_infos['comment'],
+ 'FILE_AUTHOR' => $representative_infos['author'],
+ 'FILE_HIT' => $representative_infos['hit'],
+ 'FILE_SIZE' => $representative_infos['filesize'],
+ 'FILE_WIDTH' => $representative_infos['width'],
+ 'FILE_HEIGHT' => $representative_infos['height'],
+ 'FILE_METADATE' => $representative_infos['date_metadata_update'],
+ 'FILE_HAS_HD' => $representative_infos['has_high'],
+ 'FILE_HD_WIDTH' => $representative_infos['high_width'],
+ 'FILE_HD_HEIGHT' => $representative_infos['high_height'],
+ 'FILE_HD_FILESIZE' => $representative_infos['high_filesize'],
+ 'FILE_RATING_SCORE' => $representative_infos['rating_score'],
);
if ($conf['index_new_icon'])
{