aboutsummaryrefslogtreecommitdiffstats
path: root/include/section_init.inc.php
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2012-10-04 15:03:55 +0000
committermistic100 <mistic@piwigo.org>2012-10-04 15:03:55 +0000
commitb1cec7bf86b84296acc97ffed090bf1686964420 (patch)
tree9525c06648ec2cc90a401efc06974a0b24198294 /include/section_init.inc.php
parentb5f020ee66b13bce8275a4d64faf8710c362a6d1 (diff)
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" git-svn-id: http://piwigo.org/svn/trunk@18462 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/section_init.inc.php47
1 files changed, 3 insertions, 44 deletions
diff --git a/include/section_init.inc.php b/include/section_init.inc.php
index dc58b9a2e..138b16cec 100644
--- a/include/section_init.inc.php
+++ b/include/section_init.inc.php
@@ -41,11 +41,9 @@
// 'start' => 24
// );
-// exemple of dynamic nb_categories_page (%2 for nice display)
-// $conf['nb_categories_page'] = 2*round($user['nb_image_page']/4);
-$page['items'] = $page['categories'] = array();
-$page['start'] = $page['starta'] = 0;
+$page['items'] = array();
+$page['start'] = $page['startcat'] = 0;
// some ISPs set PATH_INFO to empty string or to SCRIPT_FILENAME while in the
// default apache implementation it is not set
@@ -254,7 +252,7 @@ if ('categories' == $page['section'])
// GET IMAGES LIST
if
(
- $page['starta'] == 0 and
+ $page['startcat'] == 0 and
(!isset($page['chronology_field'])) and
(
(isset($page['category'])) or
@@ -317,45 +315,6 @@ SELECT DISTINCT(image_id)
$page['items'] = array_from_query($query, 'image_id');
} //otherwise the calendar will requery all subitems
-
- // GET CATEGORIES LIST
- if ( script_basename()=='index'
- and 0==$page['start']
- and !isset($page['flat'])
- and !isset($page['chronology_field'])
- and ('recent_cats'==$page['section'] or 'categories'==$page['section'])
- and (!isset($page['category']['count_categories']) or $page['category']['count_categories']>0 )
- )
- {
- $query = '
-SELECT c.id
- FROM '.CATEGORIES_TABLE.' c
- INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' ucc
- ON id = cat_id
- AND user_id = '.$user['id'];
-
- if ('recent_cats' == $page['section'])
- {
- $query.= '
- WHERE date_last >= '.pwg_db_get_recent_period_expression($user['recent_period']);
- }
- else
- {
- $query.= '
- WHERE id_uppercat '.(!isset($page['category']) ? 'is NULL' : '= '.$page['category']['id']);
- }
-
- $query.= '
- '.get_sql_condition_FandF(
- array('visible_categories' => 'id'),
- 'AND'
- );
-
- $query.= '
- ;';
-
- $page['categories'] = array_from_query($query, 'id');
- }
}
// special sections
else