Changeset 18165
- Timestamp:
- Sep 23, 2012, 1:19:26 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/configuration.php
r18164 r18165 223 223 case 'display' : 224 224 { 225 if (!preg_match($int_pattern, $_POST['nb_categories_page']) 226 or $_POST['nb_categories_page'] < 4) 227 { 228 array_push($page['errors'], l10n('The number of albums a page must be above 4.')); 229 } 225 230 foreach( $display_checkboxes as $checkbox) 226 231 { … … 423 428 'display', 424 429 array( 425 'picture_informations' => unserialize($conf['picture_informations']) 430 'picture_informations' => unserialize($conf['picture_informations']), 431 'NB_CATEGORIES_PAGE' => $conf['nb_categories_page'], 426 432 ), 427 433 true -
trunk/admin/themes/default/template/configuration.tpl
r18164 r18165 646 646 </label> 647 647 </li> 648 649 <li> 650 <label> 651 {'Number of albums per page'|@translate} 652 <input type="text" size="3" maxlength="4" name="nb_categories_page" id="nb_categories_page" value="{$display.NB_CATEGORIES_PAGE}"> 653 </label> 654 </li> 648 655 </ul> 649 656 </fieldset> -
trunk/include/category_cats.inc.php
r12930 r18165 23 23 24 24 /** 25 * This file is included by the main page to show thumbnails fora category26 * that have only subcategories or to show recent categories25 * This file is included by the main page to show subcategories of a category 26 * or to show recent categories or main page categories list 27 27 * 28 28 */ 29 30 $selection = array_slice( 31 $page['categories'], 32 $page['starta'], 33 $conf['nb_categories_page'] 34 ); 35 36 $selection = trigger_event('loc_index_categories_selection', $selection); 29 37 30 38 // $user['forbidden_categories'] including with USER_CACHE_CATEGORIES_TABLE … … 39 47 count_categories 40 48 FROM '.CATEGORIES_TABLE.' c 41 INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' ucc ON id = cat_id AND user_id = '.$user['id']; 42 43 if ('recent_cats' == $page['section']) 44 { 45 $query.= ' 46 WHERE date_last >= '.pwg_db_get_recent_period_expression($user['recent_period']); 47 } 48 else 49 { 50 $query.= ' 51 WHERE id_uppercat '.(!isset($page['category']) ? 'is NULL' : '= '.$page['category']['id']); 52 } 53 54 $query.= ' 55 '.get_sql_condition_FandF( 56 array( 57 'visible_categories' => 'id', 58 ), 59 'AND' 60 ); 61 49 INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' ucc 50 ON id = cat_id 51 AND user_id = '.$user['id'].' 52 WHERE c.id IN('.implode(',', $selection).')'; 53 62 54 if ('recent_cats' != $page['section']) 63 55 { -
trunk/include/functions.inc.php
r18164 r18165 1430 1430 * return an array which will be sent to template to display navigation bar 1431 1431 */ 1432 function create_navigation_bar($url, $nb_element, $start, $nb_element_page, $clean_url = false )1432 function create_navigation_bar($url, $nb_element, $start, $nb_element_page, $clean_url = false, $param_name='start') 1433 1433 { 1434 1434 global $conf; … … 1436 1436 $navbar = array(); 1437 1437 $pages_around = $conf['paginate_pages_around']; 1438 $start_str = $clean_url ? '/ start-' : (strpos($url, '?')===false ? '?':'&').'start=';1438 $start_str = $clean_url ? '/'.$param_name.'-' : (strpos($url, '?')===false ? '?':'&').$param_name.'='; 1439 1439 1440 1440 if (!isset($start) or !is_numeric($start) or (is_numeric($start) and $start < 0)) -
trunk/include/functions_url.inc.php
r15383 r18165 459 459 and strpos($tokens[$current_token], 'posted-')!==0 460 460 and strpos($tokens[$next_token], 'start-')!==0 461 and strpos($tokens[$next_token], 'starta-')!==0 461 462 and $tokens[$current_token] != 'flat') 462 463 { … … 652 653 $page['start'] = $matches[1]; 653 654 } 655 elseif (preg_match('/^starta-(\d+)/', $tokens[$i], $matches)) 656 { 657 $page['starta'] = $matches[1]; 658 } 654 659 $i++; 655 660 } -
trunk/include/section_init.inc.php
r13872 r18165 42 42 // ); 43 43 44 $page['items'] = array(); 44 // exemple of dynamic nb_categories_page (%2 for nice display) 45 // $conf['nb_categories_page'] = 2*round($user['nb_image_page']/4); 46 47 $page['items'] = $page['categories'] = array(); 48 $page['start'] = $page['starta'] = 0; 45 49 46 50 // some ISPs set PATH_INFO to empty string or to SCRIPT_FILENAME while in the … … 247 251 $page['title'] = ''; // will be set later 248 252 253 254 // GET IMAGES LIST 249 255 if 250 256 ( 257 $page['starta'] == 0 and 251 258 (!isset($page['chronology_field'])) and 252 259 ( … … 311 318 $page['items'] = array_from_query($query, 'image_id'); 312 319 } //otherwise the calendar will requery all subitems 320 321 // GET CATEGORIES LIST 322 if ( 0==$page['start'] 323 and !isset($page['flat']) 324 and !isset($page['chronology_field']) 325 and ('recent_cats'==$page['section'] or 'categories'==$page['section']) 326 and (!isset($page['category']['count_categories']) or $page['category']['count_categories']>0 ) 327 ) 328 { 329 $query = ' 330 SELECT c.id 331 FROM '.CATEGORIES_TABLE.' c 332 INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' ucc 333 ON id = cat_id 334 AND user_id = '.$user['id']; 335 336 if ('recent_cats' == $page['section']) 337 { 338 $query.= ' 339 WHERE date_last >= '.pwg_db_get_recent_period_expression($user['recent_period']); 340 } 341 else 342 { 343 $query.= ' 344 WHERE id_uppercat '.(!isset($page['category']) ? 'is NULL' : '= '.$page['category']['id']); 345 } 346 347 $query.= ' 348 '.get_sql_condition_FandF( 349 array('visible_categories' => 'id'), 350 'AND' 351 ); 352 353 $query.= ' 354 ;'; 355 356 $page['categories'] = array_from_query($query, 'id'); 357 } 313 358 } 314 359 // special sections -
trunk/index.php
r16987 r18165 30 30 check_status(ACCESS_GUEST); 31 31 32 if (!isset($page['start']))33 {34 $page['start'] = 0;35 }36 32 37 33 // access authorization check … … 75 71 //-------------------------------------------------------------- initialization 76 72 73 // navigation bar 77 74 $page['navigation_bar'] = array(); 78 75 if (count($page['items']) > $page['nb_image_page']) … … 83 80 $page['start'], 84 81 $page['nb_image_page'], 85 true 86 ); 87 } 82 true, 'start' 83 ); 84 } 85 86 $page['cats_navigation_bar'] = array(); 87 if (count($page['categories']) > $conf['nb_categories_page']) 88 { 89 $page['cats_navigation_bar'] = create_navigation_bar( 90 duplicate_index_url(array(), array('starta')), 91 count($page['categories']), 92 $page['starta'], 93 $conf['nb_categories_page'], 94 true, 'starta' 95 ); 96 } 97 98 $template->assign( 'thumb_navbar', $page['navigation_bar'] ); 99 $template->assign( 'cats_navbar', $page['cats_navigation_bar'] ); 88 100 89 101 // caddie filling :-) … … 243 255 } 244 256 245 // navigation bar246 $template->assign( 'navbar', $page['navigation_bar'] );247 257 248 258 if ( $conf['index_sort_order_input'] … … 289 299 290 300 //------------------------------------------------------ main part : thumbnails 291 if ( 0==$page['start'] 292 and !isset($page['flat']) 293 and !isset($page['chronology_field']) 294 and ('recent_cats'==$page['section'] or 'categories'==$page['section']) 295 and (!isset($page['category']['count_categories']) or $page['category']['count_categories']>0 ) 296 ) 301 if ( !empty($page['categories']) ) 297 302 { 298 303 include(PHPWG_ROOT_PATH.'include/category_cats.inc.php'); -
trunk/install/config.sql
r18164 r18165 22 22 INSERT INTO piwigo_config (param,value,comment) VALUES ('allow_user_registration','true','allow visitors to register?'); 23 23 INSERT INTO piwigo_config (param,value,comment) VALUES ('allow_user_customization','true','allow users to customize their gallery?'); 24 INSERT INTO piwigo_config (param,value,comment) VALUES ('nb_categories_page','12'); 24 25 INSERT INTO piwigo_config (param,value,comment) VALUES ('nbm_send_html_mail','true','Send mail on HTML format for notification by mail'); 25 26 INSERT INTO piwigo_config (param,value,comment) VALUES ('nbm_send_mail_as','','Send mail as param value for notification by mail'); -
trunk/language/en_UK/admin.lang.php
r18080 r18165 539 539 $lang['Notify administrators when a comment is'] = 'Notify administrators when a comment is'; 540 540 $lang['Number of comments per page'] = "Number of comments per page"; 541 $lang['Number of albums per page'] = 'Number of albums per page'; 541 542 $lang['Number of downloads'] = "Number of downloads"; 542 543 $lang['number of miniaturized photos'] = "number of thumbnails created"; -
trunk/language/fr_FR/admin.lang.php
r18080 r18165 937 937 $lang['Manage photos'] = 'Gérer les photos'; 938 938 $lang['View in gallery'] = 'Voir dans la galerie'; 939 $lang['Number of albums per page'] = 'Nombre d\'albums par page'; 939 940 ?> -
trunk/themes/default/template/index.tpl
r14180 r18165 164 164 165 165 {if !empty($CATEGORIES)}{$CATEGORIES}{/if} 166 {if !empty($cats_navbar)} 167 {assign var=navbar value=$cats_navbar} 168 {include file='navigation_bar.tpl'|@get_extent:'navbar'} 169 {/if} 170 166 171 {if !empty($THUMBNAILS)} 167 172 <ul class="thumbnails" id="thumbnails"> … … 169 174 </ul> 170 175 {/if} 171 172 {if !empty($navbar)}{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if} 176 {if !empty($thumb_navbar)} 177 {assign var=navbar value=$thumb_navbar} 178 {include file='navigation_bar.tpl'|@get_extent:'navbar'} 179 {/if} 173 180 174 181 {if !empty($PLUGIN_INDEX_CONTENT_END)}{$PLUGIN_INDEX_CONTENT_END}{/if}
Note: See TracChangeset
for help on using the changeset viewer.