Displaying page views for discussion board threads

Results 1 to 2 of 2

Thread: Displaying page views for discussion board threads

  1. #1
    Darren Chu Guest

    Default Displaying page views for discussion board threads

    Does anybody know how to display the number of page views for a particular thread/message in a discussion board? I know how to use the Microsoft PageCounter COM object as well as Application/Session variables, however, I want to display page hits not for some static page, but for a message-viewing page that dynamically displays depending on the message ID/topic/thread chosen. What I want to do is display a list of popular discussion board messages with the number of times they&#039;ve been each viewed beside them. Would I have to have use SQL Server&#039;s built-in counters for this, or can I simply use ASP/ADO? I know to use SQL Server&#039;s built-in counters, I&#039;d have to use triggers in conjunction with stored procedures. However, triggers only work w/ inserts, deletes and updates. When a site visitor views a message, only the SQL select statement executes, so a trigger wouldn&#039;t help me here.<BR><BR>Thanks in advance.

  2. #2
    Join Date
    Dec 1969

    Default Run a SQL query at the page load

    You could build and post a SQL command to a database counter...<BR><BR>SQL = "update tablename set counter = counter + 1 where idfield = " & request("message_ID")<BR><BR>All you need to do is add a counter field to your messages table... Keep it in there...<BR><BR>I have something similar on this site...<BR>http://hd-cf.homeip.net<BR><BR>Check out the link indexer, I have a counter in there.<BR><BR>-- Whol

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts