Ignore:
Timestamp:
Oct 4, 2012, 5:03:55 PM (12 years ago)
Author:
mistic100
Message:

feature:2614 pagination on albums
return to old fashioned way (one query in category_cats), restoring recent_cats feature and "menubar optimization", rename "starta" into "startcat"

File:
1 edited

Legend:

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

    r18392 r18462  
    4242//   );
    4343
    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;
     44
     45$page['items'] = array();
     46$page['start'] = $page['startcat'] = 0;
    4947
    5048// some ISPs set PATH_INFO to empty string or to SCRIPT_FILENAME while in the
     
    255253  if
    256254    (
    257       $page['starta'] == 0 and
     255      $page['startcat'] == 0 and
    258256      (!isset($page['chronology_field'])) and
    259257      (
     
    318316    $page['items'] = array_from_query($query, 'image_id');
    319317  } //otherwise the calendar will requery all subitems
    320  
    321   // GET CATEGORIES LIST
    322   if ( script_basename()=='index'
    323     and 0==$page['start']
    324     and !isset($page['flat'])
    325     and !isset($page['chronology_field'])
    326     and ('recent_cats'==$page['section'] or 'categories'==$page['section'])
    327     and (!isset($page['category']['count_categories']) or $page['category']['count_categories']>0 )
    328   )
    329   {
    330     $query = '
    331 SELECT c.id
    332   FROM '.CATEGORIES_TABLE.' c
    333     INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' ucc
    334     ON id = cat_id
    335     AND user_id = '.$user['id'];
    336 
    337     if ('recent_cats' == $page['section'])
    338     {
    339       $query.= '
    340       WHERE date_last >= '.pwg_db_get_recent_period_expression($user['recent_period']);
    341     }
    342     else
    343     {
    344       $query.= '
    345       WHERE id_uppercat '.(!isset($page['category']) ? 'is NULL' : '= '.$page['category']['id']);
    346     }
    347 
    348     $query.= '
    349         '.get_sql_condition_FandF(
    350           array('visible_categories' => 'id'),
    351           'AND'
    352           );
    353 
    354     $query.= '
    355     ;';
    356 
    357     $page['categories'] = array_from_query($query, 'id');
    358   }
    359318}
    360319// special sections
Note: See TracChangeset for help on using the changeset viewer.