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=-
آخرین ویرایش توسط
نوشته شده در
The RSS file I have was made to work much better for private forums like I have, by Gelliott and help also from Marcel, like I said its awesome, except it just needs to have the functionality to have the last post in the thread not the original.
here is my RSS
Oh if you want to see what I ahve now the RSS is here:
http://www.bcfmwu.com/forum/rss.asp?MEMBER_ID=115&ChkID=2738feb2bbb0
Oh and one final note, if you click the link above it gives this information: (as well as other topics ...)
News Release CKNW
September-25-09 3:45 PM
There are 3 replies, with the last one on 2009/09/25 at 19:45:38 by paintermarine
Quote:
More doin's on the bridge
VICTORIA/CKNW(AM980)
BUT the rest of the text is from the first message not the most recent one..?? So all I ever read is the original post over and over where I should be reading the most recent post or POSTS
Thanks
here is my RSS
Code:
<%
'#################################################################################
'## 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
%>
Oh if you want to see what I ahve now the RSS is here:
http://www.bcfmwu.com/forum/rss.asp?MEMBER_ID=115&ChkID=2738feb2bbb0
Oh and one final note, if you click the link above it gives this information: (as well as other topics ...)
News Release CKNW
September-25-09 3:45 PM
There are 3 replies, with the last one on 2009/09/25 at 19:45:38 by paintermarine
Quote:
More doin's on the bridge
VICTORIA/CKNW(AM980)
BUT the rest of the text is from the first message not the most recent one..?? So all I ever read is the original post over and over where I should be reading the most recent post or POSTS
Thanks
-=NiteOwl=-
آخرین ویرایش توسط
نوشته شده در
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?
Code:
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
-=NiteOwl=-
آخرین ویرایش توسط
نوشته شده در
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)
I beleive the code to pull the first message is:
allActiveTopics(fT_MESSAGE,RowCount)
-=NiteOwl=-
نوشته شده در
Anyone?
-=NiteOwl=-
نوشته شده در
I don't think that's correct, Niteowl. From the way the code reads,
Code:
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)
آخرین ویرایش توسط
نوشته شده در
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?
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?
-=NiteOwl=-
آخرین ویرایش توسط
نوشته شده در
Well, then the feed must be in reverse order. Try this:
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
' 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
%>
نوشته شده در
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
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
-=NiteOwl=-
آخرین ویرایش توسط
نوشته شده در
No, it just means my guess about the reversed display was incorrect.
edit: faulty code deleted.
آخرین ویرایش توسط
نوشته شده در
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.
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.
-=NiteOwl=-
آخرین ویرایش توسط
Email Member
Message Member
Post Moderation
بارگزاری فایل
If you're having problems uploading, try choosing a smaller image.
پیشنمایش مطلب
Send Topic
Loading...