Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - MOD: Latest Forum Posts for your website
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

MOD: Latest Forum Posts for your website

 Post Reply Post Reply Page  123 5>
Author
MadDog View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 01 January 2002
Status: Offline
Points: 3008
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadDog Quote  Post ReplyReply Direct Link To This Post Topic: MOD: Latest Forum Posts for your website
    Posted: 21 April 2006 at 7:07am
This file is intended to help people put a "Latest Forum Posts" box on their website, or a simple file to start from somewhere.

This mod will not add Latest Forum Posts to the forum pages, unless you add the code to do it.

Download/View Mod Here


Edited by MadDog - 19 July 2006 at 10:35pm
Back to Top
ppkppk View Drop Down
Groupie
Groupie
Avatar

Joined: 24 November 2003
Location: United Kingdom
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote ppkppk Quote  Post ReplyReply Direct Link To This Post Posted: 21 April 2006 at 11:16pm
I have copied your code exactly, changed the path to the database and the forum, however I get
 
"invalid character"
 
for the line
 
strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("xxx/forum.mdb")
 
The path above was changed for security
Back to Top
ppkppk View Drop Down
Groupie
Groupie
Avatar

Joined: 24 November 2003
Location: United Kingdom
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote ppkppk Quote  Post ReplyReply Direct Link To This Post Posted: 23 April 2006 at 9:52pm

Has anyone used the code above with success?

Back to Top
ppkppk View Drop Down
Groupie
Groupie
Avatar

Joined: 24 November 2003
Location: United Kingdom
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote ppkppk Quote  Post ReplyReply Direct Link To This Post Posted: 27 April 2006 at 9:25pm
To clarify this mod is designed to be added to any page in a web site and draw the latest posts from the forum. It is not for inclusion into the forum itself.
 
I have now managed to get past the invalid character bit - there was a space that got carried over when I copied it from this forum. However I now get...
 
"Characters found after end of SQL statement"
 
for the line...
 
rsCommon.Open strSQL, adoCon
 
My code looks like this (database details removed for security)....
 
<%
'#########################################################################
'##
'## Display Newest Forum Posts with WebWizForums v8.x
'##
'## Just configure the database settings and it will read the latest forum
'## posts. This file should be setup for your website.
'##
'## Mod from
www.iportalx.net
'##
'## Writen by Drew Gauderman (aka MadDog)
'## Email:
drew@aspinvision.com
'## Website: www.iportalx.net
'##
'## Dont want to do this yourself? Get iPortalX! A Portal with WebWizForum!
'##
http://www.iportalx.net
'##
'#########################################################################

Dim rsCommon
Dim adoCon
Dim strCon
Dim strSQL
Dim strLastestPostsModTopicSubject
Dim strLastestPostsModForumPath
Dim intLastestPostsTotal
Dim strDatabaseType
Dim strDBTrue
Dim strDBFalse
'The path to the forum
strForumPath = "../forum/"
'How many new topics to show
intLastestPostsTotal = 25
'//-----------------------------------------------------
'// Database connection and settings
'//-----------------------------------------------------
'Database settings for Access
strDatabaseType = "Access"
strDBTrue = "True"
strDBFalse = "False"
'Database settings for MSSQL
'strDatabaseType = "SQLServer"
'strDBTrue = "1"
'strDBFalse = "0"
'Database settings for MySQL
'strDatabaseType = "MySQL"
'strDBFalse = 0
'strDBTrue = -1
'Access connection
strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("../forum")

'MSSQL Connection
'Const strSQLServerName = ".\SQLExpress" 'Holds the name of the SQL Server (This is the name/location or IP address of the 'SQL Server)
'Const strSQLDBUserName = "sa" 'Holds the user name (for SQL Server Authentication)
'Const strSQLDBPassword = "blank" 'Holds the password (for SQL Server Authentication)
'Const strSQLDBName = "beta2"
'strCon = "Provider=SQLOLEDB;Server=" & strSQLServerName & ";User ID=" & strSQLDBUserName & ";Password=" & strSQLDBPassword & ";Database=" & strSQLDBName & ";"
'//-----------------------------------------------------
'Start the database connection
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open strCon
'Start a recordset connection
Set rsCommon = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT "
If strDatabaseType = "SQLServer" OR strDatabaseType = "Access" Then strSQL = strSQL & " TOP " & intLastestPostsTotal & " "
strSQL = strSQL & "tblForum.Forum_name, tblTopic.Topic_ID, tblTopic.Subject, tblThread.Thread_ID, tblThread.Message_date, tblAuthor.Author_ID, tblAuthor.Username, tblThread.Message  " & _
"FROM tblForum, tblTopic, tblAuthor, tblThread, tblPermissions" & _
"WHERE tblForum.Forum_ID = tblTopic.Forum_ID " & _
"AND tblTopic.Topic_ID = tblThread.Topic_ID " & _
"AND tblAuthor.Author_ID = tblThread.Author_ID " & _
"AND tblForum.Forum_ID = tblPermissions.Forum_ID " & _
"AND (tblPermissions.Group_ID = 2 AND tblPermissions.View_Forum = " & strDBTrue & ") "
strSQL = strSQL & "AND (tblForum.Password = '' OR tblForum.Password Is Null) AND (tblTopic.Hide = " & strDBFalse & " AND tblThread.Hide = " & strDBFalse & ") ORDER BY tblThread.Message_date DESC "
'mySQL limit operator
If strDatabaseType = "mySQL" Then strSQL = strSQL & " LIMIT " & intLastestPostsTotal
strSQL = strSQL & ";"
rsCommon.Open strSQL, adoCon
If NOT rsCommon.EOF Then saryForumPosts = rsCommon.getRows()
'Close all connections, very important!!
rsCommon.Close
Set rsCommon = Nothing
adoCon.Close
Set adoCon = Nothing
 
'No forum posts
If IsArray(saryForumPosts) = False Then
Response.Write "<span class=""text_arial"">No Forum Posts Made</span>"
'Forum posts have been made
Else
'Loop through the array of forum posts
For intLoopCounter = 0 TO UBound(saryForumPosts, 2)
'saryForumPosts array lookup table
'0 = tblForum.Forum_name
'1 = tblTopic.Topic_ID
'2 = tblTopic.Subject
'3 = tblThread.Thread_ID
'4 = tblThread.Message_date
'5 = tblAuthor.Author_ID
'6 = tblAuthor.Username
'7 = tblThread.Message
strLastestPostsModTopicSubject = saryForumPosts(2, intLoopCounter)
'Crop the subject down to 18 characters
If Len(strLastestPostsModTopicSubject) > 18 then strLastestPostsModTopicSubject = Left(strLastestPostsModTopicSubject,30) & "..."
Response.Write("<a href=""" & strForumPath & "forum_posts.asp?TID=" & saryForumPosts(1, intLoopCounter) & """>" & strLastestPostsModTopicSubject & "</a><br />")
Next
End If
%>
 
Any help with this would be greatly appreciated as the users of my forum are missing this feature.
Back to Top
potorrillo View Drop Down
Newbie
Newbie


Joined: 22 April 2006
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote potorrillo Quote  Post ReplyReply Direct Link To This Post Posted: 02 May 2006 at 10:52pm
Thanks. It's ok now.
Back to Top
ppkppk View Drop Down
Groupie
Groupie
Avatar

Joined: 24 November 2003
Location: United Kingdom
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote ppkppk Quote  Post ReplyReply Direct Link To This Post Posted: 02 May 2006 at 11:50pm
In fact I would be most appreciative of a mod for showing the last 10-20 posts anywhere in my web site not just within the forum itself.
Back to Top
fx5500 View Drop Down
Groupie
Groupie
Avatar

Joined: 30 July 2005
Location: Turkey
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote fx5500 Quote  Post ReplyReply Direct Link To This Post Posted: 03 May 2006 at 4:22pm
This mod isnt working on my server..:(
Back to Top
wizmike View Drop Down
Newbie
Newbie


Joined: 27 June 2006
Location: Australia
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote wizmike Quote  Post ReplyReply Direct Link To This Post Posted: 03 July 2006 at 1:57pm
Originally posted by ppkppk ppkppk wrote:

In fact I would be most appreciative of a mod for showing the last 10-20 posts anywhere in my web site not just within the forum itself.
 
So would I....
 
I also get an sql error.
 
 
 
.


Edited by wizmike - 03 July 2006 at 3:08pm
Back to Top
 Post Reply Post Reply Page  123 5>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.