Changeset 12908 for trunk/index.php


Ignore:
Timestamp:
Jan 17, 2012, 7:09:32 AM (13 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/index.php

    r12553 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 |
     
    6161    );
    6262}
     63if (isset($_GET['display']))
     64{
     65  $page['meta_robots']['noindex']=1;
     66  if (array_key_exists($_GET['display'], ImageStdParams::get_defined_type_map()))
     67  {
     68    pwg_set_session_var('index_deriv', $_GET['display']);
     69  }
     70}
    6371//-------------------------------------------------------------- initialization
    6472
     
    253261}
    254262
     263if ( count($page['items']) > 0 )
     264{
     265  $url = add_url_params(
     266          duplicate_index_url(),
     267          array('display' => '')
     268        );
     269  $selected_type = pwg_get_session_var('index_deriv', IMG_THUMB);
     270  $type_map = ImageStdParams::get_defined_type_map();
     271  unset($type_map[IMG_XXLARGE], $type_map[IMG_XLARGE]);
     272  foreach($type_map as $params)
     273  {
     274    $template->append(
     275      'image_derivatives',
     276      array(
     277        'DISPLAY' => l10n($params->type),
     278        'URL' => $url.$params->type,
     279        'SELECTED' => ($params->type == $selected_type ? true:false),
     280        )
     281      );
     282  }
     283}
     284
    255285// category comment
    256286if ($page['start']==0 and !isset($page['chronology_field']) and !empty($page['comment']) )
Note: See TracChangeset for help on using the changeset viewer.