aboutsummaryrefslogtreecommitdiffstats
path: root/include/section_init.inc.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2008-07-23 00:56:53 +0000
committerrvelices <rv-github@modusoptimus.com>2008-07-23 00:56:53 +0000
commitb4793e959e06a1b06b05a06e3a4e2ac2b35a23e7 (patch)
tree6d38e673b55bb0d3713891e1c6f054edb6672b01 /include/section_init.inc.php
parentbe13718838b32b71570bc3c77ce55d162bfbbd34 (diff)
- merge r2451 from trunk: normalize behaviour of query search versus std search (now both return items already sorted and permission checked); also more optimized sql queries (in some cases)
git-svn-id: http://piwigo.org/svn/branches/branch-1_7@2452 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/section_init.inc.php')
-rw-r--r--include/section_init.inc.php23
1 files changed, 6 insertions, 17 deletions
diff --git a/include/section_init.inc.php b/include/section_init.inc.php
index 6f03cb193..fb232d883 100644
--- a/include/section_init.inc.php
+++ b/include/section_init.inc.php
@@ -336,27 +336,16 @@ SELECT DISTINCT(image_id)
{
include_once( PHPWG_ROOT_PATH .'include/functions_search.inc.php' );
- $search_result = get_search_results($page['search']);
- if ( !empty($search_result['items']) and !isset($search_result['as_is']) )
- {
- $query = '
-SELECT DISTINCT(id)
- FROM '.IMAGES_TABLE.'
- INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id
- WHERE id IN ('.implode(',', $search_result['items']).')
- '.$forbidden.'
- '.$conf['order_by'].'
-;';
- $page['items'] = array_from_query($query, 'id');
- }
- else
- {
- $page['items'] = $search_result['items'];
+ $search_result = get_search_results($page['search'], @$page['super_order_by'] );
+ if ( isset($search_result['qs']) )
+ {//save the details of the query search
+ $page['qsearch_details'] = $search_result['qs'];
}
$page = array_merge(
$page,
array(
+ 'items' => $search_result['items'],
'title' => '<a href="'.duplicate_index_url(array('start'=>0)).'">'
.l10n('search_result').'</a>',
)
@@ -378,7 +367,7 @@ SELECT image_id
(
array
(
- 'visible_images' => 'image_id'
+ 'visible_images' => 'id'
),
'AND'
).'