aboutsummaryrefslogtreecommitdiffstats
path: root/comments.php
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2004-01-03 20:58:07 +0000
committerz0rglub <z0rglub@piwigo.org>2004-01-03 20:58:07 +0000
commit9a5f45d31446019840d3052b31c06d1f43fb12ed (patch)
tree81f45d3f4a7dd255b627d95c7e3191bd4bdb6c89 /comments.php
parent067660bc68349dbb16c1c3bd529feb2800423cd3 (diff)
usage of database info users.forbidden_categories
git-svn-id: http://piwigo.org/svn/branches/release-1_3@250 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--comments.php11
1 files changed, 3 insertions, 8 deletions
diff --git a/comments.php b/comments.php
index 83fe67e08..e4159a107 100644
--- a/comments.php
+++ b/comments.php
@@ -169,15 +169,10 @@ $query.= ', '.PREFIX_TABLE.'image_category AS ic';
$query.= ' WHERE c.image_id = ic.image_id';
$query.= ' AND date > '.$maxtime;
// we must not show pictures of a forbidden category
-$restricted_cats = get_all_restrictions( $user['id'],$user['status'] );
-if ( count( $restricted_cats ) > 0 )
+if ( $user['forbidden_categories'] != '' )
{
- $query.= ' AND category_id NOT IN (';
- foreach ( $restricted_cats as $i => $restricted_cat ) {
- if ( $i > 0 ) $query.= ',';
- $query.= $restricted_cat;
- }
- $query.= ')';
+ $query.= ' AND category_id NOT IN ';
+ $query.= '('.$user['forbidden_categories'].')';
}
$query.= ' ORDER BY ic.image_id DESC';
$query.= ';';