isExpired()) { dbConnect(); $cookie = handleVoteCookie(); $search = ''; if (array_key_exists('q', $_GET)) { $search = stripslashes(strip_tags(trim($_GET['q']))); if (strlen($search) <= 2) { header('Location: ' . BASE); exit; } /* if ((array_key_exists('utf8', $_GET) && mb_detect_encoding($search, 'Windows-1251', true) === false) || mb_detect_encoding($search, 'UTF-8', true) == 'UTF-8') { $search = mb_convert_encoding($search, 'Windows-1251', 'UTF-8'); }*/ $search = preg_replace('/\+/', ' ', $search); $search = preg_replace('/_/', ' ', $search); $escaped = mysql_real_escape_string($search); $keywords = ''; $sidebarAddon = ''; $tags = getTags(); // search for tags $res = mysql_query($q = "select distinct t.tag_name from tag t where tag_name like '$escaped%' order by tag_name") or die(mysql_error() . $q); if (mysql_num_rows($res) > 0) { $sidebarAddon .= '

Сопутствующие разделы

'; } while ($row = mysql_fetch_assoc($res)) { $tagName = $row['tag_name']; if (array_key_exists($tagName, $tags['sz'])) { $sz = $tags['sz'][$tagName]; } else { continue; } $keywords .= str_replace('&', '&', $tagName) . ', '; $sidebarAddon .= '' . $tagName . ' '; } mysql_free_result($res); } else { header('HTTP/404 Not Found'); exit; } // echo $authorName; // $e = getmicrotime(); echo ''; $page = 1; if (array_key_exists('p', $_GET)) $page = trim($_GET['p']); $num = 15; // handleSort(); printHeader($search, $keywords, $search); ?>

0) { $realItemCount = $itemCount; // $cnt = 0; // mysql_data_seek($res, ($page-1) * $num); while($row = mysql_fetch_row($res)) // if ($cnt++ < $num) { $itemIds .= ', '.$row[0]; // } mysql_free_result($res); } else { mysql_free_result($res); /* require dirname(__FILE__) . '/parser/src/browser.php'; $browser = new browser(); $browser->doGet('http://ozon.ru/webservice/webservice.asmx/SearchWebService?searchText=' . urlencode($search) . '&searchContext='); // echo ''; $content = $browser->content; $content = preg_replace('/<(\/)?\w+:/', '<$1', $content); $itemIds = array(-1); $realItemCount = 0; $xml = new SimpleXMLElement($content); if ($xml) { $itemCount = count($xml->diffgram->DocumentElement->SearchItems); $realItemCount = 0; for($i = 0; $i < $itemCount; $i++) { $item = $xml->diffgram->DocumentElement->SearchItems[$i]; if ($item->ItemAvailabilityID != 5) { $itemIds[] = $item->ID; $realItemCount++; } } $itemIds = implode(', ', $itemIds); }*/ } ?>
Найдено:
0 where i.item_id in (0, $itemIdsPlain) group by i.item_id"); // printPages($realItemCount, $page, $num, BASE . 'u/search/?q=' . urlencode($search), true); ?>
end(); } printFooter(); $e = getmicrotime(); echo ''; // $f = fopen($CORE_BASE.'time.txt', 'a'); // fwrite($f, $_SERVER['REQUEST_URI'].': '.($e - $b).' '.date('r')."\n"); // fclose($f); ob_end_flush(); ?>