Print Page | Close Window

Mod Request: Latest 5-10 posts

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=19333
Printed Date: 28 March 2026 at 1:39pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Mod Request: Latest 5-10 posts
Posted By: Epperson
Subject: Mod Request: Latest 5-10 posts
Date Posted: 16 April 2006 at 7:34am
Anyway someone can write a script to show the last 5 or ten posts in the bottom of the forum? I have used that mod on every update and really miss having it on the new forum. A lot of the members on my forum are asking for it too.
 
Hope this is the right area to make a request if they are allowed.
 
Thanks in advance
 
 
Shane
http://www.surplus.cc - http://www.surplus.cc



Replies:
Posted By: dpyers
Date Posted: 16 April 2006 at 3:56pm
Yo need to change the title of this thread to have the Prefix "MOD Request:" otherwise people who might make the mod think you have made the mod and it's available for download. They'd be less inclined to view the thread.


-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: Epperson
Date Posted: 19 April 2006 at 4:04pm
Anyone have any idea if the old mods will work with this?


Posted By: toadjunior2001
Date Posted: 19 April 2006 at 7:51pm
Originally posted by Epperson Epperson wrote:

Anyone have any idea if the old mods will work with this?


The ones I've tried don't as the whole system is different in V8.  If I knew how to do it I would, but as it stands there is nothing yet for V8 that will accomplish this. (that I've seen)


Posted By: dpyers
Date Posted: 20 April 2006 at 4:15am
I hacked up Borgs rss feed to put the top 5 posts on a home page (link in my sig). This weekend I'll do something to put it on forum pages without having to use an iframe - I hope.
Running the SQL isn't a problem, but I want to use the permission system so people only see the latest 5 posts for forums they're allowed to view.

-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: maxim
Date Posted: 20 April 2006 at 4:18am

<%
'#########################################################################
'##
'## Display Newest Forum Posts with WebWizForums v7.x
'##
'## If you have any problems with this visit http://www.maddogs-asp.com - www.maddogs-asp.com
'## and post on the forums with the problem you are having and
'## if you have any error please post the full error so we can
'## help you easyer.
'##
'## Just change the database connection in the strMembersModCon
'## variable.
'##
'## Then make sure the strLastestPostsModForumPath is the right path
'## to your forum.
'##
'## Mod from http://www.maddogs-asp.com - www.maddogs-asp.com
'##
'## Writen by Drew Gauderman (aka MadDog)
'## Email: mailto:drew@madasp.com - drew@madasp.com
'## Website: http://www.maddogs-asp.com - www.maddogs-asp.com
'##
'#########################################################################
%>
<table width="135" cellpadding="0" cellspacing="0" class="text_arial">
  <tr>
    <td width="33%" align="left" nowrap height="25"> <font face="Arial, Helvetica, sans-serif" size="2">
      <%
Dim rsLastestPostsMod
Dim adoLastestPostsModCon
Dim strLastestPostsModCon
Dim strSQLLastsPostsMod
Dim strLastestPostsModTopicSubject
Dim strLastestPostsModForumPath
Dim intLastestPostsTotal

'The path to the forum
strLastestPostsModForumPath = ""

'How many new topics to show
intLastestPostsTotal = 25

'Database connection
'-----------------------------
'-----------------------------

'Default connection
'strLastestPostsModCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/database/wwforum.mdb")

'Uncomment for a full phsyical path. Then change the path
'strLastestPostsModCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:/yoursite/root/forum/admin/database/wwforum.mdb"

strLastestPostsModCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & strDbPathAndName  'This one is for Access 2000/2002

'Uncomment for a DSN connection
'strLastestPostsModCon = "DSN=DSN_NAME"

'-----------------------------
'-----------------------------

Set adoLastestPostsModCon = Server.CreateObject("ADODB.Connection")
adoLastestPostsModCon.Open strLastestPostsModCon

Set rsLastestPostsMod = Server.CreateObject("ADODB.Recordset")

strSQLLastsPostsMod = "SELECT Top " & intLastestPostsTotal & " tblTopic.Topic_ID, tblTopic.Subject, tblForum.Forum_ID "
strSQLLastsPostsMod = strSQLLastsPostsMod & "FROM tblForum INNER JOIN tblTopic ON tblForum.Forum_ID = tblTopic.Forum_ID "
strSQLLastsPostsMod = strSQLLastsPostsMod & "WHERE ((tblForum.Password) Is Null) "
strSQLLastsPostsMod = strSQLLastsPostsMod & "ORDER BY tblTopic.Last_entry_date DESC;"

rsLastestPostsMod.Open strSQLLastsPostsMod, adoLastestPostsModCon

If rsLastestPostsMod.EOF Then
 Response.Write "<span class=""text_arial"">No Forum Posts Made</span>"
Else
 Do while NOT rsLastestPostsMod.EOF
  If len(rsLastestPostsMod("Subject")) > 18 then
   strLastestPostsModTopicSubject = left(rsLastestPostsMod("Subject"),30) & "...&nbsp;"
  Else
   strLastestPostsModTopicSubject = rsLastestPostsMod("Subject")
  End If

  Response.Write("<img src=/Slike_template/kvadrat_CC3300.jpg width=5 height=5 hspace=5 align=absmiddle><a href=""" & strLastestPostsModForumPath & "forum_posts.asp?TID=" & rsLastestPostsMod("Topic_ID") & "&PN=1"" target=_parent>" & strLastestPostsModTopicSubject & "</a>")

 rsLastestPostsMod.MoveNext
 If NOT rsLastestPostsMod.EOF Then Response.Write("<br>")
 Loop
End If

'Reset Server Objects
rsLastestPostsMod.Close
Set rsLastestPostsMod = Nothing
adoLastestPostsModCon.Close
Set adoLastestPostsModCon = Nothing
%>

 
This is the mod that was done by MadDog and it worked fine for v7.x. Right now it only recognizes new topics but not new posts. Can smbd take a look and figure out what needs to be changed......txanks....


Posted By: Epperson
Date Posted: 20 April 2006 at 4:57am
Well I got something to work, take a peak at my website and if anyone wants the code just let me know.
 
http://www.surplus.cc/Board/default.asp - http://www.surplus.cc/Board/default.asp
 
 
 
I would like to learn how to make it look a bit better but it works.


Posted By: jsaren
Date Posted: 21 April 2006 at 1:14am
Originally posted by Epperson Epperson wrote:

Well I got something to work, take a peak at my website and if anyone wants the code just let me know.
 
http://www.surplus.cc/Board/default.asp - http://www.surplus.cc/Board/default.asp
 
 
 
I would like to learn how to make it look a bit better but it works.
 
It  seems like good!  i need it.


Posted By: Epperson
Date Posted: 21 April 2006 at 4:49am

 

Line 781 after the </tr> paste this code
 
 
<table cellspacing="1" cellpadding="3" class="tableBorder" align="center">
 <% If strDatabaseType = "Access" Then %>
<tr class="tableLedger">
  <td colspan="5">Latest Posts</td>
 </tr>
 <tr class="tableSubLedger">
    <td width="38%" align="center">Topic</td>
    <td width="19%" align="center">Forum</td>
    <td width="15%" align="center">Author</td>
    <td width="21%" align="center">Date</td>
    <td width="7%" align="center">Views</td>
  </tr>
<%
Dim rsLatestPosts
Dim intSay
Dim rsLatestPosts2
Dim sql2
Dim LastLatestPostsDateTime
Dim LastLatestPostsDate
Dim LastLatestPostsTime


Set rsLatestPosts = Server.CreateObject("ADODB.Recordset")
strSql = "Select " & strDbTable & "Topic.Subject, " & strDbTable & "Topic.Topic_ID, " & strDbTable & "Forum.Forum_ID, " & strDbTable & "Forum.Forum_name, " & strDbTable & "Topic.Last_Thread_ID, " & strDbTable & "Topic.No_of_views "
strSql = strSql & "From " & strDbTable & "Topic, " & strDbTable & "Forum Where " & strDbTable & "Topic.Hide = False And " & strDbTable & "Topic.Forum_ID = " & strDbTable & "Forum.Forum_ID Order By " & strDbTable & "Topic.Last_Thread_ID desc"
rsLatestPosts.Open strSQL, adoCon


For intSay = 1 to 5
if rsLatestPosts.Eof Then Exit For

Set rsLatestPosts2 = Server.CreateObject("ADODB.Recordset")
sql2 = "SELECT tblThread.Thread_ID, tblThread.Topic_ID, tblThread.Message_date, tblAuthor.Username, tblAuthor.Author_ID FROM (tblAuthor INNER JOIN tblThread ON tblAuthor.Author_ID = tblThread.Author_ID) WHERE tblThread.Hide = False And Topic_ID= " & rsLatestPosts("Topic_ID") & " order by Message_date desc"
rsLatestPosts2.Open sql2, adoCon

LastLatestPostsDateTime = rsLatestPosts2("Message_date")
LastLatestPostsDate = DateFormat(LastLatestPostsDateTime)
LastLatestPostsTime = TimeFormat(LastLatestPostsDateTime)


Response.Write "<tr class=""tableRow""><td><a href=""forum_posts.asp?TID=" & rsLatestPosts("Topic_ID") & """><img border=""0"" src=""" & strImagePath & "right_arrow.gif"" /></a>&nbsp;<a href=""forum_posts.asp?TID=" & rsLatestPosts("Topic_ID") & "&get=last#" & rsLatestPosts("Last_Thread_ID") & """>" & rsLatestPosts("Subject") & "</a></td><td><a href=""forum_topics.asp?FID=" & rsLatestPosts("Forum_ID") & """>" & rsLatestPosts("Forum_name") & "</a></td><td align=""center"">"&rsLatestPosts2("Username") &"</td><td align=""center"">" & LastLatestPostsDate & "-" & LastLatestPostsTime & "</td><td align=""center"">" & rsLatestPosts("No_of_views") & "</td></tr>"

rsLatestPosts.MoveNext
Next
end if

'Clean up
Call closeDatabase()

%>



Posted By: MadDog
Date Posted: 21 April 2006 at 6:42am
Any reason why you are creating two completely unnecessary Recordsets?

-------------
http://www.iportalx.net" rel="nofollow">


Posted By: Epperson
Date Posted: 21 April 2006 at 7:21pm
I have no clue, it just worked.
I have very little knowledge in this other than copy and paste:)
 
I would change it if I could.


Posted By: bims
Date Posted: 21 April 2006 at 10:34pm
Would love to know how to include this in other areas of my site.



Posted By: oguzhanosman
Date Posted: 22 April 2006 at 6:11pm
Thanks Epperson..Smile
İt is very good.
Heart


-------------
OĞUZHAN http://www.oguzhan.org - www.oguzhan.org

Ne mutlu Türküm diyene !



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net