Tjenare gött folk...Försöker att få en paging på denna sökmotor:
Jag har ett problem har en FSO sökmotor och har försökt med diverse paging scripter till den utan bra resultat får en massa fel bara så nu vänder jag mig till er EXPERTER här ute.
Jag vore väldigt tacksam om ni kunde hjälpa mig sliter snart av allt hår som jag har kvar!! Är lite desperat nu...
Här är koden till sökmotorn.
-----------------------------------------------------
<%
if request("sok") <> "" then
dim searcharray()
redim searcharray(15)
dim filsize()
redim filsize(15)
i = 0
Function ListFiles(objFolder)
For each File in objFolder.Files
strSok = request("sok")
if Right(file.name, 4) = ".zip" then
if Instr(file.name, strSok) > 0 then
searcharray(i) = "" & file.name & "<br>"
filsize(i) = file.size
i = i + 1
end if
end if
next
End Function
Function ListFolders(objFolder)
Set objSubFolders = objFolder.SubFolders
For Each Folder in objSubFolders
URL = url & "/" & folder.name
ListFiles(Folder)
ListFolders(Folder)
Next
End Function
Function FormatFileSize(Value)
Dim intValueLength
Dim outPut
intValueLength = Len("" & Value)
Select Case intValueLength
Case 0,1,2,3
outPut = Value & " bytes"
Case 4,5,6
outPut = FormatNumber(Value / 1024,2) & " Kb"
Case 7,8,9
outPut = FormatNumber(Value / 1024 / 1024,2) & " Mb"
Case Else
End Select
FormatFileSize = outPut
End Function
Dim objFSO, objFolder, objSubFolders, URL
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(Server.MapPath("."))
URL = request.ServerVariables("url")
temp = InstrRev(URL, "/")
URL = Left(URL, temp)
Listfiles(objFolder)
Listfolders(objFolder)
Redim preserve searcharray(i - 1)
Redim preserve filesize(i - 1)
Set objFolder = Nothing '*note
Set objSubFolders = Nothing
end if
%>
<html>
<head>
<title>Sök</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.tblHeader {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: bold;
color: #000000;
background-color: #D4D0C8;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: #FFFFFF;
border-right-color: #333333;
border-bottom-color: #333333;
border-left-color: #FFFFFF;
}
.tblDefault {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #000000;
}
.inputSearch {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
color: #000000;
border: 1px solid #333333;
width: 400px;
}
.btnSearch {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #000000;
background-color: #D4D0C8;
border: 1px solid #333333;
}
.btnRensa {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #000000;
background-color: #D4D0C8;
border: 1px solid #333333;
}
.Visa {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: bold;
color: #0066CC;
background-color: #EFEBEF;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: #FFFFFF;
border-right-color: #333333;
border-bottom-color: #333333;
border-left-color: #FFFFFF;
text-decoration: none;
BODY {text-decoration: none; color: "#0066CC"}
A:link {text-decoration: none; color: "#0066CC"}
A:visited {text-decoration: none; color: "#0066CC"}
A:active {text-decoration: none; color: "#0066CC"}
A:hover {text-decoration: none; color: "#0066CC"}
}
-->
</style>
</head>
<body>
<table border="0" width="52%" id="table1">
<tr>
<td><br>
<form name="form1" method="post" action="">
<p>
<input name="sok" type="text" class="inputSearch" size="20">
<input name="Submit" type="submit" class="btnSearch" value="Sök">
<input name="FileCache" type="submit" class="btnRensa" value="Rensa">
</p>
</p>
</form>
<% if request("sok") <> "" then %>
<table width="490" border="0" cellspacing="0" cellpadding="4" id="table3">
<tr>
<%
'Om inte finns
k = 0
if i = 0 then
%>
<tr>
<td width="415" align="left"><font size="1" face="Verdana">I am sorry but I
couldn't find any word that match your search:... .</font></td>
</tr>
<%
else
' Slut på inte finns
'Om finns
%>
<tr>
<td width="415" align="left"><font size="1" face="Verdana">
This is what i found in your search</font></td>
</tr>
<tr>
<td class="tblHeader" id="1">Filename</td>
<td width="57" class="tblHeader" id="2">
<p align="left">Size</td>
</tr>
<% for j = 0 to Ubound(searcharray) %>
<tr>
<td class="Visa" id="1"><% =searcharray(k) %></td>
<td align="right" class="Visa" id="2"><% =formatfilesize(filsize(k)) %></td>
</tr>
<%
k = k + 1
next
end if
'slut på finns
%>
<table width="491" border="1" cellspacing="0" cellpadding="4" id="table4" bordercolor="#EFEBEF">
<tr>
<td class="Visa" style="background-color: #D4D0C8">Sid resultat vill jag ha här</b>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body></html>
<%
End If
%>
------------------------------------------------------------
Hoppas att någon här ute kan hjälpa mig med mitt problem...
Tack på förhand MVH Ingemar A