%
dim arLevels
dim error
'create the RSS file of all most recently updated levels
call createRSS()
%>
<%if error <> "" then
Response.Write error
else
Response.Write "An update of "& (ubound(arLevels,2) + 1) & " levels has been written to: LvL.rdf"
end if
%>
<%
function createRSS()
set tigCON = Server.CreateObject("ADODB.Connection")
tigCON.Open(DSN)
' set up the query to list the news by date Desc
query = "SELECT [id], str_title, str_author, datestamp, str_type " & _
"FROM q3a_levels " & _
"WHERE bit_archived = 0 and DATEDIFF(hh,datestamp,(SELECT MAX(datestamp) FROM q3a_levels))<25" & _
" ORDER BY datestamp DESC"
'Response.Write("Query = [" & query & "] ")
set tigRS = tigCON.Execute(query)
if tigRS.eof then
tigRS.close
tigCON.close
error = "No new levels were found"
exit function
else
arLevels = tigRS.getRows
tigRS.close
tigCON.close
end if
'======================
'writing the RSS format map list
const ForReading = 1, ForWriting = 2
dim f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(current_ROOT & "xml\LvL.rdf", ForWriting, True)
f.Writeline ""
f.Writeline ""
f.Writeline ""
f.Writeline " "
f.Writeline " Copyright 1999 - "& datepart("yyyy", now())& " Ray Dow"
f.Writeline " LvL"
f.Writeline " "&FormatDateTime(now(), 1)&""
f.Writeline " "&FormatDateTime(now(), 1)&""
f.Writeline " http://www.planetquake.com/lvl/xml_feed.asp"
f.Writeline " Review site for Quake 3 Custom levels"
f.Writeline " http://www.planetquake.com/lvl"
f.Writeline " ..::LvL - Q3A edition"
f.Writeline " "
f.Writeline " http://www.planetquake.com/lvl"
f.Writeline " ..::LvL - Q3A edition"
f.Writeline " http://www.planetquake.com/lvl/images/lvl_button.gif"
f.Writeline " 35"
f.Writeline " 90"
f.Writeline " "
f.Writeline " tigger@ebom.org"
f.Writeline " tigger@ebom.org"
f.Writeline " English"
for i = 0 to ubound(arLevels,2)
f.Writeline " "
f.Writeline " " & server.HTMLEncode(arLevels(1,i)) & " by " & server.HTMLEncode(arLevels(2,i)) & ""
f.Writeline " http://www.planetquake.com/lvl/comments.asp?id=" & arLevels(0,i) & ""
f.Writeline " " & server.HTMLEncode(arLevels(4,i)) & ""
f.Writeline " "
next
f.Writeline " "
f.Writeline ""
set f = nothing
end function
%>