Changeset 15299


Ignore:
Timestamp:
May 25, 2012, 1:12:04 AM (13 years ago)
Author:
plg
Message:

feature 2633 added: ability to select default size

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/config_default.inc.php

    r15228 r15299  
    761761
    762762$conf['chmod_value']= substr_compare(PHP_SAPI, 'apa', 0, 3)==0 ? 0777 : 0755;
     763
     764// 'small', 'medium' or 'large'
     765$conf['derivative_default_size'] = 'medium';
    763766?>
  • trunk/picture.php

    r13865 r15299  
    150150function default_picture_content($content, $element_info)
    151151{
     152  global $conf;
     153 
    152154  if ( !empty($content) )
    153155  {// someone hooked us - so we skip;
     
    163165    setcookie('picture_deriv', false, 0, cookie_path() );
    164166  }
    165   $deriv_type = pwg_get_session_var('picture_deriv', IMG_LARGE);
     167  $deriv_type = pwg_get_session_var('picture_deriv', $conf['derivative_default_size']);
    166168  $selected_derivative = $element_info['derivatives'][$deriv_type];
    167169
     
    939941    and strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome/') === false)
    940942{
    941   $template->assign('U_PREFETCH', $picture['next']['derivatives'][pwg_get_session_var('picture_deriv', IMG_LARGE)]->get_url() );
    942 }
    943 
    944 $template->assign('U_CANONICAL', make_picture_url( array('image_id'=>$picture['current']['id'], 'image_file'=>$picture['current']['file']) ) );
     943  $template->assign(
     944    'U_PREFETCH',
     945    $picture['next']['derivatives'][pwg_get_session_var('picture_deriv', $conf['derivative_default_size'])]->get_url()
     946    );
     947}
     948
     949$template->assign(
     950  'U_CANONICAL',
     951  make_picture_url(
     952    array(
     953      'image_id' => $picture['current']['id'],
     954      'image_file' => $picture['current']['file'])
     955    )
     956  );
    945957
    946958// +-----------------------------------------------------------------------+
Note: See TracChangeset for help on using the changeset viewer.