Changeset 20063


Ignore:
Timestamp:
Jan 11, 2013, 11:41:55 AM (12 years ago)
Author:
mistic100
Message:

[random] only filter forbidden categories/images when we don't specify album id

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/ExtendedDescription/main.inc.php

    r20012 r20063  
    516516SELECT id, category_id
    517517  FROM '.IMAGES_TABLE.'
    518     JOIN '.IMAGE_CATEGORY_TABLE.' ON image_id = id
    519   WHERE
    520     '.(empty($params['album']) ? '1=1': 'category_id = '.$params['album']);
    521    
    522   $query.= ' '.get_sql_condition_FandF(array(
    523                   'forbidden_categories' => 'category_id',
    524                   'visible_categories' => 'category_id',
    525                   'visible_images' => 'id'
    526                   ),
    527                 'AND'
    528                 );
     518    JOIN '.IMAGE_CATEGORY_TABLE.' ON image_id = id';
     519  if (empty($params['album']))
     520  {
     521    $query = '
     522  WHERE 1=1 '
     523      .get_sql_condition_FandF(array(
     524        'forbidden_categories' => 'category_id',
     525        'visible_categories' => 'category_id',
     526        'visible_images' => 'id'
     527        ),
     528      'AND'
     529      );
     530  }
     531  else
     532  {
     533    $query.= '
     534  WHERE category_id = '.$params['album'];
     535  }
    529536 
    530537  $query.= '
Note: See TracChangeset for help on using the changeset viewer.