<% dim nmb_comments, str_game session.Timeout = 40 'debug = true if debug then Response.Write("session.Timeout=[" & session.Timeout & "]
") Response.Write("from info passed is;
") Response.Write(Replace(Request.Form,"&","
")) Response.Write("session id =[" & session("id") & "]
") end if session("txt_review") = Trim(Request.Form("txt_review")) session("str_author_email") = Trim(Request.Form("str_author_email")) session("str_author") = Trim(Request.Form("str_author")) session("str_type") = Trim(Request.Form("str_type")) session("str_filename") = Trim(Request.Form("str_filename")) session("str_title") = Trim(Request.Form("str_title")) session("wwwsite") = Trim(Request.Form("wwwsite")) session("datestamp") = Trim(Request.Form("datestamp")) 'hidden form fields session("datestamp") = Trim(Request.Form("datestamp")) session("bit_archived") = Request.Form("bit_archived") 'Response.Write("session(""bit_archived"")=[" & session("bit_archived") & "]
") if session("bit_archived") <> "0" then session("bit_archived") = "1" end if 'Response.Write("session(""bit_archived"")2=[" & session("bit_archived") & "]
") session("what_you_doing") = Trim(Request.Form("what_you_doing")) 'nmb_comments if session("what_you_doing") = "adding" then nmb_comments = 0 end if 'str_game is a *set field* done this way so we can expand we want later without a problem str_game = "Quake3Arena" if debug then Response.Write("what are you doing?=[" & session("what_you_doing") & "]
") Response.Write("bit_archived=[" & session("bit_archived") & "]
") end if dim error, error_msg error = false error_msg = "Some things need to be fixed before this level can be added - check out the details below" & vblf %> admin
"> "> Everything is required... ain't got the info? come back later then

<%=error_msg%>

Author's Name
">

Author's Email
">

What is it called? ie. One Down
">

What is it? ie. DM/Tourney 2-5 player
">

What's the filename? ie. tig_one
">

Is there a web site for the map? ie. www.planetquake.com/mrclean
">

The Review (try and keep it short)

Make this Level ...
<% if session("bit_archived") = 0 then %> Not Archived Archived <% else %> Not Archived Archived <% end if %>

<% 'no problem? then do something then!! else set tigCON = Server.CreateObject("ADODB.Connection") tigCON.Open(DSN) if session("what_you_doing") = "adding" then 'ok, its a new level query = "insert into q3a_levels " & _ "(txt_review, str_author_email, str_author, str_type, " & _ "str_filename, str_title, datestamp, " & _ "bit_archived, nmb_comments, str_game, wwwsite)" & _ "VALUES" & _ "('" & SQLsafe(session("txt_review")) & "', " & _ "'" & SQLsafe(session("str_author_email")) & "', " & _ "'" & SQLsafe(session("str_author")) & "', " & _ "'" & SQLsafe(session("str_type")) & "', " & _ "'" & SQLsafe(session("str_filename")) & "', " & _ "'" & SQLsafe(session("str_title")) & "', " & _ "'" & SQLsafe(session("datestamp")) & "', " & _ session("bit_archived") & ", " & _ nmb_comments & ", " & _ "'" & SQLsafe(str_game) & "', " & _ "'" & SQLsafe(session("wwwsite")) & "')" '===================================== 'now update the map count for the news dim objXML, LastMapDate, LastMapDateLocation, OldLastMapDateNode, NewLastMapDateText ', NewLastMapDateElement dim articles, LevelCount, MapCount, MapCountLocation, OldMapCountNode, NewMapCountText Set objXML = CreateObject("Microsoft.XMLDOM") objXML.async = False objXML.Load (current_ROOT & "xml\mainnews.xml") if objXML.parseError.errorCode <> 0 Then dim tmp_body tmp_body = objXML.parseError.errorCode & " at " & now() if Request.ServerVariables("LOCAL_ADDR") = local_ip then call cdontstime("lvl@ebom.org", "lvl@ebom.org", "XML main news problem in admin adding a level", tmp_body) else call emailtime("lvl@ebom.org", "lvl@ebom.org", "XML main news problem in admin adding a level", tmp_body) end if Response.Write("Problem writing the XML :[") else 'first grab the current count set articles = objXML.documentElement.selectnodes("news") LevelCount = objXML.documentElement.childnodes(0).childnodes(1).text set articles = nothing 'now update the LastMapDate and levelcount nodes Set LastMapDate = objXML.getElementsByTagName("lastmapdate") Set MapCount = objXML.getElementsByTagName("levelcount") Set LastMapDateLocation = LastMapDate.item(0) Set MapCountLocation = MapCount.item(0) set OldLastMapDateNode = LastMapDateLocation.childNodes(0) set OldMapCountNode = MapCountLocation.childNodes(0) 'Set NewLastMapDateElement = objXML.createElement("lastmapdate") 'assign the new values Set NewLastMapDateText = objXML.createTextNode(SQLdate(now())) Set NewMapCountText = objXML.createTextNode(cint(LevelCount) + 1) 'NewLastMapDateElement.appendChild(NewLastMapDateText) LastMapDateLocation.replaceChild NewLastMapDateText, OldLastMapDateNode MapCountLocation.replaceChild NewMapCountText, OldMapCountNode objXML.Save(current_ROOT & "xml\mainnews.xml") end if set objXML = nothing 'end map count update '====================== elseif session("what_you_doing") = "editing" then query = "update q3a_levels set " & _ "txt_review ='" & SQLSafe(session("txt_review")) & "', " & _ "str_author_email ='" & SQLSafe(session("str_author_email")) & "', " & _ "str_author ='" & SQLSafe(session("str_author")) & "', " & _ "str_type ='" & SQLSafe(session("str_type")) & "', " & _ "str_filename ='" & SQLSafe(session("str_filename")) & "', " & _ "str_title ='" & SQLSafe(session("str_title")) & "', " & _ "datestamp ='" & SQLSafe(session("datestamp")) & "', " & _ "bit_archived =" & session("bit_archived") & ", " & _ "nmb_comments =" & nmb_comments & ", " & _ "str_game ='" & SQLSafe(str_game) & "', " & _ "wwwsite ='" & SQLSafe(session("wwwsite")) & "' " & _ "WHERE id =" & session("id") else Response.Write("I think there was a problem;
") Response.Write(Replace(Request.Form,"&","
")) end if 'Response.Write("Query = [" & query & "]
") tigCON.Execute(query) tigCON.close '========================================= 'now write out an XML feed for the left nav set tigCON = Server.CreateObject("ADODB.Connection") tigCON.Open(DSN) ' set up the query to list the news by date Desc query = "SELECT top 20 id, str_title, str_filename, str_author " & _ "FROM q3a_levels " & _ "where bit_archived = 0 " & _ "ORDER BY datestamp DESC" 'Response.Write("Query = [" & query & "]
") set tigRS = tigCON.Execute(query) '====================== 'writing the XML format map list const ForReading = 1, ForWriting = 2 dim f Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile(current_ROOT & "xml\recentlevels.xml", ForWriting, True) f.Writeline "" ' make sure we can see if there is no records if (tigRS.EOF) Then f.Writeline " XX" f.Writeline " No Levels atm" f.Writeline " No Levels atm" f.Writeline " No author because there is no levels" else 'write the xml header 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" f.Writeline "
" end if do while not (tigRS.EOF) f.Writeline " " f.Writeline " " & server.htmlencode(tigRS("id")) & "" f.Writeline " " & server.htmlencode(tigRS("str_title")) & "" f.Writeline " " & server.htmlencode(tigRS("str_filename")) & "" f.Writeline " " & server.htmlencode(tigRS("str_author")) & "" f.Writeline " " tigRS.MoveNext loop f.Writeline "
" 'now copy the xml for public use Set f = fso.GetFile(current_ROOT & "xml\recentlevels.xml") f.Copy (current_ROOT & "xml\lvlNewLevels.xml") set f = nothing tigRS.close tigCON.close 'finish XML feed for the left nav '========================================= %> admin <% if session("what_you_doing") = "adding" then %> <%=session("str_title")%> by "><%=session("str_author")%> has been added to LvL.

An email has be sent to the Author stating their level has been added to LvL <% Dim strMessage strMessage = session("str_title") & " (" & session("str_filename") & ".zip) by " & session("str_author") & " has been added to LvL - http://www.planetquake.com/lvl" if (Request.ServerVariables("LOCAL_ADDR") = local_ip) then cdontstime session("str_author_email"), "lvl@ebom.org", session("str_title") & " has been added to LvL", strMessage else 'emailtime is using Jmail on the 'planetquake server as cdonts was unrelyable :[ emailtime session("str_author_email"), "lvl@ebom.org", session("str_title") & " has been added to LvL", strMessage end if else %> <%=session("str_title")%> by "><%=session("str_author")%> has been updated. <% end if %>

Go ahead, create an RSS, let the world know we have made an update. <% 'clear the session vars session.Abandon end if %>