Ignore:
Timestamp:
Jan 17, 2011, 10:16:42 PM (13 years ago)
Author:
rvelices
Message:

bug 2105 : Browsing tags is slow if tags contains many photos

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/section_init.inc.php

    r8665 r8726  
    322322    $items = get_image_ids_for_tags($page['tag_ids']);
    323323
    324     // permissions depends on category, so to only keep images that are
    325     // reachable to the connected user, we need to check category
    326     // associations
    327     if (!empty($items) )
    328     {
    329       $query = '
    330 SELECT DISTINCT image_id
    331   FROM '.IMAGE_CATEGORY_TABLE.' INNER JOIN '.IMAGES_TABLE.' ON image_id=id
    332   WHERE image_id IN ('.implode(',', $items).')
    333     '.$forbidden.
    334     $conf['order_by'].'
    335 ;';
    336       $items =  array_from_query($query, 'image_id');
    337     }
    338 
    339324    $page = array_merge(
    340325      $page,
Note: See TracChangeset for help on using the changeset viewer.