ESF-2.4-VS-02 - informacijos paieška
Paieška

<% $searchstring=""; if(!empty($_GET["qstr"])) $searchstring=trim(htmlspecialchars($_GET["qstr"])); %>
<% //javascript:open('index.php?page=paieska&qstr='+act.qstr.value,'_top') try { $q = new COM("ixsso.Query",NULL,CP_UTF8); $n = new COM("ixsso.Util",NULL,CP_UTF8); $s=$searchstring; if (strlen(trim($_GET["qstr"]))>0) {$s.=" and ";}; $s.=" (not #vpath *\_vti*)"; $s.=" and (not #vpath *\_private*)"; $s.=" and (not #vpath *\images*)"; $s.=" and (not #vpath \?\*)"; $s.=" and (not #filename *.css)"; $s.=" and (not #filename *.vb)"; $s.=" and (not #filename *.cs)"; $s.=" and (not #filename *.js)"; $s.=" and (not #filename *.config)"; $s.=" and (not #filename *.php)"; $s.=" and (not #filename menu.inc)"; $s.=" and (not #filename paieska.inc)"; $s.=" and (not #filename error.inc)"; $s.=" and (not #filename footer.inc)"; $s.=" and (not #filename header.inc)"; $s.=" and (not #filename scripts.inc)"; $q->Query = $s; $q->Catalog = "LABTSF"; $q->SortBy = "rank[d]"; $q->Columns = "doctitle, vpath, filename, size, write, characterization, rank"; $q->MaxRecords = 200; $n->AddScopeToQuery($q,"/","shallow"); $n->AddScopeToQuery($q,"/files","deep"); $n->AddScopeToQuery($q,"/include","deep"); $rs = $q->CreateRecordSet("nonsequential"); //$rs->PageSize = 10; if (strlen(trim($_GET["qstr"]))>0) { if (!$rs->EOF) { echo "sąlygą \"".$searchstring."\" tenkina dokumentų: ".$rs->RecordCount()."

"; %><% while(!$rs->EOF) { $size=$rs->Fields("size")->Value; $rank=$rs->Fields("rank")->Value; $title=trim($rs->Fields("doctitle")->Value); $memo=htmlspecialchars($rs->Fields("characterization")->Value); $fname=trim($rs->Fields("filename")->Value); $vpath=trim($rs->Fields("vpath")->Value); $server=$_SERVER["SERVER_NAME"]; if (strlen($title)==0) {$title=substr($fname,0,strlen($fname)-4);$memo="";}; $pos = strpos($fname, ".pdf"); if (!($pos===false)){$memo="";} $pos = strpos($fname, ".inc"); if (!($pos===false)){$memo="";} if ($pos===false){$href="http"."://".$server.$vpath;} else {$href="http"."://".$server."/index.php?page=".substr($fname,0,strlen($fname)-4);}; $rankbase=1000; if ($rank<1) {$rankbase=1;}; $NormRank = $rank/$rankbase; if ($NormRank > 0.80) {$stars = "rankbtn5.gif";} elseif ($NormRank > 0.60) {$stars = "rankbtn4.gif";} elseif ($NormRank > 0.40) {$stars = "rankbtn3.gif";} elseif ($NormRank > 0.20) {$stars = "rankbtn2.gif";} else {$stars = "rankbtn1.gif";}; %> <% $rs->MoveNext(); } %>
<% if ($size>0) { %>
>
<%echo "".$size." ".$rs->Fields("write")."";%>
<% } else {%> <%;}%>
<%echo $title%> <%echo $memo;%>
<% $rs->Close(); } else { echo "sąlygą \"".$searchstring."\" tenkina dokumentų: 0"; } }; } catch (Exception $e) { $m=$e->getMessage(); $pos = strpos($m, "The query contained only ignored words"); if ($pos===false) { $pos = strpos($m, "The Query property was not set"); if ($pos===false){echo "Nenumatyta klaida!";} else {echo "Neįvestas sąlygos argumentas!";} } else {echo "Būtina patikslinti sąlygą!";} } %>  
(c) Kauno technologijos universiteto IT diegimo centras, 2005
Atnaujinta 2008 09 01