Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - custom latest topics script?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

custom latest topics script?

 Post Reply Post Reply
Author
mtm81 View Drop Down
Groupie
Groupie


Joined: 03 December 2002
Status: Offline
Points: 57
Post Options Post Options   Thanks (0) Thanks(0)   Quote mtm81 Quote  Post ReplyReply Direct Link To This Post Topic: custom latest topics script?
    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

Back to Top
mtm81 View Drop Down
Groupie
Groupie


Joined: 03 December 2002
Status: Offline
Points: 57
Post Options Post Options   Thanks (0) Thanks(0)   Quote mtm81 Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
joshb View Drop Down
Groupie
Groupie


Joined: 26 June 2002
Location: United States
Status: Offline
Points: 134
Post Options Post Options   Thanks (0) Thanks(0)   Quote joshb Quote  Post ReplyReply Direct Link To This Post Posted: 19 April 2003 at 5:35pm

kind of like this 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.
Back to Top
mtm81 View Drop Down
Groupie
Groupie


Joined: 03 December 2002
Status: Offline
Points: 57
Post Options Post Options   Thanks (0) Thanks(0)   Quote mtm81 Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
joshb View Drop Down
Groupie
Groupie


Joined: 26 June 2002
Location: United States
Status: Offline
Points: 134
Post Options Post Options   Thanks (0) Thanks(0)   Quote joshb Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
mtm81 View Drop Down
Groupie
Groupie


Joined: 03 December 2002
Status: Offline
Points: 57
Post Options Post Options   Thanks (0) Thanks(0)   Quote mtm81 Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
joshb View Drop Down
Groupie
Groupie


Joined: 26 June 2002
Location: United States
Status: Offline
Points: 134
Post Options Post Options   Thanks (0) Thanks(0)   Quote joshb Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
mtm81 View Drop Down
Groupie
Groupie


Joined: 03 December 2002
Status: Offline
Points: 57
Post Options Post Options   Thanks (0) Thanks(0)   Quote mtm81 Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
 Post Reply Post Reply

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.