Forum Moderators: coopster

Message Too Old, No Replies

Highlight new content since last visit

How to increase stickiness with this useful feature?

         

Wi11

7:59 pm on Mar 10, 2004 (gmt 0)

10+ Year Member



I'm coding up a new site and want to make the main areas, such as the forum have their new content highlighted.

Many of the popular open-source forums have this feature built-in and I've been through their source trying to work out how I can best do it.

All I've managed so far is the following.

1) At login, the users' 'logintime' is stored in the user table. If they have logged in previously, their last login time is set to 'secondtolastlogin'.

2) To higlight the new content I just compare 'secondtolastlogin' to 'updateddate' of new content. If the former is less than than the latter I have an alternate graphic to show it's new.

This code sort of achieves what I want, but I feel it's clumsy and doesn't offer anywhere near the features of the open-source forums.

They seem to use cookies to store which content has been read and the time it was read. However there are no tutorials out there on the web how to do this properly.

Can anyone offer help/tips please?

coopster

8:29 pm on Mar 12, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, Wi11!

I think you are on the right track. Set a cookie during login. Something like 'LAST_VISIT' and populate it with the correct time value (that which is relative to the time value you are using to populate the "last updated" value of each entry in your forum). This is more than likely your server's time. Then, when populating your forum list for display, compare the "last updated" time of each forum entry to the time stored in the cookie and display the *new* icon accordingly. Then, before you finish and output to the browser, update the value in your cookie.