Changeset 13545 for trunk/themes/smartpocket/themeconf.inc.php
- Timestamp:
- Mar 14, 2012, 9:19:25 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/themes/smartpocket/themeconf.inc.php
r13234 r13545 13 13 ); 14 14 15 // Redirect if page is not compatible with mobile theme 16 if (!in_array(script_basename(), array('index', 'register', 'profile', 'identification'))) 17 redirect(duplicate_index_url()); 18 15 19 //Retrive all pictures on thumbnails page 16 20 add_event_handler('loc_index_thumbnails_selection', 'sp_select_all_thumbnails'); … … 25 29 } 26 30 31 // Get better derive parameters for screen size 32 if (!empty($_COOKIE['screen_size'])) 33 { 34 $screen_size = explode('x', $_COOKIE['screen_size']); 35 $derivative_params = new ImageStdParams; 36 $derivative_params->load_from_db(); 37 $type = IMG_LARGE; 38 39 foreach ($derivative_params->get_all_type_map() as $type => $map) 40 { 41 if (max($map->sizing->ideal_size) >= max($screen_size) and min($map->sizing->ideal_size) >= min($screen_size)) 42 break; 43 } 44 pwg_set_session_var('sp_picture_deriv', $type); 45 } 46 47 $this->assign('picture_derivative_params', ImageStdParams::get_by_type(pwg_get_session_var('sp_picture_deriv', IMG_LARGE))); 48 $this->assign('thumbnail_derivative_params', ImageStdParams::get_by_type(IMG_SQUARE)); 49 27 50 ?>
Note: See TracChangeset
for help on using the changeset viewer.