MantisBT - Piwigo
View Issue Details
0002397Piwigodisplaypublic2011.08.09 16:572011.11.05 01:11
flop25 
plg 
normalfeaturehave not tried
closedfixed 
 
2.3.12.3.1 
any
Apache 1.3.x
0002397: Adding more fields for template usage for representative thumbnails
The tpl var for thumbnails are
  $tpl_var =
    array(
      'ID' => $row['id'],
      'TN_SRC' => get_thumbnail_url($row),
      'TN_ALT' => $row['file'],
      'TN_TITLE' => get_thumbnail_title($row),
      'URL' => $url,

   /* Fields for template-extension usage */
      'FILE_PATH' => $row['path'],
      'FILE_POSTED' => $row['date_available'],
      'FILE_CREATED' => $row['date_creation'],
      'FILE_DESC' => $row['comment'],
      'FILE_AUTHOR' => $row['author'],
      'FILE_HIT' => $row['hit'],
      'FILE_SIZE' => $row['filesize'],
      'FILE_WIDTH' => $row['width'],
      'FILE_HEIGHT' => $row['height'],
      'FILE_METADATE' => $row['date_metadata_update'],
      'FILE_HAS_HD' => ($row['has_high'] and $user['enabled_high']=='true') ?
                true:false, /* lack of include/functions_picture.inc.php */
    );
but for albums, the only info about the picture is :
          'TN_SRC' => $thumbnail_src_of[$category['representative_picture_id']],
          'TN_ALT' => strip_tags($category['name']),


Because it's painful to add these fields by an extension -I didn't succeed to retrieve the id of the representative picture- I suggest to add these fields in the core : it's very important for creating superior themes.

I'm not a specialist, but I think it will require one sql request to retrieve all these info in a row.
No tags attached.
Issue History
2011.08.09 16:57flop25New Issue
2011.08.09 16:57flop25browser => any
2011.08.09 16:57flop25Web server => Apache 1.3.x
2011.09.07 13:07flop25Description Updated
2011.11.02 10:35plgAssigned To => plg
2011.11.02 10:35plgStatusnew => assigned
2011.11.02 10:35plgTarget Version => 2.3.1
2011.11.03 11:52plgNote Added: 0005749
2011.11.03 15:12flop25Note Added: 0005750
2011.11.05 00:49svnCheckin
2011.11.05 00:49svnNote Added: 0005757
2011.11.05 00:54svnCheckin
2011.11.05 00:54svnNote Added: 0005758
2011.11.05 01:11plgStatusassigned => closed
2011.11.05 01:11plgResolutionopen => fixed
2011.11.05 01:11plgFixed in Version => 2.3.1

Notes
(0005749)
plg   
2011.11.03 11:52   
flop25, you confirm you want all these fields (path, posted, created, desc, author, hit, size, width, height, metadata_update, has_hd) corresponding to the album thumbnail only?
(0005750)
flop25   
2011.11.03 15:12   
Yes, for category_cats.inc.php

but I think it should be
 'FILE_HAS_HD' => $row['has_high']
instead of
 'FILE_HAS_HD' => ($row['has_high'] and $user['enabled_high']=='true') ?
                true:false, /* lack of include/functions_picture.inc.php */
-in category_default.inc.php too- because we can always check aposteriori the $user['enabled_high'] (imagine you want a link Download hover a thumbnail : it's not possible if the user disable HD, by using a simple tpl code. The deactivation of the HD has nothing to do with the existence of an HD file)
thx for helping me
(0005757)
svn   
2011.11.05 00:49   
[Subversion] r12545 by plg on branch 2.3

-----[Subversion commit log]----------------------------------------------------
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.
(0005758)
svn   
2011.11.05 00:54   
[Subversion] r12546 by plg on trunk

-----[Subversion commit log]----------------------------------------------------
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.