<% '@Language=VBScript %> <% 'Option Explicit %> <'''html> Arama
<% dim qu, pg, maxpage dim rsindex qu=request("textquery") if qu<>"" then qu=replace(qu,"'","""") qu=replace(qu,"<","(") qu=replace(qu,">",")") qu=replace(qu,"g","g") qu=replace(qu,"G","G") qu=replace(qu,"i","i") qu=replace(qu,"I","I") qu=replace(qu,"s","s") qu=replace(qu,"S","S") pg=CLng(request("page")) if pg<1 then pg=1 end if %>

Aranacak kelimeleri yazin:
">

 
<% if qu<>"" then %> ARAMA SONUÇLARI
<% call searchpages end if sub SearchPages dim cnindex set cnindex=createobject("adodb.connection") cnindex.open "provider=msidxs; data source=web" set rsindex=createobject("adodb.recordset") rsindex.pagesize=10 on error resume next rsindex.open "SELECT rank, DOCTITLE, path, FILENAME FROM SCOPE() " & _ "WHERE ( " & _ "( (FREETEXT('" & qu & "') > 0) AND " & _ "(path NOT LIKE '%[_]vti[_]%') ) AND ( " & _ "(FILENAME LIKE '%.asp%') OR " & _ "(FILENAME LIKE '%.htm%') OR " & _ "(FILENAME LIKE '%.doc') OR " & _ "(FILENAME LIKE '%.xls') OR " & _ "(FILENAME LIKE '%.xml') OR " & _ "(FILENAME LIKE '%.txt') ) ) " & _ "ORDER BY Rank DESC", cnindex,1,3 if err.number>0 then response.write "Geçerli bir metin aramayi denemelisiniz." err.clear exit sub end if on error goto 0 if rsindex.eof then response.write "Sayfa bulunamadi." exit sub end if maxpage=CLng((rsindex.recordcount-1)/rsindex.pagesize)+1 if maxpage>10 then maxpage=10 if pg>maxpage then pg=maxpage rsindex.absolutepage=pg call PageNumbers %>
<% dim sira, sayac sayac=0 sira=rsindex.pagesize*(pg-1) do while not rsindex.eof if sayac=rsindex.pagesize then exit do sayac=sayac+1 sira=sira+1 dim path path=rsindex("path") path=mid(path,len("d:\Inetpub\BilgiTeknoloji\")+1) path=replace(path,"\","/") %> <% rsindex.movenext loop %>
<% =sira %>. <% =rsindex("rank")\10 %>% <% if rsindex("doctItle")<>"" then response.write rsindex("doctItle") else response.write rsindex("fIlename") %>
http://BilgiTeknoloji.net/<% =path %>



<% end sub sub PageNumbers '''if maxpage<=1 then exit sub %>
Bulunan <% =rsindex.recordcount %> kayit. Listelenen <% =1+(rsindex.absolutepage-1)*rsindex.pagesize %>- <% if rsindex.absolutepage=rsindex.pagecount then response.write rsindex.recordcount else response.write rsindex.pagesize*rsindex.absolutepage end if %>

<% if rsindex.absolutepage>1 then %><< <% else %><< <% end if dim i if rsindex.pagecount>1 then for i=1 to rsindex.pagecount if i<>rsindex.absolutepage then %><% =i %> <% else %><% =i %> <% end if next if pg>> <% else %>>> <% end if end if %>

<% end sub %>



<'''/html>