From 46938a8f256ae5d441e6b736604e37e8ca265ce1 Mon Sep 17 00:00:00 2001 From: z0rglub Date: Sat, 21 Aug 2004 13:10:25 +0000 Subject: add in comment another possibility for counting user total number of viewable elements (counting only once pictures linked to several categories) git-svn-id: http://piwigo.org/svn/trunk@490 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions_category.inc.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'include/functions_category.inc.php') diff --git a/include/functions_category.inc.php b/include/functions_category.inc.php index 47db0e75f..8ff06ede7 100644 --- a/include/functions_category.inc.php +++ b/include/functions_category.inc.php @@ -256,7 +256,18 @@ function count_user_total_images() if ( count( $user['restrictions'] ) > 0 ) $query.= ' WHERE id NOT IN ('.$user['forbidden_categories'].')'; $query.= ';'; - + +// $query = ' +// SELECT COUNT(DISTINCT(image_id)) as total +// FROM '.PREFIX_TABLE.'image_category'; +// if (count($user['restrictions']) > 0) +// { +// $query.= ' +// WHERE category_id NOT IN ('.$user['forbidden_categories'].')'; +// } +// $query = ' +// ;'; + $row = mysql_fetch_array( mysql_query( $query ) ); if ( !isset( $row['total'] ) ) $row['total'] = 0; -- cgit v1.2.3