global $CONFIG_VARS; $configname ="guru2002"; getConfigVariables($configname); $database = "catalog"; $link_tidy = $CONFIG_VARS["$configname"]["link_tidy"]; $link_xsl = $CONFIG_VARS["$configname"]["link_xsl"]; $link_tidy_bin = $CONFIG_VARS["$configname"]["link_tidy_bin"]; $html_size_guru_up = $CONFIG_VARS["$configname"]["html_size_guru_up"]; $html_size_guru_right = $CONFIG_VARS["$configname"]["html_size_guru_right"]; global $obrazki_search_url, $obrazki_info_url, $obrazki_redirect_url, $res_words; $obrazki_search_url = $CONFIG_VARS["$configname"]["obrazki_search_url"]; $obrazki_info_url = $CONFIG_VARS["$configname"]["obrazki_info_url"]; $obrazki_redirect_url = $CONFIG_VARS["$configname"]["obrazki_redirect_url"]; $res_words =$CONFIG_VARS["$configname"]["res_words"]; ?> function httpGet ( $file_name ) { $file = fopen($file_name, "r"); while (!feof ($file)) { $buffer = fgets($file, 4096); $out .= $buffer; if ( $buffer == "" ) { fclose($file); return $out; } } fclose ($file); return $out; } function findIt ( $query, $first, $last, $params ) { echo 'findIt'; // xena // nie mam pojecia czemu akurat port 9020 najwidoczniej cos sobie xena przestawila i przeskoczyl port wczesniej byl 9000 // $results_location = "http://194.176.102.10:9000/s.xml?q=". urlencode($query) ."&f=$first&l=$last"; // $results_location = "http://xena.pi.net.pl:9000/s.xml?q=". urlencode($query) ."&f=$first&l=$last"; // mail('tadeuszd@pi.net.pl','ble',"http://xena.pi.net.pl:9000/s.xml?q=". urlencode($query) ."&f=$first&l=$last"); // filip if ($query == "wkłady kominkowe") $query="wklady kominkowe"; if (($query == "kalendarze wrocław") || ($query == "kalendarze wroclaw")) $query="kalendarz wrocław"; $results_location = "http://filip.pi.net.pl:9000/s.xml?q=". urlencode($query) ."&f=$first&l=$last"; # $results_location = "http://194.176.102.105:9000/s.xml?q=". urlencode($query) ."&f=$first&l=$last"; #mail("tadeuszd@pi.net.pl","test",$results_location); if ( $params != "" ) { $results_location .= "¶ms=". urlencode($params); } #echo "http://xena.pi.net.pl:9000/s.xml?q=". urlencode($query) ."&f=$first&l=$last"; if (strpos(httpGet( $results_location ),"Can not connect to") === false) return httpGet($results_location); else { $results_location = "http://xena.pi.net.pl:9000/s.xml?q=". urlencode($query) ."&f=$first&l=$last"; #echo '
'.$results_location.''; # $results_location = "http://194.176.102.10:9000/s.xml?q=". urlencode($query) ."&f=$first&l=$last"; return httpGet($results_location); } } function xslTransform ( $xmlData, $xslFileName, $arrParams=array() ) { # echo $xmlData; $xh = xslt_create(); xslt_set_encoding ($xh,"iso-8859-2"); $out = xslt_process($xh, "arg:/_xml", $xslFileName, NULL, array("/_xml"=>$xmlData), $arrParams ); xslt_free($xh); return $out; } function getSettings () { global $PERMANENT_VARS; $allSettings = array ( // fa - form advanced_p "fa" => 0, // rn - results in new window "rn" => 0, // ra - results amount "ra" => 10, // gs - group results by site "gs" => 1, // sw - search similar words "sw" => 1, // vu - view url "vu" => 1, // vc - view cache link "vc" => 1, // vr - view document rating "vr" => 1, // vt - view text "vt" => 1, // vm - view document last-modified date "vm" => 0, // vs - view document size (in kilobytes) "vs" => 1, // vd - view document description "vd" => 1, // vk - view document keywords "vk" => 0, // vp - view similar pages link "vp" => 1, // ss - search in space spN=on "ss" => "", ); $result = $allSettings; get_permanent_vars(); if ( trim($PERMANENT_VARS["settings"]) != "" ) { $strSettings = $PERMANENT_VARS["settings"]; $arrSettings = split(" ", $strSettings); $result = array(); foreach ($arrSettings as $i) { $k = split("=", $i); $result[$k[0]] = $k[1]; } } return $result; } function switch_lang ($lang) { if ( $lang == "en" ) { return "pl"; } else { return "en"; } } function convertSpace ( $si ) { switch ( $si ) { case 1: return "title:"; case 2: return "body:"; case 3: return "keywords:"; case 4: return "desc:"; default: return ""; } } function reverseSpace ( $PHRASE ) { $arr = array("title","body","keywords","desc"); $PHRASE=ereg_replace("body:((.*))","\\2",$PHRASE); return $PHRASE; } function clearPhrase ( $q ) { $q = strtolower( trim($q) ); $q = strtr($q, '\\\'"!@#$%^&*()_+|=[]{}:;<>?,./', ' '); $a = split(" ", $q); $a = array_unique($a); foreach ($a as $i) { if ( $i != "" ) { $r .= $i . " "; } } return trim($r); } ?>