T O P I C R E V I E W |
NiteOwl |
Posted - 26 September 2009 : 02:06:13 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 |
15 L A T E S T R E P L I E S (Newest First) |
NiteOwl |
Posted - 11 October 2009 : 20:01:10 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.
|
Carefree |
Posted - 11 October 2009 : 17:14:31 When I checked your link, this is what I get:
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:
quote:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'cLng'
/forum/topic.asp, line 291
|
NiteOwl |
Posted - 11 October 2009 : 12:11:28 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.
|
Carefree |
Posted - 11 October 2009 : 09:22:25 quote: Originally posted by Carefree
I think I see the issue. You only cover topics in the feed and ignore replies.
<%
'###############################################################################
'##
'## 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. |
NiteOwl |
Posted - 10 October 2009 : 23:33:41 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 |
Carefree |
Posted - 08 October 2009 : 05:48:44 I think I see the issue. You only cover topics in the feed and ignore replies.
<%
'###############################################################################
'##
'## 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
%>
|
NiteOwl |
Posted - 07 October 2009 : 09:43:17 Thanks anyway Carefree for whatever reason I was also not able to use your second version either as it also displayed a blank screen, not blank but only the headings now and no threads. Darn
Anyway I am back to the code found in my second message at the beginning of this thread and still with my original dilemma, thank you so much for having a look I do appreciate it.
|
Carefree |
Posted - 07 October 2009 : 06:18:33 No, it just means my guess about the reversed display was incorrect. edit: faulty code deleted. |
NiteOwl |
Posted - 06 October 2009 : 20:07:29 Ok let me try, copied and pasted this entirely. Result is a blank screen. I have left it up
http://www.bcfmwu.com/forum/rss.asp?MEMBER_ID=115&ChkID=2738feb2bbb0
This looks like it maybe a RRS from Snitz board? if so it does not handle the private forums and I had to use the one from SnitzBiz |
Carefree |
Posted - 06 October 2009 : 13:04:36 Well, then the feed must be in reverse order. Try this:
<%
'###############################################################################
'##
'## 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
%>
|
NiteOwl |
Posted - 05 October 2009 : 20:45:59 I am not sure I understand? As it stands right now, (for whatever reason) The script posts the first topic of a thread Only, it absolutely never posts the last topic in the thread, which is what I want it to do. (no one wants to read the first post over and over in an RSS feed. smile.)
I do have a link to the RSS, and for-sure the threads are only posting the very first message, they do tell me there is more, BUT . . . grin
http://www.bcfmwu.com/forum/rss.asp?MEMBER_ID=115&ChkID=2738feb2bbb0
I have a test account Test10/test10
For example there is a thread on the RSS that is as follows:
Training on Days of rest October-05-09 9:36 AM There are 3 replies, with the last one on 2009/10/05 at 13:36:47 by Mike Cannon Quote: iv'e been doing a lot of training on days of rest this year and getting straight EDO for it does anyone know if this is correct?? Thax
This message is the first in the string, not the last... ?gulp, help?
|
Carefree |
Posted - 03 October 2009 : 14:38:12 I don't think that's correct, Niteowl. From the way the code reads, 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)
|
NiteOwl |
Posted - 03 October 2009 : 01:48:24 Anyone? |
NiteOwl |
Posted - 28 September 2009 : 17:57:52 Could someone point me to the code to draw out the last message in a thread, I will try and figure it out.
I beleive the code to pull the first message is:
allActiveTopics(fT_MESSAGE,RowCount)
|
NiteOwl |
Posted - 27 September 2009 : 02:01:45 I think I have the section narrowed down. IE I want to display the last post in my RSS not the First post. The piece of code i think is this from line 177:
Bolded in red I think is the piece that pulls the first message? Any help to figure out the code to pull the last message is greatly appreciated?
|
|
|