search_words)==0) { return NULL; } else { $this->search_words = implode('|', $this->search_words); } $shop_url = _getConfig( 'shop_pref_id_shop', '_shopPref' ); if(!is_numeric($shop_url) && is_string($shop_url)) { $shop_url = trim($shop_url); } elseif(is_numeric($shop_url) && intval($shop_url)) { $shop_url = 'aid='.intval($shop_url); } else { $shop_url = $GLOBALS['aktion'][1] ? 'aid='.$GLOBALS['aktion'][1] : 'id='.$GLOBALS['aktion'][0]; } $sql = 'SELECT shopprod_id, shopprod_category, shopprod_ordernumber, '; $sql .= 'shopprod_name1, '; $sql .= 'UNIX_TIMESTAMP(shopprod_changedate) AS shopprod_date, '; $sql .= 'CONCAT('; $sql .= " shopprod_description0,' ',"; $sql .= " shopprod_description1,' ',"; $sql .= " shopprod_description2,' ',"; $sql .= " shopprod_description3,' ',"; $sql .= " shopprod_color,' ',"; $sql .= " shopprod_size,' ',"; $sql .= " shopprod_ordernumber,' ',"; $sql .= " shopprod_model,' ',"; $sql .= " shopprod_name1,' ',"; $sql .= " shopprod_name2,' '"; $sql .= ') AS shopprod_search '; $sql .= 'FROM '.DB_PREPEND.'phpwcms_shop_products WHERE shopprod_status=1'; $data = _dbQuery($sql); foreach($data as $value) { $s_result = array(); $s_text = $value['shopprod_search']; $s_text = str_replace( array('~', '|', ':', 'http', '//', '_blank', ' ') , ' ', $s_text ); $s_text = clean_replacement_tags($s_text, ''); $s_text = remove_unsecure_rptags($s_text); $s_text = cleanUpSpecialHtmlEntities($s_text); preg_match_all('/'.$this->search_words.'/is', $s_text, $s_result ); $s_count = 0; //set search_result to 0 foreach($s_result as $svalue) { $s_count += count($svalue); } if($s_count) { $id = $this->search_result_entry; $s_title = $value['shopprod_ordernumber'] ? trim($value['shopprod_ordernumber']).': ' : ''; $s_title .= $value['shopprod_name1']; $s_title = html_specialchars($s_title); $s_text = trim($s_text); $s_text = getCleanSubString($s_text, $this->search_wordlimit, $this->ellipse_sign, 'word'); $s_text = html_specialchars($s_text); $this->search_results[$id]["id"] = $value['shopprod_id']; $this->search_results[$id]["cid"] = 0; $this->search_results[$id]["rank"] = $s_count; $this->search_results[$id]["title"] = $this->search_highlight ? highlightSearchResult($s_title, $this->search_highlight_words) : $s_title; $this->search_results[$id]["date"] = $value['shopprod_date']; $this->search_results[$id]["user"] = ''; $this->search_results[$id]['query'] = $shop_url.'&shop_cat='.$value['shopprod_category'].'&shop_detail='.$value['shopprod_id']; if($this->search_highlight) { $s_text = highlightSearchResult($s_text, $this->search_highlight_words); } $this->search_results[$id]["text"] = $s_text; $this->search_result_entry++; } } } } ?>