From e693ef60cd8f79e11ae4de3ba2f7494a72fc35c2 Mon Sep 17 00:00:00 2001 From: rvelices Date: Tue, 17 Jan 2012 06:09:32 +0000 Subject: feature 2548 multisize - ability to choose displayed size on index page -added some logs on i.php (configurable) to measure the perf git-svn-id: http://piwigo.org/svn/trunk@12908 68402e56-0260-453c-a942-63ccdbb3a9ee --- index.php | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'index.php') diff --git a/index.php b/index.php index ffabff88b..0af394c66 100644 --- a/index.php +++ b/index.php @@ -2,7 +2,7 @@ // +-----------------------------------------------------------------------+ // | Piwigo - a PHP based photo gallery | // +-----------------------------------------------------------------------+ -// | Copyright(C) 2008-2011 Piwigo Team http://piwigo.org | +// | Copyright(C) 2008-2012 Piwigo Team http://piwigo.org | // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | // +-----------------------------------------------------------------------+ @@ -60,6 +60,14 @@ if (isset($_GET['image_order'])) ) ); } +if (isset($_GET['display'])) +{ + $page['meta_robots']['noindex']=1; + if (array_key_exists($_GET['display'], ImageStdParams::get_defined_type_map())) + { + pwg_set_session_var('index_deriv', $_GET['display']); + } +} //-------------------------------------------------------------- initialization $page['navigation_bar'] = array(); @@ -252,6 +260,28 @@ if ( $conf['index_sort_order_input'] } } +if ( count($page['items']) > 0 ) +{ + $url = add_url_params( + duplicate_index_url(), + array('display' => '') + ); + $selected_type = pwg_get_session_var('index_deriv', IMG_THUMB); + $type_map = ImageStdParams::get_defined_type_map(); + unset($type_map[IMG_XXLARGE], $type_map[IMG_XLARGE]); + foreach($type_map as $params) + { + $template->append( + 'image_derivatives', + array( + 'DISPLAY' => l10n($params->type), + 'URL' => $url.$params->type, + 'SELECTED' => ($params->type == $selected_type ? true:false), + ) + ); + } +} + // category comment if ($page['start']==0 and !isset($page['chronology_field']) and !empty($page['comment']) ) { -- cgit v1.2.3