Ignore:
Timestamp:
Apr 8, 2008, 3:35:02 AM (17 years ago)
Author:
rvelices
Message:
  • merge optimizitation of sql query (in section_init from trunk)
  • stricter check of url in parse_section_url
Location:
branches/branch-1_7/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/branch-1_7/include/functions_url.inc.php

    r2228 r2301  
    525525        array_push($requested_tag_ids, $matches[1]);
    526526      }
    527       else
     527      elseif ( !empty($tokens[$i]) )
    528528      {
    529529        array_push($requested_tag_url_names, $tokens[$i]);
  • branches/branch-1_7/include/section_init.inc.php

    r2202 r2301  
    288288    {
    289289      $query = '
    290 SELECT image_id
     290SELECT DISTINCT(image_id)
    291291  FROM '.IMAGE_CATEGORY_TABLE.' INNER JOIN '.IMAGES_TABLE.' ON image_id=id
    292292  WHERE image_id IN ('.implode(',', $items).')
     
    294294    $conf['order_by'].'
    295295;';
    296       $items = array_unique(
    297         array_from_query($query, 'image_id')
    298         );
     296      $items = array_from_query($query, 'image_id');
    299297    }
    300298
     
    305303      array(
    306304        'title' => $title,
    307         'items' => array_values($items),
     305        'items' => $items,
    308306        )
    309307      );
Note: See TracChangeset for help on using the changeset viewer.