Mod: Display Recent Posts (anywhere)
Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Modifications
Forum Description: Mod's and Add-on's for Web Wiz Forums.
URL: https://forums.webwiz.net/forum_posts.asp?TID=23639
Printed Date: 27 March 2026 at 11:05pm Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com
Topic: Mod: Display Recent Posts (anywhere)
Posted By: WebWiz-Bruce
Subject: Mod: Display Recent Posts (anywhere)
Date Posted: 01 July 2007 at 12:38pm
This mod (which will be included as an extra in version 9) will allow you to display recent posts from your forum in other pages and even other websites using the Web Wiz Forums built in RSS Feed.
Just place the code below into any ASP page, on any website, where you want the recent posts to be displayed, it will then grab the most recent posts from your forums RSS Feed:-
<%
Dim objXMLHTTP 'MS XML Object Dim objRSSFeedItem 'XML Feed Items Dim sarryRSSFeedItem 'RSS Feed array Dim strHTML 'HTML Table results Dim strWebWizForumsURL 'Web Wiz Forums RSS Feed Dim intTimeToLive 'Time to live in minutes
'Holds the URL to the Web Wiz Forums RSS Feed strWebWizForumsURL = "http://forums.webwiz.net/RSS_topic_feed.asp"
'Time to live (how long the RSS Feed is cached in minutes) '0 will reload immediately, but place more strain on the server if the page is called to often intTimeToLive = 10
%> <table class="tableBorder" cellspacing="0" cellpadding="0" width="100%"> <tr class="tableLedger"> <td><strong>Recent Forum Posts</strong></td> </tr><%
'If this is x minutes or the feed is not in the web servers memory then grab the feed If DateDiff("n", Application("rssWebWizForumsUpdated"), Now()) >= intTimeToLive Then
'Create MS XML object Set objXMLHTTP = Server.CreateObject("MSXML2.FreeThreadedDOMDocument") 'Set the type of request HTTP Request objXMLHTTP.setProperty "ServerHTTPRequest", True 'Disable Asyncronouse response objXMLHTTP.async = False 'Load the Web Wiz Forums RSS Feed objXMLHTTP.Load(strWebWizForumsURL) 'If there is an error display a message If objXMLHTTP.parseError.errorCode <> 0 Then Response.Write "<strong>Error:</strong> " & objXMLHTTP.parseError.reason 'Create a new XML object containing the RSS Feed items Set objRSSFeedItem = objXMLHTTP.getElementsByTagName("item") 'Loop through each of the XML RSS Feed items and place it in an HTML table For Each sarryRSSFeedItem In objRSSFeedItem 'Web Wiz Forums RSS Feed Item childNodes '0 = title '1 = link '2 = description (post) '3 = pubDate '4 = guid (perminent link) strHTML = strHTML & " <tr class=""tableRow"">" & _ vbCrLf & " <td>" & _ vbCrLf & " <a href=""" & sarryRSSFeedItem.childNodes(1).text & """ title=""Posted: " & sarryRSSFeedItem.childNodes(3).text & """>" & sarryRSSFeedItem.childNodes(0).text & "</a>" 'If you wish to display the entire post, uncomment the line below 'strHTML = strHTML & vbCrLf & " <br />" & sarryRSSFeedItem.childNodes(2).text & "<br /><br />" strHTML = strHTML & vbCrLf & " </td>" Next 'Release the objects Set objXMLHTTP = Nothing Set objRSSFeedItem = Nothing 'Stick the whole lot in a application array to boost performance Application.Lock Application("rssWebWizForumsContent") = strHTML Application("rssWebWizForumsUpdated") = Now() Application.UnLock End If
'Display the Web Wiz Forums Posts in an HTML table Response.Write(Application("rssWebWizForumsContent")) %> </tr> </table> |
Change the URL in red to your own Web Wiz Forums RSS Feed.
The feed is cached and updates every 10 minutes to prevent strain on your server, but you can change this value to any you want, in minutes by changing the value in red.
This displays just the subjects as links to the actual post. If you wish to display the entire post, uncomment the line in blue.
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Replies:
Posted By: javi712
Date Posted: 01 July 2007 at 11:12pm
thanks!
|
Posted By: Praveen
Date Posted: 02 July 2007 at 2:17am
Can this be used for version 8.04??
-------------
|
Posted By: iSec
Date Posted: 02 July 2007 at 4:11am
This is not working for me, I changed the line in red but it's still displaying webwiz forums' RSS feed and not my forum's feed!
------------- "When it gets dark enough, you can see the stars"
-Charles A. Beard
|
Posted By: javi712
Date Posted: 02 July 2007 at 4:14am
|
I don't think its the script Info_Tech, I tried it on my site and it works fine.
|
Posted By: billd3
Date Posted: 02 July 2007 at 4:59am
Info_Tech wrote:
This is not working for me, I changed the line in red but it's still displaying webwiz forums' RSS feed and not my forum's feed! |
Same here!
Here's my test page, and I DID change the URL in the sample code above.
http://theamcforum.com/index-with-links.asp - http://theamcforum.com/index-with-links.asp
We have 8.06, or whatever the LATEST is, is there a problem in the code in the forum itself?
------------- BillD
http://theamcpages.com
http://theamcforum.com
|
Posted By: WebWiz-Bruce
Date Posted: 02 July 2007 at 7:14am
Praveen wrote:
Can this be used for version 8.04?? |
It will work with any version of Web Wiz Forums that has an RSS Feed.
Infact, this will work with almost any RSS Feed, not just a Web Wiz Forums RSS Feed. For example put in the BBC News RSS Feed URL and it would display that.
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: WebWiz-Bruce
Date Posted: 02 July 2007 at 7:18am
Info_Tech wrote:
This is not working for me, I changed the line in red but it's still displaying webwiz forums' RSS feed and not my forum's feed! |
To reduce strain on the server it caches the feed for 10 minutes. Change the 'intTimeToLive = 10' number to 0 and it will force the server to reload it's cache.
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: billd3
Date Posted: 02 July 2007 at 12:49pm
I wondered about a cache, as when I opened the rss feed asp file directly in my browser, it showed our forum posts, just not from the page I put that code in. Fixed/solved/understood. That is COOL! Thanks!
------------- BillD
http://theamcpages.com
http://theamcforum.com
|
Posted By: iSec
Date Posted: 02 July 2007 at 8:50pm
-boRg- wrote:
To reduce strain on the server it caches the feed for 10 minutes. Change the 'intTimeToLive = 10' number to 0 and it will force the server to reload it's cache.
|
thanks, that did it ... very nice work.
------------- "When it gets dark enough, you can see the stars"
-Charles A. Beard
|
Posted By: billd3
Date Posted: 02 July 2007 at 9:05pm
I note that with it set to 10, in our case, it NEVER refreshes - it will show the same each time you load the page, even hours later, or even if you clear your IE cache and restart the browser. Once you have seen what it shows, it sticks. I set it to 0 and it will change. Is there a web server setting that is doing this?
------------- BillD
http://theamcpages.com
http://theamcforum.com
|
Posted By: WebWiz-Bruce
Date Posted: 03 July 2007 at 11:47am
My msiatke it should be:-
If DateDiff("n", Application("rssWebWizForumsUpdated"), Now()) >= intTimeToLive ThenWith "m" in there it's set to months not minutes, so set to update every 10 months.
Teach me for knocking this together in 30 minutes on a Sunday afernoon without properly testing it 
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: iSec
Date Posted: 03 July 2007 at 4:09pm
-boRg- wrote:
To reduce strain on the server it caches the feed for 10 minutes. Change the 'intTimeToLive = 10' number to 0 and it will force the server to reload it's cache. |
How bad can it get, if I have around 500 people visiting that page every few minutes while the intTimeToLive' number is set to 0, would it bring my server down? Wouldn't that be a security issue?
------------- "When it gets dark enough, you can see the stars"
-Charles A. Beard
|
Posted By: WebCity
Date Posted: 07 July 2007 at 7:48pm
|
I am getting this error when I try to run this script. I put this in a empty file to test it out
Microsoft VBScript compilation error '800a0408'
Invalid character
/test.asp, line 4 Dim objXMLHTTP 'MS XML Object I named this file test.asp
|
Posted By: Sumea
Date Posted: 16 July 2007 at 6:17am
Info_Tech wrote:
-boRg- wrote:
To reduce strain on the server it caches the feed for 10 minutes. Change the 'intTimeToLive = 10' number to 0 and it will force the server to reload it's cache. |
How bad can it get, if I have around 500 people visiting that page every few minutes while the intTimeToLive' number is set to 0, would it bring my server down? Wouldn't that be a security issue? |
It could get very bogged down if you set it to 0 and have 500 people visiting every few minutes. I highly recommend you not have it at 0 if you have that many users.
What this script is doing is it looks up the rss feed for the latest posts and stores it into an application variable. The application variable is used like a cache, so it that others will see the latest posts without making another query to the database. It is set to do this once every ten minutes, but if you set it to 0, it will look up the rss feed every time a person visits the page. If you do plan to have it at 0, then you may as well not even put the results into an application variable and just output the results via a response.write.
|
Posted By: Sumea
Date Posted: 16 July 2007 at 6:27am
WebCity wrote:
I am getting this error when I try to run this script. I put this in a empty file to test it out
Microsoft VBScript compilation error '800a0408'
Invalid character
/test.asp, line 4 Dim objXMLHTTP 'MS XML Object I named this file test.asp
|
Can you remove the commentary out? This part:
'MS XML Object
It could be possible that when you copied and pasted the code, another
higher bit character was put in instead of the ' which is used to
comment out comments..
|
Posted By: Vapresto
Date Posted: 13 November 2007 at 3:39pm
I've attempted to do this myself, but it doesn't work at all - it just displays the code on the webpage if I use Firefox, or just the heading 'Display recent posts' if I view it in Safari!
This may be because I am using iWeb on a Mac to edit my webpage, using the 'webwidget' tool.
Anyone got any idea what I am doing wrong?
Here's a link to the test page I have hurriedly put up:
http://www.vapresto.com/Site/Welcome.html - http://www.vapresto.com/Site/Welcome.html
|
Posted By: Scotty32
Date Posted: 13 November 2007 at 4:11pm
the problem is you've added it to a HTML page an not an ASP page.
rename the page to "welcome.asp" and it will work.
HTML pages (eg .html and .htm) do not get processed by the server.
------------- S2H.co.uk - http://www.s2h.co.uk/wwf/" rel="nofollow - WebWiz Mods and Skins
For support on my mods + skins, please use http://www.s2h.co.uk/forum/" rel="nofollow - my forum .
|
Posted By: Vapresto
Date Posted: 13 November 2007 at 4:36pm
Hmmm... still can't get it to work.
Think it's something to do with iweb... It creates a 'web widget' which displays a separate page called 'webwidget.html' in a text box within the page where I want to display the recent topics. Trouble is, if I rename that page to webwidget.asp it can't find it...
I give up!
Thanks anyway!
|
Posted By: peachmelba
Date Posted: 18 October 2008 at 10:07pm
|
Can anyone help me.
I cant get "recent forum posts" to work.
I have put a test page here:
http://www.dolleruptorp.dk/index1.asp - www.dolleruptorp.dk/index1.asp
I get:
msxml3.dll error '80070005'
Access is denied.
/index1.asp, line 117
|
Posted By: lordtec
Date Posted: 21 June 2009 at 7:48pm
|
Has only a problem if the Access Group of the Member / Guest (Un-registered usesr) is clear he does not show anything, It is this change?
If you see the topics but it only between people logadas.
|
Posted By: rahulbhu
Date Posted: 04 June 2011 at 6:32am
Posted By: aussiem8
Date Posted: 23 March 2012 at 11:18pm
|
Is there any way to filter the name of the poster from the RSS feed (like the recent posts section within the forum) ?
|
Posted By: numanme
Date Posted: 08 February 2013 at 9:58pm
|
I have my
forum set that Only members with sufficient permission can access this page. So
the rss feed will not work
|
Posted By: numanme
Date Posted: 10 February 2013 at 9:32pm
|
have you got one to add to html
|
Posted By: Andy Rowland
Date Posted: 06 June 2014 at 12:08am
Is there a way of limiting how many recent posts are shown?
------------- Who the hell is calling at this time?
|
Posted By: houchaowei
Date Posted: 16 October 2015 at 8:49am
Infact, this will work with almost any RSS Feed, not just a Web Wiz
Forums RSS Feed. For example put in the BBC News RSS Feed URL and it
would display that.
------------- <br /> http://meizusale.com/blog - meizu m2 note review</a><br /> http://www.meizu-mx5.com/ - meizu mx5 specs</a><br /> http://www.mobuyphone.com/ - xiaomi mi4i review</a>
|
|