Changeset 2138 for trunk/index.php


Ignore:
Timestamp:
Oct 16, 2007, 3:46:09 AM (17 years ago)
Author:
rvelices
Message:
  • quick search optimizations (less queries)
  • added some meta_robots (noindex and nofollow) on popuphelp, search_rules and search seaction (googlebot gets crazy)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/index.php

    r2135 r2138  
    210210    htmlspecialchars($page['qsearch_details']['q']) );
    211211
    212   $found_cat_ids = array_merge(
     212  $cats = array_merge(
    213213      (array)@$page['qsearch_details']['matching_cats_no_images'],
    214214      (array)@$page['qsearch_details']['matching_cats'] );
    215   if (count($found_cat_ids))
    216   {
     215  if (count($cats))
     216  {
     217    usort($cats, 'name_compare');
    217218    $hints = array();
    218     $query = '
    219 SELECT id, name, permalink FROM '.CATEGORIES_TABLE.'
    220   WHERE id IN ('.implode(',', $found_cat_ids).')
    221   ORDER BY name
    222   LIMIT 10';
    223     $result = pwg_query($query);
    224     while ( $row = mysql_fetch_assoc($result) )
     219    foreach ( $cats as $cat )
    225220    {
    226       $hints[] = get_cat_display_name( array($row) );
     221      $hints[] = get_cat_display_name( array($cat) );
    227222    }
    228223    $template->assign_block_vars( 'category_search_results',
     
    233228  }
    234229
    235   $tags = find_tags( (array)@$page['qsearch_details']['matching_tags'] );
     230  $tags = (array)@$page['qsearch_details']['matching_tags'];
    236231  if (count($tags))
    237232  {
Note: See TracChangeset for help on using the changeset viewer.