mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
- merge optimizitation of sql query (in section_init from trunk)
- stricter check of url in parse_section_url git-svn-id: http://piwigo.org/svn/branches/branch-1_7@2301 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -524,7 +524,7 @@ function parse_section_url( $tokens, &$next_token)
|
||||
{
|
||||
array_push($requested_tag_ids, $matches[1]);
|
||||
}
|
||||
else
|
||||
elseif ( !empty($tokens[$i]) )
|
||||
{
|
||||
array_push($requested_tag_url_names, $tokens[$i]);
|
||||
}
|
||||
|
||||
@@ -287,15 +287,13 @@ else
|
||||
if (!empty($items) )
|
||||
{
|
||||
$query = '
|
||||
SELECT image_id
|
||||
SELECT DISTINCT(image_id)
|
||||
FROM '.IMAGE_CATEGORY_TABLE.' INNER JOIN '.IMAGES_TABLE.' ON image_id=id
|
||||
WHERE image_id IN ('.implode(',', $items).')
|
||||
'.$forbidden.
|
||||
$conf['order_by'].'
|
||||
;';
|
||||
$items = array_unique(
|
||||
array_from_query($query, 'image_id')
|
||||
);
|
||||
$items = array_from_query($query, 'image_id');
|
||||
}
|
||||
|
||||
$title = get_tags_content_title();
|
||||
@@ -304,7 +302,7 @@ SELECT image_id
|
||||
$page,
|
||||
array(
|
||||
'title' => $title,
|
||||
'items' => array_values($items),
|
||||
'items' => $items,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user