User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Database Design section within the Web Development category of DaniWeb, a massive community of 402,583 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,316 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Database Design advertiser: Programming Forums

Storing if a user has viewed a post

Join Date: Mar 2007
Location: India
Posts: 2
Reputation: nitinmms is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
nitinmms nitinmms is offline Offline
Newbie Poster

Re: Storing if a user has viewed a post

  #2  
Apr 5th, 2007
Hi,

Well this is a possible solution:

1. Make a Table say tblForumView with
Following fields:
ID
UserId
lastVieweddate

1. On Login Page, store the User's ID (UserId) in a Session Variable.

2. On the Forum Page in the Page Load Event, check if this userID exists in tblForumView table by saying something like
select count(*) from tblForumView where
userId=Session("UserId")

Now, if the above query returns 0 then this userId has not made any views of this page.
So you insert a record for this userId in the table tblforumview.
On the other hand , if count>0 then this UserID has visited eralier, so just update the
field [lastVieweddate] with current date and time.

Storing a [lastVieweddate] will allow you to remind the user as to when he last visited the page.
And also enable you to do some other cool things like for example,

You can display Alll the New Posts which have been posted since his last visit to the forum.

Regards,

Nitin
Reply With Quote  
All times are GMT -4. The time now is 11:14 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC