aboutsummaryrefslogtreecommitdiffstats
path: root/include/section_init.inc.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2008-04-08 01:35:02 +0000
committerrvelices <rv-github@modusoptimus.com>2008-04-08 01:35:02 +0000
commit3909b99f1e79e3383f3e08fecaf27b1c96287c9c (patch)
treebd4a8941bf5fe4d8c7d09ce3c9d0820aaef0be44 /include/section_init.inc.php
parent4c92087d6b006fbee6203e035741ff190a9d4056 (diff)
- 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
Diffstat (limited to '')
-rw-r--r--include/section_init.inc.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/include/section_init.inc.php b/include/section_init.inc.php
index cabfae546..f105aaaa8 100644
--- a/include/section_init.inc.php
+++ b/include/section_init.inc.php
@@ -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,
)
);
}