Projekt

Allgemein

Profil

Revision 3 api/autocomplete/autocomplete.php

Unterschiede anzeigen:

autocomplete.php
20 20
  $module_smarty = new Smarty;
21 21
  $module_smarty->assign('language', $_SESSION['language']);
22 22
  
23
  if (isset($_POST['queryString'])) {
24
    
23
  if (isset($_POST['queryString'])) {   
25 24
    $from_str = $where_str = '';
26 25
    
27 26
    $queryString = stripslashes(trim(decode_utf8(urldecode($_POST['queryString']))));    
......
30 29

  
31 30
    // create $search_keywords array
32 31
    $keywordcheck = xtc_parse_search_string($queryString, $search_keywords);
33
        
32

  
34 33
    if ($keywordcheck === true && mb_strlen($queryString, $_SESSION['language_charset']) >= SEARCH_AC_MIN_LENGTH) {
35 34
      
36 35
      $from_str .= SEARCH_IN_ATTR == 'true' ? " LEFT OUTER JOIN ".TABLE_PRODUCTS_ATTRIBUTES." AS pa ON (p.products_id = pa.products_id) 
......
76 75
                                   GROUP BY p.products_id 
77 76
                                   ORDER BY p.products_id ASC
78 77
                                      LIMIT ".MAX_DISPLAY_ADVANCED_SEARCH_RESULTS;
79
      
78
                                      
79
      # Modul Kategorie-Keywords: Erg?nzung relevanter Artikel IDs                                
80
      if(defined('MODULE_CATEGORY_KEYWORDS_STATUS') 
81
         && MODULE_CATEGORY_KEYWORDS_STATUS == 'True'){          
82
           require_once (DIR_WS_INCLUDES.'extra/default/listing_sql/category_keywords.php'); 
83
           # Erg?nzung relevanter Artikel IDs 
84
           if(isset($arr_included_products)){
85
              $autocomplete_search_query = str_replace("AND (  (", "AND (  ( p.products_id IN (".join($arr_included_products, ",") . ") OR ", $autocomplete_search_query);  
86
           }   
87
           # Erg?nzung relevanter Kategorien 
88
           if(count($categories_keyword_content) > 0) {  
89
                  $module_smarty->assign('categories_content', $categories_keyword_content);
90
           }  
91
      }
80 92
      $autocomplete_search_query = xtc_db_query($autocomplete_search_query);                      
81 93
      if (xtc_db_num_rows($autocomplete_search_query) > 0) {
82 94
        $module_content = array();

Auch abrufbar als: Unified diff