% Option Explicit %>
<%
Const SITE_ID = 294 'Impossible Creatures Center
Dim sImage, sCaption, sRef
Dim dDateTime
Dim lNextID, lPrevID
Dim lID
Dim rs
SQLConnect SQLSERVER, SQLLOGIN, SQLPASSWORD
lID = ReqNum("id")
If lID <> 0 Then
Set rs = OpenRS("select id, datetime, piclarge, piccaption from newsitems where picotheday <>'' and siteid = " & SITE_ID & " and id = " & lID)
If rs.EOF Then
lID = 0
rs.Close
End If
End If
If lID = 0 Then
Set rs = OpenRS("SET ROWCOUNT 1 SELECT id, datetime, piclarge, piccaption FROM newsitems WHERE picotheday <> '' AND siteid = " & SITE_ID & " AND datetime <= GETDATE() ORDER BY datetime DESC")
End If
If Not rs.EOF Then
dDateTime = rs("datetime")
sImage = Trim(rs("piclarge"))
sCaption = Trim(rs("piccaption"))
End If
rs.Close
Set rs.ActiveConnection = Nothing
Set rs = Nothing
lNextID = ExecSQL("set ROWCOUNT 1 select id from newsitems where picotheday <>'' and siteid = " & SITE_ID & " and datetime > '" & dDateTime & "' order by datetime")
lPrevID = ExecSQL("set ROWCOUNT 1 select id from newsitems where picotheday <>'' and siteid = " & SITE_ID & " and datetime < '" & dDateTime & "' order by datetime desc")
'added by doc
If (Request.ServerVariables("HTTP_REFERER") = "") Then
sRef = "/"
Else
sRef = Request.ServerVariables("HTTP_REFERER")
End If
%>
Impossible Creatures Center - A Member of the GameSpy Network