aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2012-01-17 06:09:32 +0000
committerrvelices <rv-github@modusoptimus.com>2012-01-17 06:09:32 +0000
commite693ef60cd8f79e11ae4de3ba2f7494a72fc35c2 (patch)
treedb901414e97e48d4830d53af6c676fe5373da3ef /index.php
parentb18e3c8a803b15fc72f95791072220afb23f46bf (diff)
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
Diffstat (limited to '')
-rw-r--r--index.php32
1 files changed, 31 insertions, 1 deletions
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']) )
{