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
This commit is contained in:
rvelices
2012-01-17 06:09:32 +00:00
parent b18e3c8a80
commit e693ef60cd
18 changed files with 183 additions and 55 deletions
+31 -1
View File
@@ -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']) )
{