Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - mod w/ Last Post Topic
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

mod w/ Last Post Topic

 Post Reply Post Reply
Author
jimdmurphy View Drop Down
Newbie
Newbie


Joined: 22 November 2003
Location: United States
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimdmurphy Quote  Post ReplyReply Direct Link To This Post Topic: mod w/ Last Post Topic
    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?
Back to Top
jimdmurphy View Drop Down
Newbie
Newbie


Joined: 22 November 2003
Location: United States
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimdmurphy Quote  Post ReplyReply Direct Link To This Post 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. 
Back to Top
jimdmurphy View Drop Down
Newbie
Newbie


Joined: 22 November 2003
Location: United States
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimdmurphy Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
jimdmurphy View Drop Down
Newbie
Newbie


Joined: 22 November 2003
Location: United States
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimdmurphy Quote  Post ReplyReply Direct Link To This Post 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:




Edited by -boRg-
Back to Top
LePaul View Drop Down
Groupie
Groupie
Avatar

Joined: 14 January 2003
Location: United States
Status: Offline
Points: 97
Post Options Post Options   Thanks (0) Thanks(0)   Quote LePaul Quote  Post ReplyReply Direct Link To This Post 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!

Back to Top
jimdmurphy View Drop Down
Newbie
Newbie


Joined: 22 November 2003
Location: United States
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimdmurphy Quote  Post ReplyReply Direct Link To This Post 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) & "" & _



Edited by jimdmurphy
Back to Top
drjamez View Drop Down
Newbie
Newbie


Joined: 31 March 2003
Location: United States
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote drjamez Quote  Post ReplyReply Direct Link To This Post Posted: 21 January 2004 at 10:36am

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

- James -

Back to Top
jimdmurphy View Drop Down
Newbie
Newbie


Joined: 22 November 2003
Location: United States
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimdmurphy Quote  Post ReplyReply Direct Link To This Post 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.

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.