diff options
Diffstat (limited to '')
-rw-r--r-- | include/functions_calendar.inc.php | 5 | ||||
-rw-r--r-- | include/section_init.inc.php | 16 |
2 files changed, 7 insertions, 14 deletions
diff --git a/include/functions_calendar.inc.php b/include/functions_calendar.inc.php index f8bec93e0..1c86c679e 100644 --- a/include/functions_calendar.inc.php +++ b/include/functions_calendar.inc.php @@ -37,7 +37,6 @@ function initialize_calendar() if ($page['section']=='categories' or ( isset($page['category']) and is_numeric($page['category']) ) ) { // we will regenerate the items by including subcats elements - $page['cat_nb_images'] = 0; $page['items'] = array(); $inner_sql .= ' INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON id = image_id'; @@ -186,8 +185,7 @@ WHERE id IN (' . implode(',',$page['items']) .')'; { unset( $page['thumbnails_include'], - $page['items'], - $page['cat_nb_images'] + $page['items'] ); $must_show_list = false; @@ -270,7 +268,6 @@ WHERE id IN (' . implode(',',$page['items']) .')'; } $page['items'] = array_from_query($query, 'id'); - $page['cat_nb_images'] = count($page['items']); $page['thumbnails_include'] = 'include/category_default.inc.php'; } pwg_debug('end initialize_calendar'); diff --git a/include/section_init.inc.php b/include/section_init.inc.php index 176ebf0f0..e22979e69 100644 --- a/include/section_init.inc.php +++ b/include/section_init.inc.php @@ -2,7 +2,7 @@ // +-----------------------------------------------------------------------+ // | PhpWebGallery - a PHP based picture gallery | // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | -// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net | +// | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net | // +-----------------------------------------------------------------------+ // | branch : BSF (Best So Far) // | file : $Id$ @@ -298,7 +298,6 @@ if ('categories' == $page['section']) 'comment' => $result['comment'], 'cat_dir' => $result['dir'], 'cat_name' => $result['name'], - 'cat_nb_images' => $result['nb_images'], 'cat_site_id' => $result['site_id'], 'cat_uploadable' => $result['uploadable'], 'cat_commentable' => $result['commentable'], @@ -364,9 +363,10 @@ else { $query = ' SELECT image_id - FROM '.IMAGE_CATEGORY_TABLE.' + FROM '.IMAGE_CATEGORY_TABLE.' INNER JOIN '.IMAGES_TABLE.' ON image_id=id WHERE image_id IN ('.implode(',', $items).') - AND '.$forbidden.' + AND '.$forbidden. + $conf['order_by'].' ;'; $items = array_unique( array_from_query($query, 'image_id') @@ -511,7 +511,6 @@ SELECT DISTINCT(id) $page, array( 'title' => $lang['recent_cats_cat'], - 'cat_nb_images' => 0, 'thumbnails_include' => 'include/category_recent_cats.inc.php', ) ); @@ -591,11 +590,6 @@ SELECT DISTINCT(id) ) ); } - - if (!isset($page['cat_nb_images'])) - { - $page['cat_nb_images'] = count($page['items']); - } } // +-----------------------------------------------------------------------+ @@ -608,6 +602,8 @@ if (isset($page['chronology_field'])) initialize_calendar(); } +$page['cat_nb_images'] = isset($page['items']) ? count($page['items']) : 0; + if (basename($_SERVER['SCRIPT_FILENAME']) == 'picture.php' and !isset($page['image_id']) ) { |