1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252
| <%@ Language=VBScript %>
<%
DIM Listoffilesfound,Thefile,Thefolder,Folderpath,FileSystemObject
Set FileSystemObject = Server.CreateObject("Scripting.FileSystemObject")
if request.form="" then
SendForm()
else
SearchTerm = Server.HTMLencode(request.form("term"))
if Searchterm<>"" then
SearchTermArray=Split(SearchTerm," ")
MaxSearchTerms=ubound(SearchTermArray)
Folderstosearch="\menus_new\newmenu"
Folderstosearchasp="\..\as400asp"
Folderstosearchp="\..\pageintranet"
DonotsearchthisFiles =""
Folderpath=server.mappath("\")
' Search folders
If (FileSystemObject.FolderExists(Folderpath & Folderstosearch) = true) Then
FolderstosearchArray=Split(Folderstosearch,",")
Maxfolders=ubound(FolderstosearchArray)
for i=0 to Maxfolders
Thefolder = FolderstosearchArray(i)
Dim fs, f, f1, fc, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(Folderpath & Thefolder)
Set fc = f.Files
For Each f1 in fc
Wfile = f1.name
Thefile=Thefolder & "/" & Wfile
if (inStr(DonotsearchthisFiles,Thefile)=0 and (inStr(mid(Wfile,len(Wfile)-3,len(Wfile)),"htm")or inStr(mid(Wfile,len(Wfile)-3,len(Wfile)),"asp") or inStr(mid(Wfile,len(Wfile)-4,len(Wfile)),"html"))) then
Searchit()
end if
Next
next
end if
If (FileSystemObject.FolderExists(Folderpath & Folderstosearchasp) = true) Then
FolderstosearchArrayasp=Split(Folderstosearchasp,",")
Maxfoldersasp=ubound(FolderstosearchArrayasp)
for k=0 to Maxfoldersasp
Thefolderasp = FolderstosearchArrayasp(k)
Dim fsasp, fasp, f1asp, fcasp, sasp
Set fsasp = CreateObject("Scripting.FileSystemObject")
Set fasp = fsasp.GetFolder(Folderpath & Thefolderasp)
Set fcasp = fasp.Files
For Each f1asp in fcasp
Wfile = f1asp.name
Thefileasp=Thefolderasp & "/" & Wfile
if (inStr(DonotsearchthisFiles,Thefileasp)=0 and (inStr(mid(Wfile,len(Wfile)-3,len(Wfile)),"htm")or inStr(mid(Wfile,len(Wfile)-3,len(Wfile)),"asp") or inStr(mid(Wfile,len(Wfile)-4,len(Wfile)),"html"))) then
if inStr(Thefileasp,"Zsearch")= 0 then
Searchitasp()
end if
end if
Next
next
end if
If (FileSystemObject.FolderExists(Folderpath & Folderstosearchp) = true) Then
Dim fsp, fp, f1p, fcp, sp
Set fsp = CreateObject("Scripting.FileSystemObject")
Set fp = fsp.GetFolder(Folderpath)
Set fcp = fp.Files
For Each f1p in fcp
Wfile = f1p.name
Thefilep=Folderstosearchp & "/" & Wfile
if (inStr(DonotsearchthisFiles,Thefilep)=0 and (inStr(mid(Wfile,len(Wfile)-3,len(Wfile)),"htm")or inStr(mid(Wfile,len(Wfile)-3,len(Wfile)),"asp") or inStr(mid(Wfile,len(Wfile)-4,len(Wfile)),"html"))) then
if inStr(Thefilep,"Zsearch")= 0 then
Searchitp()
end if
end if
Next
end if
' Write search results
Searchresponse()
end if
end if
%><% Sub SendForm() %>
<HTML>
<HEAD>
<script>
function cacher() {
//self.parent.parent.parent.parent.parent.document.body.rows="0,*";
alert ('ouais');
//window.top.document.body.rows ="0,*";
top.document.body.rows ="0,*";
}
function cacherurl(url) {
top.document.body.rows ="0,*";
self.location.href=url;
}
function onenter(){
if(event.keyCode==13){
cacher();
}
}
</script>
<TITLE>Search</TITLE>
</HEAD>
<BODY BGCOLOR=FFFFFF ><CENTER>
<form method="POST" action="Zsearch.asp" target="Cright" >
<table border=0 cellpadding=0 cellspacing=0 ><tr>
<td align=center>
<!--Enter term to search -->
<input type=text name=term value="search menus" size=14 onkeypress="Javascript:onenter();">
<input name=submit type=image SRC="iseek.gif" ALT="search" value="search" onclick="javascript:cacher();">
</td>
</tr>
<tr >
<IMG SRC="searchmac.jpg">
</tr>
</table>
</form>
</CENTER></BODY></HTML>
<% End Sub %>
<% Sub Searchresponse() %>
<HTML>
<HEAD>
<TITLE>Search results</TITLE>
</HEAD>
<BODY BGCOLOR=FFFFFF ><CENTER>
<TABLE BORDER=0 WIDTH=600><TR><TD BGCOLOR=C0C0C0><FONT SIZE=5><B>Search Results</B></FONT></TD></TR></TABLE>
<TABLE BORDER=0 WIDTH=600>
<% if Listoffilesfound="" then %>
<TR><TD>The specified term or phrase was not found</TD></TR>
<% else
Response.Write (Listoffilesfound)
end if %>
</TABLE>
<TABLE BORDER=0 WIDTH=600><TR><TD BGCOLOR=C0C0C0 ALIGN=RIGHT><FONT SIZE=1>Search utility provided by Page Aerospace</A></FONT></TD></TR></TABLE>
</CENTER></BODY></HTML>
<% End Sub %>
<% Sub Searchit()
if inStr(Thefile,"Zsearch.asp")=false then
Thefilepath=Folderpath & Thefile
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.OpenTextFile(Thefilepath)
ThecontentofFile = a.ReadAll
a.close
'ThecontentofFile=notag(ThecontentofFile)
Findterms=0
for j=0 to MaxSearchTerms
if instr(1,ThecontentofFile,"</title>",1)>0 and instr(1,ThecontentofFile,"<title>",1)>0 then
TheTitle=left(ThecontentofFile,instr(1,ThecontentofFile,"</title>",1)-1)
TheTitle=right(TheTitle,len(TheTitle)-instr(1,TheTitle,"<title>",1)-6)
end if
if instr(1,Thetitle,SearchTermArray(j),1)>0 then
Findterms=Findterms+1
end if
next
if Findterms=MaxSearchTerms+1 then
'Listoffilesfound= Listoffilesfound & "<TR><TD>" & TheTitle & "</TD><TD ALIGN=CENTER VALIGN=MIDDLE> <A HREF= " & Thefile & " onClick=\'cacher()\' > View </A></TD><TD ALIGN=right VALIGN=MIDDLE><A target='_blank' HREF=" & Thefile & " > View in a new window</A></td></TR>"
end if
end if
End Sub %>
<% Sub Searchitasp()
if inStr(Thefileasp,"Zsearch")= 0 then
Thefilepath=Folderpath & Thefileasp
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.OpenTextFile(Thefilepath)
ThecontentofFile = a.ReadAll
a.close
'ThecontentofFile=notag(ThecontentofFile)
Findterms=0
for j=0 to MaxSearchTerms
if instr(1,ThecontentofFile,"</title>",1)>0 and instr(1,ThecontentofFile,"<title>",1)>0 then
TheTitle=left(ThecontentofFile,instr(1,ThecontentofFile,"</title>",1)-1)
TheTitle=right(TheTitle,len(TheTitle)-instr(1,TheTitle,"<title>",1)-6)
end if
if instr(1,Thetitle,SearchTermArray(j),1)>0 then
Findterms=Findterms+1
end if
next
if Findterms=MaxSearchTerms+1 then
Listoffilesfound= Listoffilesfound & "<TR><TD>" & TheTitle & "</TD><TD ALIGN=CENTER VALIGN=MIDDLE> <A HREF=" & Thefileasp & " > View </A></TD><TD ALIGN=right VALIGN=MIDDLE><A target='_blank' HREF=" & Thefileasp & " > View in a new window</A></td></TR>"
end if
end if
End Sub %>
<% Sub Searchitp()
Thefilepath=Folderpath & Thefilep
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.OpenTextFile(Thefilepath)
ThecontentofFile = a.ReadAll
a.close
'ThecontentofFile=notag(ThecontentofFile)
Findterms=0
for j=0 to MaxSearchTerms
if instr(1,ThecontentofFile,"</title>",1)>0 and instr(1,ThecontentofFile,"<title>",1)>0 then
TheTitle=left(ThecontentofFile,instr(1,ThecontentofFile,"</title>",1)-1)
TheTitle=right(TheTitle,len(TheTitle)-instr(1,TheTitle,"<title>",1)-6)
end if
if instr(1,Thetitle,SearchTermArray(j),1)>0 then
Findterms=Findterms+1
end if
next
if Findterms=MaxSearchTerms+1 then
Listoffilesfound=Listoffilesfound & "<TR><TD>" & TheTitle & "</TD><TD ALIGN=""CENTER"" VALIGN=""MIDDLE""> <A HREF=" & Thefilep & " onclick=""cacher()""> View </A></TD><TD ALIGN=""right"" VALIGN=""MIDDLE""><A target=""_blank"" HREF=" & Thefilep & " > View in a new window</A></td></TR>"
'Listoffilesfound= Listoffilesfound & "<TR><TD>" & TheTitle & "</TD><TD ALIGN=CENTER VALIGN=MIDDLE> <A HREF=" & Thefileasp & " > View </A></TD><TD ALIGN=right VALIGN=MIDDLE><A target='_blank' HREF=" & Thefilep & " > View in a new window</A></td></TR>"
end if
End Sub %> |
Partager