From cc01941ed97f6c8f6790931bfc167ba45c5a8f91 Mon Sep 17 00:00:00 2001 From: rvelices Date: Tue, 17 Jan 2012 21:58:18 +0000 Subject: feature 2548 multisize - code cleanup + better usage in category_cats + i.php logs memory usage peak git-svn-id: http://piwigo.org/svn/trunk@12920 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/category_default.inc.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'include/category_default.inc.php') diff --git a/include/category_default.inc.php b/include/category_default.inc.php index 18a4cb4bf..454d1e1e5 100644 --- a/include/category_default.inc.php +++ b/include/category_default.inc.php @@ -109,13 +109,15 @@ foreach ($pictures as $row) $row['NB_COMMENTS'] = $row['nb_comments'] = (int)@$nb_comments_of[$row['id']]; } - $name = get_picture_title($row); + $name = render_element_name($row); + $desc = render_element_description($row); $tpl_var = array_merge( $row, array( 'TN_SRC' => DerivativeImage::thumb_url($row), 'TN_ALT' => htmlspecialchars(strip_tags($name)), - 'TN_TITLE' => get_thumbnail_title($row), + 'TN_TITLE' => get_thumbnail_title($row, $name, $desc), 'URL' => $url, + 'DESCRIPTION' => $desc, 'src_image' => new SrcImage($row), ) ); @@ -145,12 +147,11 @@ foreach ($pictures as $row) break; } } - $tpl_var['NAME'] = $name; $tpl_thumbnails_var[] = $tpl_var; } -$derivative_params = ImageStdParams::get_by_type( pwg_get_session_var('index_deriv', IMG_THUMB) ); +$derivative_params = trigger_event('get_index_derivative_params', ImageStdParams::get_by_type( pwg_get_session_var('index_deriv', IMG_THUMB) ) ); $template->assign( array( 'derivative_params' =>$derivative_params, @@ -161,6 +162,6 @@ $template->assign('thumbnails', $tpl_thumbnails_var); $template->assign_var_from_handle('THUMBNAILS', 'index_thumbnails'); unset($pictures, $selection, $tpl_thumbnails_var); -$template->clear_assign( array('thumbnails') ); +$template->clear_assign( array('thumbnails', 'derivative_params') ); pwg_debug('end include/category_default.inc.php'); ?> \ No newline at end of file -- cgit v1.2.3