Ignore:
Timestamp:
Jan 17, 2012, 7:09:32 AM (12 years ago)
Author:
rvelices
Message:

feature 2548 multisize - ability to choose displayed size on index page
-added some logs on i.php (configurable) to measure the perf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/category_default.inc.php

    r12887 r12908  
    33// | Piwigo - a PHP based photo gallery                                    |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2008-2011 Piwigo Team                  http://piwigo.org |
     5// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
    66// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
    77// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
     
    105105      );
    106106
    107   if (isset($nb_comments_of) )
     107  if (isset($nb_comments_of))
    108108  {
    109     $row['nb_comments'] = (int)@$nb_comments_of[$row['id']];
     109    $row['NB_COMMENTS'] = $row['nb_comments'] = (int)@$nb_comments_of[$row['id']];
    110110  }
    111111
    112112  $name = get_picture_title($row);
    113113
    114   $tpl_var = array(
    115     'ID' => $row['id'],
     114  $tpl_var = array_merge( $row, array(
    116115    'TN_SRC' => DerivativeImage::thumb_url($row),
    117116    'TN_ALT' => htmlspecialchars(strip_tags($name)),
    118117    'TN_TITLE' => get_thumbnail_title($row),
    119118    'URL' => $url,
     119    'src_image' => new SrcImage($row),
     120    ) );
    120121
    121     // Extra fields for usage in extra themes
    122     'FILE_PATH' => $row['path'],
    123     'FILE_POSTED' => $row['date_available'],
    124     'FILE_CREATED' => $row['date_creation'],
    125     'FILE_DESC' => $row['comment'],
    126     'FILE_AUTHOR' => $row['author'],
    127     'FILE_HIT' => $row['hit'],
    128     'FILE_SIZE' => $row['filesize'],
    129     'FILE_WIDTH' => $row['width'],
    130     'FILE_HEIGHT' => $row['height'],
    131     'FILE_METADATE' => $row['date_metadata_update'],
    132     'FILE_HAS_HD' => $row['has_high'],
    133     'FILE_HD_WIDTH' => $row['high_width'],
    134     'FILE_HD_HEIGHT' => $row['high_height'],
    135     'FILE_HD_FILESIZE' => $row['high_filesize'],
    136     'FILE_RATING_SCORE' => $row['rating_score'],
    137     );
    138  
    139122  if ($conf['index_new_icon'])
    140123  {
     
    146129    $tpl_var['NB_HITS'] = $row['hit'];
    147130  }
    148  
     131
    149132  switch ($page['section'])
    150133  {
     
    163146    }
    164147  }
    165  
     148
    166149  $tpl_var['NAME'] = $name;
    167 
    168   if (isset($row['nb_comments']))
    169   {
    170     $tpl_var['NB_COMMENTS'] = $row['nb_comments'];
    171   }
    172 
    173150  $tpl_thumbnails_var[] = $tpl_var;
    174151}
    175152
    176 $template->assign('SHOW_THUMBNAIL_CAPTION', $conf['show_thumbnail_caption']);
     153$derivative_params = ImageStdParams::get_by_type( pwg_get_session_var('index_deriv', IMG_THUMB) );
     154
     155$template->assign( array(
     156  'derivative_params' =>$derivative_params,
     157  'SHOW_THUMBNAIL_CAPTION' =>$conf['show_thumbnail_caption'],
     158    ) );
    177159$tpl_thumbnails_var = trigger_event('loc_end_index_thumbnails', $tpl_thumbnails_var, $pictures);
    178160$template->assign('thumbnails', $tpl_thumbnails_var);
    179161
    180162$template->assign_var_from_handle('THUMBNAILS', 'index_thumbnails');
    181 
     163unset($pictures, $selection, $tpl_thumbnails_var);
     164$template->clear_assign( array('thumbnails') );
    182165pwg_debug('end include/category_default.inc.php');
    183166?>
Note: See TracChangeset for help on using the changeset viewer.