The Forum has been Updated
The code has been upgraded to the latest .NET core version. Please check instructions in the Community Announcements about migrating your account.
Hi - Well these days I carry a blackberry as do many others and using RSS just makes sense!
I installed the gelliott MoD some time ago. It works pretty good, BUT I want to display more than just the first post to a topic, I want to at the very least show the most recent post, and ultimately it would be great to see all the posts or even better just the new posts since the user last looked.
Anyone got that working? Or have a bit of time to fine tune what I have, I know that gelliott promised to finalize this thing but then he unfortunately moved on and I never heard back.
My old and last search for a resolution was in this topic http://forum.snitz.com/forum/topic.asp?TOPIC_ID=56247&whichpage=7
I installed the gelliott MoD some time ago. It works pretty good, BUT I want to display more than just the first post to a topic, I want to at the very least show the most recent post, and ultimately it would be great to see all the posts or even better just the new posts since the user last looked.
Anyone got that working? Or have a bit of time to fine tune what I have, I know that gelliott promised to finalize this thing but then he unfortunately moved on and I never heard back.
My old and last search for a resolution was in this topic http://forum.snitz.com/forum/topic.asp?TOPIC_ID=56247&whichpage=7
-=NiteOwl=-
Last edited by NiteOwl on 26 September 2009, 02:33
Posted
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 " & 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
%>
Posted
cool, ok, lets try this. I have this error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
Unknown column 'R.R_MESSAGE' in 'field list'
/forum/rss.asp, line 92
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
Unknown column 'R.R_MESSAGE' in 'field list'
/forum/rss.asp, line 92
-=NiteOwl=-
Posted
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
%>
Change the line in red.
Last edited by Carefree on 11 October 2009, 09:23
Posted
Hi Carefree, I did post the rss.asp as you provided, there are no errors, (as can be viewed) but there is also no content? (I did confirm that there are new messages in the forum, which there are) I am sorry to be such a pain and really do appreciate the time you have spent on this, I totally understand if its impacting your personal time too much.
-=NiteOwl=-
Last edited by NiteOwl on 11 October 2009, 13:36
Posted
When I checked your link, this is what I get:
Clicking the link results in another error:
Code:
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>
Clicking the link results in another error:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'cLng'
/forum/topic.asp, line 291
Last edited by Carefree on 11 October 2009, 17:16
Posted
I opened this in Explorer and see what your seeing, interesting that FireFox shows this.
As for the Topic.asp here is the section with line 291 (red), it seems ok
For the expected semi colon character, would that error not be generated from the result of the RSS file? ohh scratch that, as that makes no sense since line 19 is not relevant.
As for the Topic.asp here is the section with line 291 (red), it seems ok
Code:
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
For the expected semi colon character, would that error not be generated from the result of the RSS file? ohh scratch that, as that makes no sense since line 19 is not relevant.
-=NiteOwl=-
Last edited by NiteOwl on 11 October 2009, 20:09
Email Member
Message Member
Post Moderation
FileUpload
If you're having problems uploading, try choosing a smaller image.
Preview post
Send Topic
Loading...