diff options
Diffstat (limited to 'include/section_init.inc.php')
-rw-r--r-- | include/section_init.inc.php | 23 |
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' ).' |