');
<%
Dim colcount, begininc, endinc, resultinc
hFilePath = Server.MapPath("/cache/top10-" & mypage & ".txt")
isCached = False
CacheExist=False
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
if objFSO.FileExists(hFilePath) then
CacheExist=True
Set objFile = objFSO.GetFile(hFilePath)
DLastMod = objFile.DateLastModified
Set objFile = nothing
if (DateDiff("h",DLastMod,Now)<1) then
isCached=True
end if
end if
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = adTypeText
objStream.Charset = "ascii"
objStream.Open
cachetext=""
if isCached=True then
objStream.LoadFromFile hFilePath
cachetext = objStream.ReadText
else
colcount=0
begininc = (mypage*10)-10
endinc = mypage*10
resultinc = 1
SET rs = Server.CreateObject("ADODB.Recordset")
command = "SELECT TOP " & mypage*10 & " * FROM GWWNews WHERE ACTIVE = '1' ORDER BY TimeStamp DESC"
rs.Open command, conn, adOpenForwardOnly, adLockReadOnly
if rs.EOF then
response.write("document.write('
No matches were found for your query.
');")
end if
do while not rs.EOF
if (begininc<=resultinc) and (endinc=>resultinc) then
Select Case ParseURL(rs("url"),"server")
case "myrss.com"
thissite="dmusic.com"
case "www.boycott-riaa.com"
thissite=""
case "www.zeropaid.com"
thissite=""
case "www.theregister.co.uk"
thissite=""
case "yro.slashdot.org"
thissite=""
case "www.eff.org"
thissite=""
case "www.chillingeffects.org"
thissite=""
case "slashdot.org"
thissite=""
case "www.freedom-to-tinker.com"
thissite=""
case "www.slyck.com"
thissite=""
case else
thissite=ParseURL(rs("url"),"server")
end select
if colcount=1 then
cachetext=cachetext&"document.write('
');" & vbcrlf
colcount=1
end if
end if
resultinc=resultinc+1
rs.MoveNext
loop
rs.close
set rs = nothing
objStream.WriteText cachetext
if CacheExist then
objStream.SaveToFile hFilePath, adSaveCreateOverWrite
else
objStream.SaveToFile hFilePath, adSaveCreateNotExist
end if
end if
objStream.Close
Set objStream = Nothing
Set objFSO = nothing
response.write(cachetext)
%>
document.write('