aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2007-10-16 01:46:09 +0000
committerrvelices <rv-github@modusoptimus.com>2007-10-16 01:46:09 +0000
commitb606b6d1ab4a484fae1922a574540c4bf6753be2 (patch)
tree00f265e055cf435a438b951215fd95e10986228b /index.php
parent608c174245ed8825366e40254e93bd57f777356d (diff)
- quick search optimizations (less queries)
- added some meta_robots (noindex and nofollow) on popuphelp, search_rules and search seaction (googlebot gets crazy) git-svn-id: http://piwigo.org/svn/trunk@2138 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'index.php')
-rw-r--r--index.php17
1 files changed, 6 insertions, 11 deletions
diff --git a/index.php b/index.php
index 49125e8ac..3a084147e 100644
--- a/index.php
+++ b/index.php
@@ -209,21 +209,16 @@ if ( $page['section']=='search' and $page['start']==0 and
$template->assign_var('QUERY_SEARCH',
htmlspecialchars($page['qsearch_details']['q']) );
- $found_cat_ids = array_merge(
+ $cats = array_merge(
(array)@$page['qsearch_details']['matching_cats_no_images'],
(array)@$page['qsearch_details']['matching_cats'] );
- if (count($found_cat_ids))
+ if (count($cats))
{
+ usort($cats, 'name_compare');
$hints = array();
- $query = '
-SELECT id, name, permalink FROM '.CATEGORIES_TABLE.'
- WHERE id IN ('.implode(',', $found_cat_ids).')
- ORDER BY name
- LIMIT 10';
- $result = pwg_query($query);
- while ( $row = mysql_fetch_assoc($result) )
+ foreach ( $cats as $cat )
{
- $hints[] = get_cat_display_name( array($row) );
+ $hints[] = get_cat_display_name( array($cat) );
}
$template->assign_block_vars( 'category_search_results',
array(
@@ -232,7 +227,7 @@ SELECT id, name, permalink FROM '.CATEGORIES_TABLE.'
);
}
- $tags = find_tags( (array)@$page['qsearch_details']['matching_tags'] );
+ $tags = (array)@$page['qsearch_details']['matching_tags'];
if (count($tags))
{
usort($tags, 'name_compare');