Print Page | Close Window

mod w/ Last Post Topic

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=7871
Printed Date: 07 April 2026 at 7:44pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: mod w/ Last Post Topic
Posted By: jimdmurphy
Subject: mod w/ Last Post Topic
Date Posted: 05 December 2003 at 3:02am
Is there a mod that places the last post Topic name within the Last Post cell of default.asp?



Replies:
Posted By: jimdmurphy
Date Posted: 08 December 2003 at 1:11am
If this mod exists it would provide the user the oportunity to know the topic of the latest post in a forum prior to them linking to that topic. 


Posted By: jimdmurphy
Date Posted: 09 December 2003 at 11:34pm

okay,  I'll assume that there aren't any mods for this...

I can probably figure out where in default.asp to make the mod, but any advice is welcome.



Posted By: jimdmurphy
Date Posted: 17 January 2004 at 11:33am

I made the following changes to default.asp to accomplish placing a link to the last Subject:

Dim strLastEntrySubject     'Holds the subject of the last entry

---------

In the section " 'Initalise the strSQL variable with an SQL statement to query the database for the date of the last entry and the author for the thread " I added:

Topic.Subject to the SELECT

AND an INNER JOIN (INNER JOIN "  & strDbTable & "Topic ON " & strDbTable & "Topic.Topic_ID = " & strDbTable & "Thread.Topic_ID "
) to the FROM clause

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

I added ("      strLastEntrySubject = rsCommon("Subject") ")  to the "      'If there are threads for topic then read in the date and author of the last entry" section

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

AND  ( <a href=""forum_posts.asp?TID=" & lngLastEntryTopicID & "&get=last#" & lngLastEntryMeassgeID & """ target=""_self"">" & strLastEntrySubject & "</a>" ) to the "  'Write the HTML of the forum descriptions and hyperlinks to the forums" section.

 

--------

These changes to support MS-Access work well except for forums that have no topics yet.  Since INNER JOIN is supported but not LEFT JOIN, the Subject in the query is populated even for null topics.

Example of mod:




Posted By: LePaul
Date Posted: 18 January 2004 at 8:15am

Any chance of a link to your mod'd default.asp ?

The oppritunity to screw up a lot in that file by me, a newbie, is immense 

Or email me bd5pilot at yahoo dot com

Thanks!



Posted By: jimdmurphy
Date Posted: 21 January 2004 at 8:49am

LePaul,

I will email you the complete default.asp.

Here are the lines I changed:

---------------- create holder for subject "topic name"

' MOD: to display Topic Name in Last Post column
Dim strLastEntrySubject     'Holds the subject of the last entry

---------------- Add the Subject column to the SELECT statement in the Access query

'       strSQL = "SELECT Top 1 " & strDbTable & "Author.Username, " & strDbTable & "Author.Author_ID, " & strDbTable & "Thread.Topic_ID, " & strDbTable & "Thread.Thread_ID, " & strDbTable & "Thread.Message_date "
' MOD: to display Topic Name in Last Post column
       strSQL = "SELECT Top 1 " & strDbTable & "Author.Username, " & strDbTable & "Author.Author_ID, " & strDbTable & "Thread.Topic_ID, " & strDbTable & "Thread.Thread_ID, " & strDbTable & "Thread.Message_date, " & strDbTable & "Topic.Subject "

---------------- Add an INNER JOIN to the Access query to include the Subject from the Topic table

'       strSQL = strSQL & "FROM " & strDbTable & "Author "
' MOD: to display Topic Name in Last Post column
       strSQL = strSQL & "FROM " & strDbTable & "Author, " & strDbTable & "Thread   INNER JOIN "  & strDbTable & "Topic ON " & strDbTable & "Topic.Topic_ID = " & strDbTable & "Thread.Topic_ID "

---------------- populate the strLastEntrySubject from the query results

' MOD: to display Topic Name in Last Post column
       strLastEntrySubjec t = rsCommon("Subject")

---------------- Add the link to the last entry using the Subject as the hypertext

'      Response.Write(""" background=""" & strTableBgImage & """ width=""29%"" class=""smText"" align=""right""  nowrap=""nowrap"">" & DateFormat(dtmLastEntryDate, saryDateTimeData) & "&nbsp;" &  strTxtAt & "&nbsp;" & TimeFormat(dtmLastEntryDate, saryDateTimeData) & "" & _
' MOD: to display Topic Name in Last Post column      
      Response.Write(""" background=""" & strTableBgImage & """ width=""29%"" class=""smText"" align=""right""  nowrap=""nowrap""><a href=""forum_posts.asp?TID=" & lngLastEntryTopicID & "&get=last#" & lngLastEntryMeassgeID & """ target=""_self"">" & strLastEntrySubject & "</a>" & vbCrLf & "        <br />" & DateFormat(dtmLastEntryDate, saryDateTimeData) & "&nbsp;" &  strTxtAt & "&nbsp;" & TimeFormat(dtmLastEntryDate, saryDateTimeData) & "" & _



Posted By: drjamez
Date Posted: 21 January 2004 at 10:36am

Will this work on the SQL Server version, or is it just for Access?

- James -



Posted By: jimdmurphy
Date Posted: 22 January 2004 at 3:50pm

James,

I am using Access so the mod has only been tested using Access. 

I believe you would need to change the SQL in the LastForumPostEntry stored procedure, adding the Topic.Subject reference in the SELECt and the JOIN in the FROM clause to make this mod work for SQL Server.  The rest of the changes to default.asp should be the same whether using Access or SQL Server.

To summarize the changes:

1) add a variable to hold the Subject (I called that strLastEntrySubject)

2) modify the SQL Query (in default.asp if Access, in LastForumPostEntry if SQL Server) to return Subject from the Topic table (obtained by adding a JOIN to the FROM clause)

3) populate strLastEntrySubject from the query results

4) use strLastEntrySubject as the hyperlink text to provide a link to the last post in the respective forum (lngLastEntryTopicID).

-- if SQL Server supports LEFT JOIN I would use it instead of INNER JOIN to prevent null forums (a forum without any posted topics) from having an incorrectly displayed Subject.




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