aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2007-02-15 00:10:41 +0000
committerrvelices <rv-github@modusoptimus.com>2007-02-15 00:10:41 +0000
commit11714951b33d340f13400aa8fc9a2b971f8d8e8b (patch)
tree4baaeddd0b5b697b99fea5b45c99ac098a69dee2 /index.php
parentb39e05fd5a1c9ea95aab7ee35902dfbc5c3d924a (diff)
- feature 642: display both subcategory thumbnails and element thumbnails (if a
category has both) in the index page - get rid of $page['cat_nb_images'] and $page['thumbnails_include'] (superfluous) - changed sql queries in section_init.inc.php for better performance with flat category view - web service fixes for categories.getList git-svn-id: http://piwigo.org/svn/trunk@1820 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--index.php23
1 files changed, 15 insertions, 8 deletions
diff --git a/index.php b/index.php
index 24dbc20e3..e138e4681 100644
--- a/index.php
+++ b/index.php
@@ -68,12 +68,11 @@ if (isset($page['category']))
check_restrictions($page['category']);
}
-if (isset($page['cat_nb_images'])
- and $page['cat_nb_images'] > $user['nb_image_page'])
+if ( count($page['items']) > $user['nb_image_page'])
{
$page['navigation_bar'] = create_navigation_bar(
duplicate_index_url(array(), array('start')),
- $page['cat_nb_images'],
+ count($page['items']),
$page['start'],
$user['nb_image_page'],
true
@@ -101,9 +100,9 @@ $page['body_id'] = 'theCategoryPage';
$template->set_filenames( array('index'=>'index.tpl') );
//-------------------------------------------------------------- category title
$template_title = $page['title'];
-if (isset($page['cat_nb_images']) and $page['cat_nb_images'] > 0)
+if ( count($page['items']) > 0)
{
- $template_title.= ' ['.$page['cat_nb_images'].']';
+ $template_title.= ' ['.count($page['items']).']';
}
if (isset($page['flat']) or isset($page['chronology_field']))
@@ -241,9 +240,17 @@ if ( $page['section']=='search' and $page['start']==0 )
}
//------------------------------------------------------ main part : thumbnails
-if (isset($page['thumbnails_include']))
+if ( 0==$page['start']
+ and !isset($page['flat'])
+ and !isset($page['chronology_field'])
+ and ('recent_cats'==$page['section'] or 'categories'==$page['section'])
+ )
{
- include(PHPWG_ROOT_PATH.$page['thumbnails_include']);
+ include(PHPWG_ROOT_PATH.'include/category_cats.inc.php');
+}
+if ( !empty($page['items']) )
+{
+ include(PHPWG_ROOT_PATH.'include/category_default.inc.php');
}
//------------------------------------------------------- category informations
@@ -258,7 +265,7 @@ if ($page['navigation_bar'] != '')
);
}
-if (isset($page['cat_nb_images']) and $page['cat_nb_images'] > 0
+if ( count($page['items']) > 0
and $page['section'] != 'most_visited'
and $page['section'] != 'best_rated')
{