Changeset 6718 for extensions/rv_thumbs/trunk/main.inc.php
- Timestamp:
- Jul 28, 2010, 1:54:27 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/rv_thumbs/trunk/main.inc.php
r4207 r6718 1 1 <?php /* 2 2 Plugin Name: RV Thumbs 3 Version: 2. 0.c3 Version: 2.1.a 4 4 Description: Let users see a variable number of thumbnails on index page 5 5 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=261 … … 22 22 { 23 23 case 'more': 24 $multiplier = ($multiplier==1) ? 4 : $multiplier*2; 25 $multiplier = min($multiplier, ceil(RV_THUMBS_MAX/$page['nb_image_page'])); 24 if (count($page['items']) > $page['nb_image_page'] * $multiplier) 25 { 26 $multiplier = ($multiplier==1) ? 4 : $multiplier*2; 27 $multiplier = min($multiplier, ceil(RV_THUMBS_MAX/$page['nb_image_page'])); 28 } 26 29 break; 27 30 case 'less': … … 44 47 global $user, $template, $page; 45 48 $multiplier = pwg_get_session_var('idx_thumbs_muliplier', 1); 46 $ nav_bar = & $template->get_template_vars('NAV_BAR');49 $title = & $template->get_template_vars('TITLE'); 47 50 $ini_per_page = $user['nb_image_page']; 48 51 $has_less = $multiplier>1 && count($page['items'])>$ini_per_page; 49 $has_more = !empty($ nav_bar) && $multiplier < ceil(RV_THUMBS_MAX/$ini_per_page );52 $has_more = !empty($page['navigation_bar']) && $multiplier < ceil(RV_THUMBS_MAX/$ini_per_page ); 50 53 if ($has_less || $has_more) 51 54 { 52 55 global $lang_info, $conf; if ($lang_info['code']!='en' or $conf['debug_l10n']) load_language( 'lang', dirname(__FILE__).'/' ); 53 $css = 'background:url('.get_root_url().'plugins/rv_thumbs/sprite.gif) no-repeat top left; height:15px; width:17px; padding:0 15px 1px 0; display:inline; background-position:center ';54 $fmt_link = '<a href="%s" rel="nofollow" style="border:none "><div style="'.$css.'%spx;" title="%s"> </div></a>';56 $css = 'background:url('.get_root_url().'plugins/rv_thumbs/sprite.gif) no-repeat top left; height:15px; width:17px; padding:0 5px 1px 0; display:inline-block; background-position:center '; 57 $fmt_link = '<a href="%s" rel="nofollow" style="border:none; margin:0;"><div style="'.$css.'%spx;" title="%s"> </div></a>'; 55 58 $fmt = '<div style="'.$css.'%spx; cursor:default" title="%s"> </div>'; 56 $bar = '<span style="margin-left:10px; ">';59 $bar = '<span style="margin-left:10px;vertical-align:middle;">'; 57 60 if ($has_less) 58 61 $bar .= sprintf( $fmt_link, add_url_params(duplicate_index_url(), array('thumbs'=>'less')), -39, l10n('Show less thumbnails') ); … … 64 67 $bar .= sprintf( $fmt, -21, l10n('Show more thumbnails') ); 65 68 $bar .= '</span>'; 66 $ nav_bar .= ( !empty($nav_bar) ? ' ' : '' ) .$bar;69 $title .= $bar; 67 70 } 68 71 }
Note: See TracChangeset
for help on using the changeset viewer.