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
This commit is contained in:
z0rglub 2004-08-21 13:10:25 +00:00
commit 46938a8f25

View file

@ -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;