Print Page | Close Window

custom latest topics script?

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=1923
Printed Date: 31 March 2026 at 3:10am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: custom latest topics script?
Posted By: mtm81
Subject: custom latest topics script?
Date Posted: 19 April 2003 at 1:06pm

Hi,

I have the little v6 mod that allows me to show the latest threads to my forum, anyhwere on my site... this works fine... however,
I have several forum categories and was wondering how I would go about altering the script to only show the latest threads from a particular category..
Say for instance I have:
Forum Title 1
Forum Title2
Forum Title 3

At present the script shows the latest topics, regardless of which of the above they came from..

I would like to have a script to show the latest posts from forum 1...
I could then place this on 'x' pages in my site,,,

then a second script would grab the latest from forum 2 and I could have this on 'y' pages on my site...

Does this make sense?

Any help would be great appreciated.

James




Replies:
Posted By: mtm81
Date Posted: 19 April 2003 at 5:30pm

right I've figured out my above problem... but now I have another :-(

Underneath each post I need to also show the date it was posted and who posted it...

My current script looks like:

<%
Dim rsLastestPosts

Dim strSQL

'Create a connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")

'Database connection info and driver
strCon = "DRIVER={Microsoft Access Driver (*.mdb)};uid=;pwd=; DBQ=" & Server.MapPath("forum/admin/wwForum.mdb")

'Set an active connection to the Connection object
adoCon.Open strCon

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

strSQL = "SELECT Top 1 tblForum.*, tblTopic.*, tblThread.Author_ID, tblAuthor.Username "
strSQL = strSQL & "FROM (tblForum INNER JOIN tblTopic ON tblForum.Forum_ID = tblTopic.Forum_ID) INNER JOIN (tblAuthor INNER JOIN tblThread ON tblAuthor.Author_ID = tblThread.Author_ID) ON tblTopic.Topic_ID = tblThread.Topic_ID "
strSQL = strSQL & "WHERE ((tblForum.Password) Is Null) AND tblTopic.Forum_ID = 2 "
strSQL = strSQL & "ORDER BY tblTopic.Last_entry_date DESC;"

rsLastestPosts.Open strSQL, strCon

If rsLastestPosts.EOF Then Response.Write "<span class=""smltext"">No Forum Posts Made</span>"

strPosts = rsLastestPosts("Subject") & "<br>" & rsLatestPosts("tblTopic.Last_entry_date") & "<br>" & rsLatestPosts("tblAuthor.UserName")


%>
<a href="forum/display_topic_threads.asp?ForumID=<% = rsLastestPosts("Forum_ID") %>&TopicID=<% = rsLastestPosts("Topic_ID") %>&PagePosition=1" target="_self" style="font-size:<% = intSmallFontSize %>" title="<% = rsLastestPosts("Subject") %><% Response.Write vbCrLf & "- Last Post On: " & rsLastestPosts("Last_entry_date") & " - " %><%

      If NOT rsLastestPosts("Password") = "" Then
  Response.Write vbCrLf & (" - Password Required - ")
 ElseIf CDate(Session("dtmLastVisit")) < rsLastestPosts("Last_entry_date") AND (CBool(rsLastestPosts("Locked")) = "True") Then
  Response.Write vbCrLf & (" - Locked Forum - ")
 ElseIf CBool(rsLastestPosts("Locked")) = "True" Then
  Response.Write vbCrLf & (" - Closed Forum - ")
 ElseIf CDate(Session("dtmLastVisit")) < rsLastestPosts("Last_entry_date") Then
  Response.Write vbCrLf & (" - New Posts - ")
 Else
  Response.Write vbCrLf & (" - No New Posts - ")
 End If

%>"><% = strPosts %></a>

 

But it keeps throwing errors.. any ideas?

 

James



Posted By: joshb
Date Posted: 19 April 2003 at 5:35pm

kind of like this http://www.jbdevstudios.com/portal/ - http://www.jbdevstudios.com/portal/ ? but in a list rather then a box? let me know ill show you how.



-------------
I'm a wannabe programmer that knows how to do nothing but create invalid procedure arguments.
http://www.soopportal.com">


Posted By: mtm81
Date Posted: 19 April 2003 at 5:48pm

thanks for the reply...

which part of your page are you referring to?? I can't see what I'm after...

Basically all I need is:
1) To show the latest post from a specific topic (can do this, no prbs)
2) Next to that link, i need to show the time it was posted and by whom...

that's it....

I've been trying to modifiy an existing mod I got from the maddog site (I think) which allowed me to show the 6 latest threads from any forum on any part of my site... but without much success...

 

James



Posted By: joshb
Date Posted: 19 April 2003 at 5:59pm

i was referring to the news in the middle. i was having trouble grabbing only the first topic form my news forum. it was giving me replies to my topic

so i wrote a small script so it cycles and only grab the first one in the topic of threads, which could be easily modded to give you the lastest.



-------------
I'm a wannabe programmer that knows how to do nothing but create invalid procedure arguments.
http://www.soopportal.com">


Posted By: mtm81
Date Posted: 19 April 2003 at 6:08pm

hhm.. I'm not sure that's exactly what I'm after... it's shows the whole post etc...

All I want it literally this:

Latest Forum Post

Forums Post 1 blah....
Posted by : Username
Date: Date

 

In a box in various sections in my site...

 

I can do the Forums Post 1 part just can't add the username and date to the info.. I keep getting errrors when I try and pull that info as well, although I know my query is good...

James



Posted By: joshb
Date Posted: 19 April 2003 at 6:09pm
hmm...wel sorry I couldn't be of help bro.

-------------
I'm a wannabe programmer that knows how to do nothing but create invalid procedure arguments.
http://www.soopportal.com">


Posted By: mtm81
Date Posted: 19 April 2003 at 6:13pm

no probs.... thanks anyway...
I can't believe I can't figure this out..
I have a query which works fine...
I have code, which if I only  try and pull the actual thread title from, works fine, but as soon as I try and pull the related username and date from it, it breaks..

I keep getting a Object Required....error...

 

James




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