<%
'#################################################################################
'## Copyright (C) 2000-04 Michael Anderson, Pierre Gorissen,
'## Huw Reddick and Richard Kinser
'##
'## Article body support added by Mike Belshe, 03-02-04,
'## mike@lookoutsoft.com - http://www.lookoutsoft.com/
'## Same license and caveats as defined below.
'##
'## This program is free software; you can redistribute it and/or
'## modify it under the terms of the GNU General Public License
'## as published by the Free Software Foundation; either version 2
'## of the License, or any later version.
'##
'## All copyright notices regarding Snitz Forums 2000
'## must remain intact in the scripts and in the outputted HTML
'## The "powered by" text/logo with a link back to
'## http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'## GNU General Public License for more details.
'##
'## You should have received a copy of the GNU General Public License
'## along with this program; if not, write to the Free Software
'## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
'##
'## Support can be obtained from support forums at:
'## http://forum.snitz.com
'##
'## Correspondence and Marketing Questions can be sent to:
'## manderson@snitz.com
'##
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_func_common.asp" -->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<%
set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString
%>
<!--#INCLUDE FILE="inc_func_rsslog.asp" -->
<!--#INCLUDE FILE="inc_func_rss.asp" -->
<%
dim intResults,Topic_ID,strSubject,Topic_Replies,Topic_Last_Post_Reply_ID
intResults = 10
'disable images
strIcons = "0"
strIMGInPosts = "1"
strSql = "SELECT "
strSql = strSql & " T.T_REPLIES,"
strSql = strSql & " T.T_SUBJECT,"
strSql = strSql & " T.TOPIC_ID,"
strSql = strSql & " T.T_LAST_POST,"
strSql = strSql & " T.T_LAST_POST_AUTHOR,"
strSql = strSql & " T.T_LAST_POST_REPLY_ID,"
strSql = strSql & " T.T_MESSAGE"
strSql = strSql & " FROM " & strTablePrefix & "TOPICS T," & strTablePrefix & "FORUM F"
strSql = strSql & " WHERE T.FORUM_ID = F.FORUM_ID"
'#### strSql = strSql & " AND F.F_PRIVATEFORUMS = 0" #### replace this with custom list of allowed forums
'#### Just so you know, F_PRIVATEFORUMS holds the type of authorization set for the forum.
'#### Possible Values:
'#### 0 - All Visitors
'#### 1 - Allowed Member List
'#### 2 - Password Protected
'#### 3 - Allowed Member List & Password Protected
'#### 4 - Members Only
'#### 5 - Members Only (Hidden)
'#### 6 - Allowed Member List (Hidden)
'#### 7 - Members Only & Password Protected
'#### 8 - NT Global Group (Hidden)
'#### 9 - NT Global Group
strSql = strSql & strAllowedForums
if Request.QueryString("FORUM_ID") <> "" then
strSql = strSql & " AND T.FORUM_ID = " & cLng(Request.QueryString("FORUM_ID"))
end if
if Request.QueryString("CAT_ID") <> "" then
strSql = strSql & " AND T.CAT_ID = " & cLng(Request.QueryString("CAT_ID"))
end if
strSql = strSql & " AND T.T_STATUS = 1"
strSql = strSql & " ORDER BY T_LAST_POST DESC"
strSql = TopSQL(strSQL, 10)
set rs = Server.CreateObject("ADODB.Recordset")
rs.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
if rs.EOF then
recActiveTopicsCount = ""
else
allActiveTopics = rs.GetRows(adGetRowsRest)
recActiveTopicsCount = UBound(allActiveTopics,2)
end if
rs.close
set rs = nothing
xml = ""
xml = "<?xml version=""1.0"" encoding=""ISO-8859-1"" ?>" & vbNewLine
xml = xml & "<!-- RSS generation done by Snitz Forums 2000 on " & chkDate(datetostr(strForumTimeAdjust)," ",true) & " -->" & vbNewLine
xml = xml & "<rss version=""2.0"">" & vbNewLine
xml = xml & "<channel>" & vbNewLine
xml = xml & "<language>en-us</language>" & vbNewLine
xml = xml & "<lastBuildDate>" & Date2RFC822(strForumTimeAdjust)& "</lastBuildDate>" & vbNewLine
xml = xml & "<webMaster>" & strSender & "</webMaster>" & vbNewLine
xml = xml & "<ttl>60</ttl>" & vbNewLine
'#### get title
if Request.QueryString("FORUM_ID") = "" AND Request.QueryString("CAT_ID") = "" then
strNewTitle = strForumTitle
else
if Request.QueryString("FORUM_ID") <> "" then
strTempForum = cLng(request.querystring("FORUM_ID"))
strsql = "SELECT F_SUBJECT FROM " & strTablePrefix & "FORUM WHERE FORUM_ID=" & strTempForum
set tforums = my_conn.execute(strsql)
if tforums.bof or tforums.eof then
strNewTitle = strForumTitle
set tforums = nothing
else
strTempForumTitle = chkString(tforums("F_SUBJECT"),"display")
set tforums = nothing
strNewTitle = strForumTitle & " - " & strTempForumTitle
end if
else
strTempCat = cLng(request.querystring("CAT_ID"))
strsql = "SELECT CAT_NAME FROM " & strTablePrefix & "CATEGORY WHERE CAT_ID=" & strTempCat
set tCat = my_conn.execute(strsql)
if tCat.bof or tCat.eof then
strNewTitle = strForumTitle
set tCat = nothing
else
strTempForumTitle = chkString(tCat("CAT_NAME"),"display")
set tCat = nothing
strNewTitle = strForumTitle & " - " & strTempForumTitle
end if
end if
end if
xml = xml & "<title>" & strNewTitle & "</title>" & vbNewLine
xml = xml & "<link>" & strForumURL & "</link>" & vbNewLine
xml = xml & "<description>" & strForumTitle & strTitleOwner & "</description>" & vbNewLine
xml = xml & "<author>" & Topic_Last_Post_Author & "</author>"
xml = xml & "<image>" & vbNewLine
xml = xml & "<link>" & strForumURL & "</link>" & vbNewLine
xml = xml & "<url>" & strForumURL & "images/rss.gif</url>" & vbNewLine
xml = xml & "<title>" & strForumTitle & " RSS Feed</title>" & vbNewLine
xml = xml & "<width>65</width>" & vbNewLine
xml = xml & "<height>47</height>" & vbNewLine
xml = xml & "</image>" & vbNewLine
if recActiveTopicsCount <> "" then
fT_REPLIES = 0
fT_SUBJECT = 1
fTOPIC_ID = 2
fT_LAST_POST = 3
fT_LAST_POST_AUTHOR = 4
fT_LAST_POST_REPLY_ID = 5
fT_MESSAGE = 6
fR_MESSAGE = 7
for RowCount = 0 to recActiveTopicsCount
Topic_Replies = allActiveTopics(fT_REPLIES,RowCount)
Topic_Subject = chkstring(replace(allActiveTopics(fT_SUBJECT,RowCount),"&","&"),"display")
Topic_ID = allActiveTopics(fTOPIC_ID,RowCount)
Topic_Last_Post = allActiveTopics(fT_LAST_POST,RowCount)
Topic_Last_Post_Author = getMemberName(allActiveTopics(fT_LAST_POST_AUTHOR,RowCount))
Topic_Last_Post_Reply_ID = allActiveTopics(fT_LAST_POST_REPLY_ID,RowCount)
'Forum_Subject = chkstring(replace(allActiveTopics(fF_SUBJECT,RowCount),"&","&"),"display")
if Topic_Replies > 0 then
Body = "There are " & Topic_Replies & " replies, with the last one on " & chkDate(Topic_Last_Post," at",true) & " by " & Topic_Last_Post_Author
Body = Body & vbNewLine & "Quote:" & vbNewLine & allActiveTopics(fT_MESSAGE,RowCount)
Body = Body & vbNewLine & funcGetReplyMessageText(allActiveTopics(fTOPIC_ID,RowCount))
else
Body = allActiveTopics(fT_MESSAGE,RowCount)
'Body = "This is a new topic posted on " & chkDate(Topic_Last_Post," at",true) & " by " & Topic_Last_Post_Author
end if
Body = MakeCData(Body)
xml = xml & "<item>"
xml = xml & "<title>" & Topic_Subject & "</title>"
xml = xml & "<author>" & Topic_Last_Post_Author & "</author>"
xml = xml & "<link>" & strForumURL & DoLastPostLink & "</link>"
xml = xml & "<category>" & Forum_Subject & "</category>" & vbNewLine
xml = xml & "<pubDate>"& Date2RFC822(StrToDate(Topic_Last_Post)) &"</pubDate>"
xml = xml & "<guid>" & strForumURL & "topic.asp?TOPIC_ID=" & Topic_ID & "</guid>" & vbNewLine
xml = xml & "<description>" & Body & "</description>"
xml = xml & "</item>"
next
end if
xml = xml & "</channel></rss>"
Response.Clear
Response.Expires = 0
Response.ContentType = "text/xml"
Response.Write xml
my_Conn.close
set my_Conn = nothing
Response.End
Function Date2RFC822(Date2Convert)
'convert the date to the RFC-822 format
'first declare the variables used:
dim rfc822timezone,rfc822daydate,rfc822dayno,rfc822day,rfc822monthno,rfc822month,rfc822year,rfc822hour,rfc822minute,rfc822seconds,rfc822time,pubdate
'first we get the input date
'Date2Convert = chkDate(Topic_Last_Post,"",true)
' define your timezone offset below. Examples : "+0100" for GMT+1, "EST", "GMT"
rfc822timezone = " -0300"
'get the date (day)
rfc822daydate = Day(Date2Convert)
if len(rfc822daydate) = 1 then rfc822daydate = "0" & rfc822daydate
'get the number of the day of the week, assuming that monday is the first day of the week.
rfc822dayno = Weekday(Date2Convert, 2)
' now make sure that this day is translated into the correct english abbreviation:
select case rfc822dayno
case 1
rfc822day = "Mon"
case 2
rfc822day = "Tue"
case 3
rfc822day = "Wed"
case 4
rfc822day = "Thu"
case 5
rfc822day = "Fri"
case 6
rfc822day = "Sat"
case 7
rfc822day = "Sun"
end select
rfc822monthno = Month(Date2Convert)
' now make sure that this month is translated into the correct english abbreviation:
select case rfc822monthno
case 1
rfc822month = "Jan"
case 2
rfc822month = "Feb"
case 3
rfc822month = "Mar"
case 4
rfc822month = "Apr"
case 5
rfc822month = "May"
case 6
rfc822month = "Jun"
case 7
rfc822month = "Jul"
case 8
rfc822month = "Aug"
case 9
rfc822month = "Sep"
case 10
rfc822month = "Oct"
case 11
rfc822month = "Nov"
case 12
rfc822month = "Dec"
end select
rfc822year = Year(Date2Convert)
rfc822hour = Hour(Date2Convert) & ":"
if len(rfc822hour) = 2 then
rfc822hour = "0" & rfc822hour
end if
rfc822minute = Minute(Date2Convert) & ":"
if len(rfc822minute) = 2 then
rfc822minute = "0" & rfc822minute
end if
rfc822seconds = second(Date2Convert)
if len(rfc822seconds) = 1 then
rfc822seconds = "0" & rfc822seconds
end if
rfc822time = rfc822hour & rfc822minute & rfc822seconds
'now put the whole thing together in the RFC822 format
'Example Tue, 21 Dec 2004 22:41:31 +0100
'Example : DDD, dd MMM yyyy, hh:mm:ss timezone
Date2RFC822 = rfc822day & ", " & rfc822daydate & " " & rfc822month & " " & rfc822year & " " & rfc822time & rfc822timezone
'done
end Function
Function DoLastPostLink()
if Topic_Replies < 1 or Topic_Last_Post_Reply_ID = 0 then
DoLastPostLink = "topic.asp?TOPIC_ID=" & Topic_ID
elseif Topic_Last_Post_Reply_ID <> 0 then
PageLink = "whichpage=-1&"
AnchorLink = "&REPLY_ID="
DoLastPostLink = "topic.asp?" & PageLink & "TOPIC_ID=" & Topic_ID & AnchorLink & Topic_Last_Post_Reply_ID
else
DoLastPostLink = "topic.asp?TOPIC_ID=" & Topic_ID
end if
end function
Function GetReplyBody()
strSqlReq = "SELECT R_MESSAGE FROM " & _
strTablePrefix & "REPLY WHERE " & _
" REPLY_ID=" & Topic_Last_Post_Reply_ID
set nrs = Server.CreateObject("ADODB.Recordset")
nrs.open strSqlReq, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
if not nrs.EOF then
reply = nrs.GetRows(adGetRowsRest)
end if
nrs.close
set nrs = nothing
GetReplyBody = reply(0,0)
end function
Function MakeCData( foo )
MakeCData = "<![CDATA[" & formatStr(foo) & "]]>"
end function
function funcGetReplyMessageText(intTopicID)
strSql9 = "SELECT "
strSql9 = strSql9 & " TOPIC_ID,"
strSql9 = strSql9 & " R_MESSAGE"
strSql9 = strSql9 & " FROM " & strTablePrefix & "REPLY"
strSql9 = strSql9 & " WHERE TOPIC_ID = " & intTopicID
strSql9 = strSql9 & " AND R_STATUS = 1"
strSql9 = strSql9 & " ORDER BY R_DATE ASC"
'strSql = TopSQL(strSQL9, 10)
set rs9 = Server.CreateObject("ADODB.Recordset")
rs9.open strSql9, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
strMsgDump = ""
while not rs9.EOF
strMsgDump = strMsgDump & "<hr>" & vbNewLine
strMsgDump = strMsgDump & rs9("R_MESSAGE") & vbNewLine
rs9.MoveNext
wend
rs9.close
set rs9 = nothing
end function
%>
if Topic_Replies > 0 then
Body = "There are " & Topic_Replies & " replies, with the last one on " & chkDate(Topic_Last_Post," at",true) & " by " & Topic_Last_Post_Author
Body = Body & vbNewLine & "Quote:" & vbNewLine & allActiveTopics(fT_MESSAGE,RowCount)
Body = Body & vbNewLine & funcGetReplyMessageText(allActiveTopics(fTOPIC_ID,RowCount))
else
Body = allActiveTopics(fT_MESSAGE,RowCount)
'Body = "This is a new topic posted on " & chkDate(Topic_Last_Post," at",true) & " by " & Topic_Last_Post_Author
end if
For the LAST topic (the only time it will give you the first topic is if there is only one new topic):
allActiveTopics(fT_MESSAGE,RowCount)
For the FIRST topic:
allActiveTopics(fT_MESSAGE,0)<%
'###############################################################################
'##
'## Snitz Forums 2000 v3.4.07
'##
'###############################################################################
'##
'## Copyright © 2000-09 Michael Anderson, Pierre Gorissen,
'## Huw Reddick and Richard Kinser
'##
'## This program is free. You can redistribute and/or modify it under the
'## terms of the GNU General Public License as published by the Free Software
'## Foundation; either version 2 or (at your option) any later version.
'##
'## All copyright notices regarding Snitz Forums 2000 must remain intact in
'## the scripts and in the HTML output. The "powered by" text/logo with a
'## link back to http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful but
'## WITHOUT ANY WARRANTY; without even an implied warranty of MERCHANTABILITY
'## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
'## for more details.
'##
'## You should have received a copy of the GNU General Public License along
'## with this program; if not, write to:
'##
'## Free Software Foundation, Inc.
'## 59 Temple Place, Suite 330
'## Boston, MA 02111-1307
'##
'## Support can be obtained from our support forums at:
'##
'## http://forum.snitz.com
'##
'## Correspondence and marketing questions can be sent to:
'##
'## manderson@snitz.com
'##
'###############################################################################
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_func_common.asp" -->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<%
set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString
%>
<!--#INCLUDE FILE="inc_func_rsslog.asp" -->
<!--#INCLUDE FILE="inc_func_rss.asp" -->
<%
dim intResults,Topic_ID,strSubject,Topic_Replies,Topic_Last_Post_Reply_ID
intResults = 10
' Disable images
strIcons = "0"
strIMGInPosts = "1"
strSql = "SELECT "
strSql = strSql & " T.T_REPLIES,"
strSql = strSql & " T.T_SUBJECT,"
strSql = strSql & " T.TOPIC_ID,"
strSql = strSql & " T.T_LAST_POST,"
strSql = strSql & " T.T_LAST_POST_AUTHOR,"
strSql = strSql & " T.T_LAST_POST_REPLY_ID,"
strSql = strSql & " T.T_MESSAGE"
strSql = strSql & " FROM " & strTablePrefix & "TOPICS T," & strTablePrefix & "FORUM F"
strSql = strSql & " WHERE T.FORUM_ID = F.FORUM_ID"
' #### strSql = strSql & " AND F.F_PRIVATEFORUMS = 0" #### replace this with custom list of allowed forums
' ## Just so you know, F_PRIVATEFORUMS holds the type of authorization set for the forum.
' ## Possible Values:
' ## 0 - All Visitors
' ## 1 - Allowed Member List
' ## 2 - Password Protected
' ## 3 - Allowed Member List & Password Protected
' ## 4 - Members Only
' ## 5 - Members Only (Hidden)
' ## 6 - Allowed Member List (Hidden)
' ## 7 - Members Only & Password Protected
' ## 8 - NT Global Group (Hidden)
' ## 9 - NT Global Group
strSql = strSql & strAllowedForums
if Request.QueryString("FORUM_ID") <> "" then
strSql = strSql & " AND T.FORUM_ID = " & cLng(Request.QueryString("FORUM_ID"))
end if
if Request.QueryString("CAT_ID") <> "" then
strSql = strSql & " AND T.CAT_ID = " & cLng(Request.QueryString("CAT_ID"))
end if
strSql = strSql & " AND T.T_STATUS = 1"
strSql = strSql & " ORDER BY T_LAST_POST DESC"
strSql = TopSQL(strSQL, 10)
set rs = Server.CreateObject("ADODB.Recordset")
rs.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
if rs.EOF then
recActiveTopicsCount = ""
else
allActiveTopics = rs.GetRows(adGetRowsRest)
recActiveTopicsCount = UBound(allActiveTopics,2)
end if
rs.close
set rs = nothing
xml = ""
xml = "<?xml version=""1.0"" encoding=""ISO-8859-1"" ?>" & vbNewLine
xml = xml & "<!-- RSS generation done by Snitz Forums 2000 on " & chkDate(datetostr(strForumTimeAdjust)," ",true) & " -->" & vbNewLine
xml = xml & "<rss version=""2.0"">" & vbNewLine
xml = xml & "<channel>" & vbNewLine
xml = xml & "<language>en-us</language>" & vbNewLine
xml = xml & "<lastBuildDate>" & Date2RFC822(strForumTimeAdjust)& "</lastBuildDate>" & vbNewLine
xml = xml & "<webMaster>" & strSender & "</webMaster>" & vbNewLine
xml = xml & "<ttl>60</ttl>" & vbNewLine
if Request.QueryString("FORUM_ID") = "" AND Request.QueryString("CAT_ID") = "" then
strNewTitle = strForumTitle
else
if Request.QueryString("FORUM_ID") <> "" then
strTempForum = cLng(request.querystring("FORUM_ID"))
strsql = "SELECT F_SUBJECT FROM " & strTablePrefix & "FORUM WHERE FORUM_ID=" & strTempForum
set tforums = my_conn.execute(strsql)
if tforums.bof or tforums.eof then
strNewTitle = strForumTitle
set tforums = nothing
else
strTempForumTitle = chkString(tforums("F_SUBJECT"),"display")
set tforums = nothing
strNewTitle = strForumTitle & " - " & strTempForumTitle
end if
else
strTempCat = cLng(request.querystring("CAT_ID"))
strsql = "SELECT CAT_NAME FROM " & strTablePrefix & "CATEGORY WHERE CAT_ID=" & strTempCat
set tCat = my_conn.execute(strsql)
if tCat.bof or tCat.eof then
strNewTitle = strForumTitle
set tCat = nothing
else
strTempForumTitle = chkString(tCat("CAT_NAME"),"display")
set tCat = nothing
strNewTitle = strForumTitle & " - " & strTempForumTitle
end if
end if
end if
xml = xml & "<title>" & strNewTitle & "</title>" & vbNewLine
xml = xml & "<link>" & strForumURL & "</link>" & vbNewLine
xml = xml & "<description>" & strForumTitle & strTitleOwner & "</description>" & vbNewLine
xml = xml & "<author>" & Topic_Last_Post_Author & "</author>"
xml = xml & "<image>" & vbNewLine
xml = xml & "<link>" & strForumURL & "</link>" & vbNewLine
xml = xml & "<url>" & strForumURL & "images/rss.gif</url>" & vbNewLine
xml = xml & "<title>" & strForumTitle & " RSS Feed</title>" & vbNewLine
xml = xml & "<width>65</width>" & vbNewLine
xml = xml & "<height>47</height>" & vbNewLine
xml = xml & "</image>" & vbNewLine
if recActiveTopicsCount <> "" then
fT_REPLIES = 0
fT_SUBJECT = 1
fTOPIC_ID = 2
fT_LAST_POST = 3
fT_LAST_POST_AUTHOR = 4
fT_LAST_POST_REPLY_ID = 5
fT_MESSAGE = 6
fR_MESSAGE = 7
for RowCount = recActiveTopicsCount to 0 step -1
Topic_Replies = allActiveTopics(fT_REPLIES,RowCount)
Topic_Subject = chkstring(replace(allActiveTopics(fT_SUBJECT,RowCount),"&","&"),"display")
Topic_ID = allActiveTopics(fTOPIC_ID,RowCount)
Topic_Last_Post = allActiveTopics(fT_LAST_POST,RowCount)
Topic_Last_Post_Author = getMemberName(allActiveTopics(fT_LAST_POST_AUTHOR,RowCount))
Topic_Last_Post_Reply_ID = allActiveTopics(fT_LAST_POST_REPLY_ID,RowCount)
if Topic_Replies > 0 then
Body = "There are " & Topic_Replies & " replies, with the last one on " & chkDate(Topic_Last_Post," at",true) & " by " & Topic_Last_Post_Author
Body = Body & vbNewLine & "Quote:" & vbNewLine & allActiveTopics(fT_MESSAGE,RowCount)
Body = Body & vbNewLine & funcGetReplyMessageText(allActiveTopics(fTOPIC_ID,RowCount))
else
Body = allActiveTopics(fT_MESSAGE,RowCount)
end if
Body = MakeCData(Body)
xml = xml & "<item>"
xml = xml & "<title>" & Topic_Subject & "</title>"
xml = xml & "<author>" & Topic_Last_Post_Author & "</author>"
xml = xml & "<link>" & strForumURL & DoLastPostLink & "</link>"
xml = xml & "<category>" & Forum_Subject & "</category>" & vbNewLine
xml = xml & "<pubDate>"& Date2RFC822(StrToDate(Topic_Last_Post)) &"</pubDate>"
xml = xml & "<guid>" & strForumURL & "topic.asp?TOPIC_ID=" & Topic_ID & "</guid>" & vbNewLine
xml = xml & "<description>" & Body & "</description>"
xml = xml & "</item>"
next
end if
xml = xml & "</channel></rss>"
Response.Clear
Response.Expires = 0
Response.ContentType = "text/xml"
Response.Write xml
my_Conn.close
set my_Conn = nothing
Response.End
Function Date2RFC822(Date2Convert)
dim rfc822timezone,rfc822daydate,rfc822dayno,rfc822day,rfc822monthno,rfc822month,rfc822year,rfc822hour,rfc822minute,rfc822seconds,rfc822time,pubdate
rfc822timezone = " -0300"
rfc822daydate = Day(Date2Convert)
if len(rfc822daydate) = 1 then rfc822daydate = "0" & rfc822daydate
' Get the number of the day of the week, assuming that Monday is the first day of the week.
rfc822dayno = Weekday(Date2Convert, 2)
select case rfc822dayno
case 1
rfc822day = "Mon"
case 2
rfc822day = "Tue"
case 3
rfc822day = "Wed"
case 4
rfc822day = "Thu"
case 5
rfc822day = "Fri"
case 6
rfc822day = "Sat"
case 7
rfc822day = "Sun"
end select
rfc822monthno = Month(Date2Convert)
select case rfc822monthno
case 1
rfc822month = "Jan"
case 2
rfc822month = "Feb"
case 3
rfc822month = "Mar"
case 4
rfc822month = "Apr"
case 5
rfc822month = "May"
case 6
rfc822month = "Jun"
case 7
rfc822month = "Jul"
case 8
rfc822month = "Aug"
case 9
rfc822month = "Sep"
case 10
rfc822month = "Oct"
case 11
rfc822month = "Nov"
case 12
rfc822month = "Dec"
end select
rfc822year = Year(Date2Convert)
rfc822hour = Hour(Date2Convert) & ":"
if len(rfc822hour) = 2 then
rfc822hour = "0" & rfc822hour
end if
rfc822minute = Minute(Date2Convert) & ":"
if len(rfc822minute) = 2 then
rfc822minute = "0" & rfc822minute
end if
rfc822seconds = second(Date2Convert)
if len(rfc822seconds) = 1 then
rfc822seconds = "0" & rfc822seconds
end if
rfc822time = rfc822hour & rfc822minute & rfc822seconds
' Put the whole thing together in the RFC822 format
' Example Tue, 21 Dec 2004 22:41:31 +0100
' Example : DDD, dd MMM yyyy, hh:mm:ss timezone
Date2RFC822 = rfc822day & ", " & rfc822daydate & " " & rfc822month & " " & rfc822year & " " & rfc822time & rfc822timezone
End Function
Function DoLastPostLink()
if Topic_Replies < 1 or Topic_Last_Post_Reply_ID = 0 then
DoLastPostLink = "topic.asp?TOPIC_ID=" & Topic_ID
elseif Topic_Last_Post_Reply_ID <> 0 then
PageLink = "whichpage=-1&"
AnchorLink = "&REPLY_ID="
DoLastPostLink = "topic.asp?" & PageLink & "TOPIC_ID=" & Topic_ID & AnchorLink & Topic_Last_Post_Reply_ID
else
DoLastPostLink = "topic.asp?TOPIC_ID=" & Topic_ID
end if
End Function
Function GetReplyBody()
strSqlReq = "SELECT R_MESSAGE FROM " & _
strTablePrefix & "REPLY WHERE " & _
" REPLY_ID=" & Topic_Last_Post_Reply_ID
set nrs = Server.CreateObject("ADODB.Recordset")
nrs.open strSqlReq, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
if not nrs.EOF then
reply = nrs.GetRows(adGetRowsRest)
end if
nrs.close
set nrs = nothing
GetReplyBody = reply(0,0)
End Function
Function MakeCData( foo )
MakeCData = "<![CDATA[" & formatStr(foo) & "]]>"
End Function
Function funcGetReplyMessageText(intTopicID)
strSql9 = "SELECT "
strSql9 = strSql9 & " TOPIC_ID,"
strSql9 = strSql9 & " R_MESSAGE"
strSql9 = strSql9 & " FROM " & strTablePrefix & "REPLY"
strSql9 = strSql9 & " WHERE TOPIC_ID = " & intTopicID
strSql9 = strSql9 & " AND R_STATUS = 1"
strSql9 = strSql9 & " ORDER BY R_DATE ASC"
set rs9 = Server.CreateObject("ADODB.Recordset")
rs9.open strSql9, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
strMsgDump = ""
while not rs9.EOF
strMsgDump = strMsgDump & "<hr>" & vbNewLine
strMsgDump = strMsgDump & rs9("R_MESSAGE") & vbNewLine
rs9.MoveNext
wend
rs9.close
set rs9 = nothing
End Function
%><%
'###############################################################################
'##
'## Snitz Forums 2000 v3.4.07
'##
'###############################################################################
'##
'## Copyright © 2000-09 Michael Anderson, Pierre Gorissen,
'## Huw Reddick and Richard Kinser
'##
'## This program is free. You can redistribute and/or modify it under the
'## terms of the GNU General Public License as published by the Free Software
'## Foundation; either version 2 or (at your option) any later version.
'##
'## All copyright notices regarding Snitz Forums 2000 must remain intact in
'## the scripts and in the HTML output. The "powered by" text/logo with a
'## link back to http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful but
'## WITHOUT ANY WARRANTY; without even an implied warranty of MERCHANTABILITY
'## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
'## for more details.
'##
'## You should have received a copy of the GNU General Public License along
'## with this program; if not, write to:
'##
'## Free Software Foundation, Inc.
'## 59 Temple Place, Suite 330
'## Boston, MA 02111-1307
'##
'## Support can be obtained from our support forums at:
'##
'## http://forum.snitz.com
'##
'## Correspondence and marketing questions can be sent to:
'##
'## manderson@snitz.com
'##
'###############################################################################
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_func_common.asp" -->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<%
set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString
%>
<!--#INCLUDE FILE="inc_func_rsslog.asp" -->
<!--#INCLUDE FILE="inc_func_rss.asp" -->
<%
dim intResults,Topic_ID,strSubject,Topic_Replies,Topic_Last_Post_Reply_ID
intResults = 10
strIcons = "0"
strIMGInPosts = "1"
strSql = "SELECT "
strSql = strSql & " T.T_REPLIES,"
strSql = strSql & " T.T_SUBJECT,"
strSql = strSql & " T.TOPIC_ID,"
strSql = strSql & " T.T_LAST_POST,"
strSql = strSql & " T.T_LAST_POST_AUTHOR,"
strSql = strSql & " T.T_LAST_POST_REPLY_ID,"
strSql = strSql & " T.T_MESSAGE,"
strSql = strSql & " F.F_SUBJECT,"
strSql = strSql & " R.R_MESSAGE "
strSql = strSql & " FROM " & strTablePrefix & "TOPICS T," & strTablePrefix & "FORUM F"
strSql = strSql & " WHERE T.FORUM_ID = F.FORUM_ID"
' ## strSql = strSql & " AND F.F_PRIVATEFORUMS = 0"
' ## Replace this with custom list of allowed forums
' ## F_PRIVATEFORUMS holds the forum authorization type. Possible Values:
' ## 0 - All Visitors
' ## 1 - Allowed Member List
' ## 2 - Password Protected
' ## 3 - Allowed Member List & Password Protected
' ## 4 - Members Only
' ## 5 - Members Only (Hidden)
' ## 6 - Allowed Member List (Hidden)
' ## 7 - Members Only & Password Protected
' ## 8 - NT Global Group (Hidden)
' ## 9 - NT Global Group
strSql = strSql & strAllowedForums
if Request.QueryString("FORUM_ID") <> "" then
strSql = strSql & " AND T.FORUM_ID = " & cLng(Request.QueryString("FORUM_ID"))
end if
if Request.QueryString("CAT_ID") <> "" then
strSql = strSql & " AND T.CAT_ID = " & cLng(Request.QueryString("CAT_ID"))
end if
strSql = strSql & " AND T.T_STATUS <= 1"
strSql = strSql & " ORDER BY T_LAST_POST DESC"
strSql = TopSQL(strSQL, intResults)
set rs = Server.CreateObject("ADODB.Recordset")
rs.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
if rs.EOF then
recActiveTopicsCount = ""
else
allActiveTopics = rs.GetRows(adGetRowsRest)
recActiveTopicsCount = UBound(allActiveTopics,2)
rs.close
end if
set rs = nothing
xml = ""
xml = "<?xml version=""1.0"" encoding=""ISO-8859-1"" ?>" & vbNewLine
xml = xml & "<!-- RSS generation done by Snitz Forums 2000 on " & chkDate(datetostr(strForumTimeAdjust)," ",true) & " -->" & vbNewLine
xml = xml & "<rss version=""2.0"">" & vbNewLine
xml = xml & "<channel>" & vbNewLine
xml = xml & "<language>en-us</language>" & vbNewLine
xml = xml & "<lastBuildDate>" & Date2RFC822(strForumTimeAdjust)& "</lastBuildDate>" & vbNewLine
xml = xml & "<webMaster>" & strSender & "</webMaster>" & vbNewLine
xml = xml & "<ttl>60</ttl>" & vbNewLine
if Request.QueryString("FORUM_ID") = "" AND Request.QueryString("CAT_ID") = "" then
strNewTitle = strForumTitle
else
if Request.QueryString("FORUM_ID") <> "" then
strTempForum = cLng(request.querystring("FORUM_ID"))
strsql = "SELECT F_SUBJECT FROM " & strTablePrefix & "FORUM WHERE FORUM_ID=" & strTempForum
set tforums = my_conn.execute(strsql)
if tforums.bof or tforums.eof then
strNewTitle = strForumTitle
set tforums = nothing
else
strTempForumTitle = chkString(tforums("F_SUBJECT"),"display")
set tforums = nothing
strNewTitle = strForumTitle & " - " & strTempForumTitle
end if
else
strTempCat = cLng(request.querystring("CAT_ID"))
strsql = "SELECT CAT_NAME FROM " & strTablePrefix & "CATEGORY WHERE CAT_ID=" & strTempCat
set tCat = my_conn.execute(strsql)
if tCat.bof or tCat.eof then
strNewTitle = strForumTitle
set tCat = nothing
else
strTempForumTitle = chkString(tCat("CAT_NAME"),"display")
set tCat = nothing
strNewTitle = strForumTitle & " - " & strTempForumTitle
end if
end if
end if
xml = xml & "<title>" & strNewTitle & "</title>" & vbNewLine
xml = xml & "<link>" & strForumURL & "</link>" & vbNewLine
xml = xml & "<description>" & strForumTitle & strTitleOwner & "</description>" & vbNewLine
xml = xml & "<author>" & Topic_Last_Post_Author & "</author>"
xml = xml & "<image>" & vbNewLine
xml = xml & "<link>" & strForumURL & "</link>" & vbNewLine
xml = xml & "<url>" & strHomeURL & strImageURL & "rss.gif</url>" & vbNewLine
xml = xml & "<title>" & strForumTitle & " RSS Feed</title>" & vbNewLine
xml = xml & "<width>65</width>" & vbNewLine
xml = xml & "<height>47</height>" & vbNewLine
xml = xml & "</image>" & vbNewLine
if recActiveTopicsCount <> "" then
fT_REPLIES = 0
fT_SUBJECT = 1
fTOPIC_ID = 2
fT_LAST_POST = 3
fT_LAST_POST_AUTHOR = 4
fT_LAST_POST_REPLY_ID = 5
fT_MESSAGE = 6
fF_SUBJECT = 7
fR_MESSAGE = 8
for RowCount = 0 to recActiveTopicsCount
Topic_Replies = allActiveTopics(fT_REPLIES,RowCount)
Topic_Subject = chkstring(replace(allActiveTopics(fT_SUBJECT,RowCount),"&","&"),"display")
Topic_ID = allActiveTopics(fTOPIC_ID,RowCount)
Topic_Last_Post = allActiveTopics(fT_LAST_POST,RowCount)
Topic_Last_Post_Author = getMemberName(allActiveTopics(fT_LAST_POST_AUTHOR,RowCount))
Topic_Last_Post_Reply_ID = allActiveTopics(fT_LAST_POST_REPLY_ID,RowCount)
Forum_Subject = chkstring(replace(allActiveTopics(fF_SUBJECT,RowCount),"&","&"),"display")
if Topic_Replies > 0 then
Body = "There are " & Topic_Replies & " replies, with the last one on " & chkDate(Topic_Last_Post," at",true) & " by " & Topic_Last_Post_Author
Body = Body & vbNewLine & "Quote:" & vbNewLine & allActiveTopics(fT_MESSAGE,RowCount)
Body = Body & vbNewLine & funcGetReplyMessageText(allActiveTopics(fTOPIC_ID,RowCount))
else
Body = allActiveTopics(fT_MESSAGE,RowCount)
end if
Body = MakeCData(Body)
xml = xml & "<item>"
xml = xml & "<title>" & Topic_Subject & "</title>"
xml = xml & "<author>" & Topic_Last_Post_Author & "</author>"
xml = xml & "<link>" & strForumURL & DoLastPostLink & "</link>"
xml = xml & "<category>" & Forum_Subject & "</category>" & vbNewLine
xml = xml & "<pubDate>"& Date2RFC822(StrToDate(Topic_Last_Post)) &"</pubDate>"
xml = xml & "<guid>" & strForumURL & "topic.asp?TOPIC_ID=" & Topic_ID & "</guid>" & vbNewLine
xml = xml & "<description>" & Body & "</description>"
xml = xml & "</item>"
next
end if
xml = xml & "</channel></rss>"
Response.Clear
Response.Expires = 0
Response.ContentType = "text/xml"
Response.Write xml
my_Conn.Close
set my_Conn = nothing
Response.End
Function Date2RFC822(Date2Convert)
' Convert the date to the RFC-822 format
dim rfc822timezone,rfc822daydate,rfc822dayno,rfc822day,rfc822monthno,rfc822month,rfc822year,rfc822hour,rfc822minute,rfc822seconds,rfc822time,pubdate
' Date2Convert = chkDate(Topic_Last_Post,"",true)
' Define your timezone offset below. Examples : "+0100" for GMT+1, "EST", "GMT"
rfc822timezone = " -0300"
rfc822daydate = Day(Date2Convert)
if len(rfc822daydate) = 1 then rfc822daydate = "0" & rfc822daydate
' Get the number of the day of the week, assuming that Monday is the first day of the week.
rfc822dayno = Weekday(Date2Convert, 2)
' Translate into the correct English abbreviation:
select case rfc822dayno
case 1
rfc822day = "Mon"
case 2
rfc822day = "Tue"
case 3
rfc822day = "Wed"
case 4
rfc822day = "Thu"
case 5
rfc822day = "Fri"
case 6
rfc822day = "Sat"
case 7
rfc822day = "Sun"
end select
rfc822monthno = Month(Date2Convert)
' Translate month into the correct English abbreviation:
select case rfc822monthno
case 1
rfc822month = "Jan"
case 2
rfc822month = "Feb"
case 3
rfc822month = "Mar"
case 4
rfc822month = "Apr"
case 5
rfc822month = "May"
case 6
rfc822month = "Jun"
case 7
rfc822month = "Jul"
case 8
rfc822month = "Aug"
case 9
rfc822month = "Sep"
case 10
rfc822month = "Oct"
case 11
rfc822month = "Nov"
case 12
rfc822month = "Dec"
end select
rfc822year = Year(Date2Convert)
rfc822hour = Hour(Date2Convert) & ":"
if len(rfc822hour) = 2 then
rfc822hour = "0" & rfc822hour
end if
rfc822minute = Minute(Date2Convert) & ":"
if len(rfc822minute) = 2 then
rfc822minute = "0" & rfc822minute
end if
rfc822seconds = second(Date2Convert)
if len(rfc822seconds) = 1 then
rfc822seconds = "0" & rfc822seconds
end if
rfc822time = rfc822hour & rfc822minute & rfc822seconds
' Assemble in the RFC822 format:
' Example Tue, 21 Dec 2004 22:41:31 +0100
' Example : DDD, dd MMM yyyy, hh:mm:ss timezone
Date2RFC822 = rfc822day & ", " & rfc822daydate & " " & rfc822month & " " & rfc822year & " " & rfc822time & rfc822timezone
end Function
Function DoLastPostLink()
if Topic_Replies < 1 or Topic_Last_Post_Reply_ID = 0 then
DoLastPostLink = "topic.asp?TOPIC_ID=" & Topic_ID
elseif Topic_Last_Post_Reply_ID <> 0 then
PageLink = "whichpage=-1&"
AnchorLink = "&REPLY_ID="
DoLastPostLink = "topic.asp?" & PageLink & "TOPIC_ID=" & Topic_ID & AnchorLink & Topic_Last_Post_Reply_ID
else
DoLastPostLink = "topic.asp?TOPIC_ID=" & Topic_ID
end if
end function
Function GetReplyBody()
strSqlReq = "SELECT R_MESSAGE FROM " & _
strTablePrefix & "REPLY WHERE " & _
" REPLY_ID=" & Topic_Last_Post_Reply_ID
set nrs = Server.CreateObject("ADODB.Recordset")
nrs.open strSqlReq, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
if not nrs.EOF then
reply = nrs.GetRows(adGetRowsRest)
end if
nrs.close
set nrs = nothing
GetReplyBody = reply(0,0)
end function
Function MakeCData( foo )
MakeCData = "<![CDATA[" & formatStr(foo) & "]]>"
end function
function funcGetReplyMessageText(intTopicID)
strSql9 = "SELECT "
strSql9 = strSql9 & " TOPIC_ID,"
strSql9 = strSql9 & " R_MESSAGE"
strSql9 = strSql9 & " FROM " & strTablePrefix & "REPLY"
strSql9 = strSql9 & " WHERE TOPIC_ID = " & intTopicID
strSql9 = strSql9 & " AND R_STATUS = 1"
strSql9 = strSql9 & " ORDER BY R_DATE ASC"
set rs9 = Server.CreateObject("ADODB.Recordset")
rs9.open strSql9, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
strMsgDump = ""
while not rs9.EOF
strMsgDump = strMsgDump & "<hr>" & vbNewLine
strMsgDump = strMsgDump & rs9("R_MESSAGE") & vbNewLine
rs9.MoveNext
wend
rs9.close
set rs9 = nothing
end function
%>Originally posted by Carefree
I think I see the issue. You only cover topics in the feed and ignore replies.Code:<%
'###############################################################################
'##
'## Snitz Forums 2000 v3.4.07
'##
'###############################################################################
'##
'## Copyright © 2000-09 Michael Anderson, Pierre Gorissen,
'## Huw Reddick and Richard Kinser
'##
'## This program is free. You can redistribute and/or modify it under the
'## terms of the GNU General Public License as published by the Free Software
'## Foundation; either version 2 or (at your option) any later version. '##
'## All copyright notices regarding Snitz Forums 2000 must remain intact in
'## the scripts and in the HTML output. The "powered by" text/logo with a
'## link back to http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet. '##
'## This program is distributed in the hope that it will be useful but
'## WITHOUT ANY WARRANTY; without even an implied warranty of MERCHANTABILITY
'## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
'## for more details. '##
'## You should have received a copy of the GNU General Public License along
'## with this program; if not, write to:
'##
'## Free Software Foundation, Inc. '## 59 Temple Place, Suite 330
'## Boston, MA 02111-1307
'##
'## Support can be obtained from our support forums at:
'##
'## http://forum.snitz.com
'##
'## Correspondence and marketing questions can be sent to:
'##
'## manderson@snitz.com
'##
'###############################################################################
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_func_common.asp" -->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<%
set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString
%>
<!--#INCLUDE FILE="inc_func_rsslog.asp" -->
<!--#INCLUDE FILE="inc_func_rss.asp" -->
<%
dim intResults,Topic_ID,strSubject,Topic_Replies,Topic_Last_Post_Reply_ID
intResults = 10
strIcons = "0"
strIMGInPosts = "1"
strSql = "SELECT "
strSql = strSql & " T.T_REPLIES,"
strSql = strSql & " T.T_SUBJECT,"
strSql = strSql & " T.TOPIC_ID,"
strSql = strSql & " T.T_LAST_POST,"
strSql = strSql & " T.T_LAST_POST_AUTHOR,"
strSql = strSql & " T.T_LAST_POST_REPLY_ID,"
strSql = strSql & " T.T_MESSAGE,"
strSql = strSql & " F.F_SUBJECT,"
strSql = strSql & " R.R_MESSAGE "
strSql = strSql & "FROM (FORUM_TOPICS T INNER JOIN FORUM_FORUM F ON T.FORUM_ID = F.FORUM_ID) LEFT JOIN FORUM_REPLY R ON T.T_LAST_POST_REPLY_ID = R.REPLY_ID" strSql = strSql & " WHERE T.FORUM_ID = F.FORUM_ID"
' ## strSql = strSql & " AND F.F_PRIVATEFORUMS = 0"
' ## Replace this with custom list of allowed forums
' ## F_PRIVATEFORUMS holds the forum authorization type. Possible Values:
' ## 0 - All Visitors
' ## 1 - Allowed Member List
' ## 2 - Password Protected
' ## 3 - Allowed Member List & Password Protected
' ## 4 - Members Only
' ## 5 - Members Only (Hidden)
' ## 6 - Allowed Member List (Hidden)
' ## 7 - Members Only & Password Protected
' ## 8 - NT Global Group (Hidden)
' ## 9 - NT Global Group
strSql = strSql & strAllowedForums
if Request.QueryString("FORUM_ID") <> "" then
strSql = strSql & " AND T.FORUM_ID = " & cLng(Request.QueryString("FORUM_ID"))
end if
if Request.QueryString("CAT_ID") <> "" then
strSql = strSql & " AND T.CAT_ID = " & cLng(Request.QueryString("CAT_ID"))
end if
strSql = strSql & " AND T.T_STATUS <= 1"
strSql = strSql & " ORDER BY T_LAST_POST DESC"
strSql = TopSQL(strSQL, intResults)
set rs = Server.CreateObject("ADODB.Recordset")
rs.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
if rs.EOF then
recActiveTopicsCount = ""
else
allActiveTopics = rs.GetRows(adGetRowsRest)
recActiveTopicsCount = UBound(allActiveTopics,2)
rs.close
end if
set rs = nothing
xml = ""
xml = "<?xml version=""1.0"" encoding=""ISO-8859-1"" ?>" & vbNewLine
xml = xml & "<!-- RSS generation done by Snitz Forums 2000 on " & chkDate(datetostr(strForumTimeAdjust)," ",true) & " -->" & vbNewLine
xml = xml & "<rss version=""2.0"">" & vbNewLine
xml = xml & "<channel>" & vbNewLine
xml = xml & "<language>en-us</language>" & vbNewLine
xml = xml & "<lastBuildDate>" & Date2RFC822(strForumTimeAdjust)& "</lastBuildDate>" & vbNewLine
xml = xml & "<webMaster>" & strSender & "</webMaster>" & vbNewLine
xml = xml & "<ttl>60</ttl>" & vbNewLine
if Request.QueryString("FORUM_ID") = "" AND Request.QueryString("CAT_ID") = "" then
strNewTitle = strForumTitle
else
if Request.QueryString("FORUM_ID") <> "" then
strTempForum = cLng(request.querystring("FORUM_ID"))
strsql = "SELECT F_SUBJECT FROM " & strTablePrefix & "FORUM WHERE FORUM_ID=" & strTempForum
set tforums = my_conn.execute(strsql)
if tforums.bof or tforums.eof then
strNewTitle = strForumTitle
set tforums = nothing
else
strTempForumTitle = chkString(tforums("F_SUBJECT"),"display")
set tforums = nothing
strNewTitle = strForumTitle & " - " & strTempForumTitle
end if
else
strTempCat = cLng(request.querystring("CAT_ID"))
strsql = "SELECT CAT_NAME FROM " & strTablePrefix & "CATEGORY WHERE CAT_ID=" & strTempCat
set tCat = my_conn.execute(strsql)
if tCat.bof or tCat.eof then
strNewTitle = strForumTitle
set tCat = nothing
else
strTempForumTitle = chkString(tCat("CAT_NAME"),"display")
set tCat = nothing
strNewTitle = strForumTitle & " - " & strTempForumTitle
end if
end if
end if
xml = xml & "<title>" & strNewTitle & "</title>" & vbNewLine
xml = xml & "<link>" & strForumURL & "</link>" & vbNewLine
xml = xml & "<description>" & strForumTitle & strTitleOwner & "</description>" & vbNewLine
xml = xml & "<author>" & Topic_Last_Post_Author & "</author>"
xml = xml & "<image>" & vbNewLine
xml = xml & "<link>" & strForumURL & "</link>" & vbNewLine
xml = xml & "<url>" & strHomeURL & strImageURL & "rss.gif</url>" & vbNewLine
xml = xml & "<title>" & strForumTitle & " RSS Feed</title>" & vbNewLine
xml = xml & "<width>65</width>" & vbNewLine
xml = xml & "<height>47</height>" & vbNewLine
xml = xml & "</image>" & vbNewLine
if recActiveTopicsCount <> "" then
fT_REPLIES = 0
fT_SUBJECT = 1
fTOPIC_ID = 2
fT_LAST_POST = 3
fT_LAST_POST_AUTHOR = 4
fT_LAST_POST_REPLY_ID = 5
fT_MESSAGE = 6
fF_SUBJECT = 7
fR_MESSAGE = 8
for RowCount = 0 to recActiveTopicsCount
Topic_Replies = allActiveTopics(fT_REPLIES,RowCount)
Topic_Subject = chkstring(replace(allActiveTopics(fT_SUBJECT,RowCount),"&","&"),"display")
Topic_ID = allActiveTopics(fTOPIC_ID,RowCount)
Topic_Last_Post = allActiveTopics(fT_LAST_POST,RowCount)
Topic_Last_Post_Author = getMemberName(allActiveTopics(fT_LAST_POST_AUTHOR,RowCount))
Topic_Last_Post_Reply_ID = allActiveTopics(fT_LAST_POST_REPLY_ID,RowCount)
Forum_Subject = chkstring(replace(allActiveTopics(fF_SUBJECT,RowCount),"&","&"),"display")
if Topic_Replies > 0 then
Body = "There are " & Topic_Replies & " replies, with the last one on " & chkDate(Topic_Last_Post," at",true) & " by " & Topic_Last_Post_Author
Body = Body & vbNewLine & "Quote:" & vbNewLine & allActiveTopics(fT_MESSAGE,RowCount)
Body = Body & vbNewLine & funcGetReplyMessageText(allActiveTopics(fTOPIC_ID,RowCount))
else
Body = allActiveTopics(fT_MESSAGE,RowCount)
end if
Body = MakeCData(Body)
xml = xml & "<item>"
xml = xml & "<title>" & Topic_Subject & "</title>"
xml = xml & "<author>" & Topic_Last_Post_Author & "</author>"
xml = xml & "<link>" & strForumURL & DoLastPostLink & "</link>"
xml = xml & "<category>" & Forum_Subject & "</category>" & vbNewLine
xml = xml & "<pubDate>"& Date2RFC822(StrToDate(Topic_Last_Post)) &"</pubDate>"
xml = xml & "<guid>" & strForumURL & "topic.asp?TOPIC_ID=" & Topic_ID & "</guid>" & vbNewLine
xml = xml & "<description>" & Body & "</description>"
xml = xml & "</item>"
next
end if
xml = xml & "</channel></rss>"
Response.Clear
Response.Expires = 0
Response.ContentType = "text/xml"
Response.Write xml
my_Conn.Close
set my_Conn = nothing
Response.End
Function Date2RFC822(Date2Convert)
' Convert the date to the RFC-822 format
dim rfc822timezone,rfc822daydate,rfc822dayno,rfc822day,rfc822monthno,rfc822month,rfc822year,rfc822hour,rfc822minute,rfc822seconds,rfc822time,pubdate
' Date2Convert = chkDate(Topic_Last_Post,"",true)
' Define your timezone offset below. Examples : "+0100" for GMT+1, "EST", "GMT"
rfc822timezone = " -0300"
rfc822daydate = Day(Date2Convert)
if len(rfc822daydate) = 1 then rfc822daydate = "0" & rfc822daydate
' Get the number of the day of the week, assuming that Monday is the first day of the week. rfc822dayno = Weekday(Date2Convert, 2)
' Translate into the correct English abbreviation:
select case rfc822dayno
case 1
rfc822day = "Mon"
case 2
rfc822day = "Tue"
case 3
rfc822day = "Wed"
case 4
rfc822day = "Thu"
case 5
rfc822day = "Fri"
case 6
rfc822day = "Sat"
case 7
rfc822day = "Sun"
end select
rfc822monthno = Month(Date2Convert)
' Translate month into the correct English abbreviation:
select case rfc822monthno
case 1
rfc822month = "Jan"
case 2
rfc822month = "Feb"
case 3
rfc822month = "Mar"
case 4
rfc822month = "Apr"
case 5
rfc822month = "May"
case 6
rfc822month = "Jun"
case 7
rfc822month = "Jul"
case 8
rfc822month = "Aug"
case 9
rfc822month = "Sep"
case 10
rfc822month = "Oct"
case 11
rfc822month = "Nov"
case 12
rfc822month = "Dec"
end select
rfc822year = Year(Date2Convert)
rfc822hour = Hour(Date2Convert) & ":"
if len(rfc822hour) = 2 then
rfc822hour = "0" & rfc822hour
end if
rfc822minute = Minute(Date2Convert) & ":"
if len(rfc822minute) = 2 then
rfc822minute = "0" & rfc822minute
end if
rfc822seconds = second(Date2Convert)
if len(rfc822seconds) = 1 then
rfc822seconds = "0" & rfc822seconds
end if
rfc822time = rfc822hour & rfc822minute & rfc822seconds
' Assemble in the RFC822 format:
' Example Tue, 21 Dec 2004 22:41:31 +0100
' Example : DDD, dd MMM yyyy, hh:mm:ss timezone
Date2RFC822 = rfc822day & ", " & rfc822daydate & " " & rfc822month & " " & rfc822year & " " & rfc822time & rfc822timezone
end Function
Function DoLastPostLink()
if Topic_Replies < 1 or Topic_Last_Post_Reply_ID = 0 then
DoLastPostLink = "topic.asp?TOPIC_ID=" & Topic_ID
elseif Topic_Last_Post_Reply_ID <> 0 then
PageLink = "whichpage=-1&"
AnchorLink = "&REPLY_ID="
DoLastPostLink = "topic.asp?" & PageLink & "TOPIC_ID=" & Topic_ID & AnchorLink & Topic_Last_Post_Reply_ID
else
DoLastPostLink = "topic.asp?TOPIC_ID=" & Topic_ID
end if
end function
Function GetReplyBody()
strSqlReq = "SELECT R_MESSAGE FROM " & _
strTablePrefix & "REPLY WHERE " & _
" REPLY_ID=" & Topic_Last_Post_Reply_ID
set nrs = Server.CreateObject("ADODB.Recordset")
nrs.open strSqlReq, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
if not nrs.EOF then
reply = nrs.GetRows(adGetRowsRest)
end if
nrs.close
set nrs = nothing
GetReplyBody = reply(0,0)
end function
Function MakeCData( foo )
MakeCData = "<![CDATA[" & formatStr(foo) & "]]>"
end function
function funcGetReplyMessageText(intTopicID)
strSql9 = "SELECT "
strSql9 = strSql9 & " TOPIC_ID,"
strSql9 = strSql9 & " R_MESSAGE"
strSql9 = strSql9 & " FROM " & strTablePrefix & "REPLY"
strSql9 = strSql9 & " WHERE TOPIC_ID = " & intTopicID
strSql9 = strSql9 & " AND R_STATUS = 1"
strSql9 = strSql9 & " ORDER BY R_DATE ASC"
set rs9 = Server.CreateObject("ADODB.Recordset")
rs9.open strSql9, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
strMsgDump = ""
while not rs9.EOF
strMsgDump = strMsgDump & "<hr>" & vbNewLine
strMsgDump = strMsgDump & rs9("R_MESSAGE") & vbNewLine
rs9.MoveNext
wend
rs9.close
set rs9 = nothing
end function
%>
This feed contains code errors.
Go back to the previous page.
More information
A semi colon character was expected.
Line: 19 Character: 126
<item><title>Fire on the SOVI</title><author>sneish</author><link>http://www.bcfmwu.com/forum/topic.asp?whichpage=-1&TOPIC_ID=9405&REPLY_ID=78203</link><category>BCFMWU General Chat Area</category>
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'cLng'
/forum/topic.asp, line 291
strSql4 = "ORDER BY R_DATE ASC "
if strDBType = "mysql" then
set rsReplies = Server.CreateObject("ADODB.Recordset")
rsReplies.open strSql1 & strSql2 & strSql3 & strSql4, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
if rsReplies.EOF then
iReplyCount = ""
else
arrReplyData = rsReplies.GetRows(adGetRowsRest)
iReplyCount = UBound(arrReplyData, 2)
rREPLY_ID = 0
end if
LastPostReplyID = cLng(Request.QueryString("REPLY_ID"))
if iReplyCount <> "" then
for iReply = 0 to iReplyCount
intReplyID = arrReplyData(rREPLY_ID,iReply)
if LastPostReplyID = intReplyID then
intPageNumber = ((iReply+1)/strPageSize)
if intPageNumber > cLng(intPageNumber) then
intPageNumber = cLng(intPageNumber) + 1
end if
strwhichpage = "whichpage=" & intPageNumber & "&"
exit for
end if
next
else
strwhichpage = ""
end if
rsReplies.Close