mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-05 09:22:21 +02:00
usage of database info users.forbidden_categories
git-svn-id: http://piwigo.org/svn/branches/release-1_3@250 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
+3
-8
@@ -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.= ';';
|
||||
|
||||
Reference in New Issue
Block a user