'.$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); } ?>