aboutsummaryrefslogtreecommitdiffstats
path: root/include/section_init.inc.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/section_init.inc.php27
1 files changed, 6 insertions, 21 deletions
diff --git a/include/section_init.inc.php b/include/section_init.inc.php
index d8b2f62c2..053607dfd 100644
--- a/include/section_init.inc.php
+++ b/include/section_init.inc.php
@@ -332,31 +332,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'];
- if ( isset($search_result['qs']) )
- {//save the details of the query search
- $page['qsearch_details'] = $search_result['qs'];
- }
+ $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 +363,7 @@ SELECT image_id
(
array
(
- 'visible_images' => 'image_id'
+ 'visible_images' => 'id'
),
'AND'
).'