aboutsummaryrefslogtreecommitdiffstats
path: root/include/section_init.inc.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2006-04-05 02:01:36 +0000
committerrvelices <rv-github@modusoptimus.com>2006-04-05 02:01:36 +0000
commitbdceff32bcdd7a6ed72697384148577da4bc71d1 (patch)
tree10a99a67fa7c8685aab8bb213a4c0252bd48d30a /include/section_init.inc.php
parentdb80e86df1d0708c18255c7e993a224ce6589b2a (diff)
image sort order for tags
very minor code and language simplifications and corrections git-svn-id: http://piwigo.org/svn/trunk@1125 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/section_init.inc.php16
1 files changed, 6 insertions, 10 deletions
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']) )
{