• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

New post indicator on PHP/MySQL forum

rjshade

n00b
Joined
Aug 2, 2005
Messages
4
Hey guys,
I'm in the middle of implementing a forum/message board on my website using PHP and MySQL.

At the moment I have logins, multiple forums (General Discussion, Music etc.) and the ability to post new topics and reply to existing topics.

When a user is logged in, I would like to display topics/posts that have been created/replied to since the users last visit. This would work in the same way that phpBB works; the topic title is displayed in a different colour for example.

I was wondering what the best way to implement this would be.

I considered taking a timestamp when the user logged out. When they log in again, any post that has been modified since that time is flagged as new.

While this would work, on phpBB once you view a new post, it is no longer flagged as new and my idea would fail here.

Keeping a list of every post that a user has/hasn't viewed seems very inefficient.

Anyway, I was wondering if you have any suggestions?

Thanks,

Robbie
 
rjshade said:
When a user is logged in, I would like to display topics/posts that have been created/replied to since the users last visit. This would work in the same way that phpBB works; the topic title is displayed in a different colour for example.
Just out of curiosity; Any particular reason you did not just want to go with phpBB or a different forum software?

The way phpBB is handling the problem is that they set a cookie that includes a "last visited" timestamp, then read the cookie and flag all threads/posts that were created after as unread. At least I think that is the way they do it.
 
Thuleman said:
Just out of curiosity; Any particular reason you did not just want to go with phpBB or a different forum software?

The way phpBB is handling the problem is that they set a cookie that includes a "last visited" timestamp, then read the cookie and flag all threads/posts that were created after as unread. At least I think that is the way they do it.

Yeah, I didn't want to use phpBB or similar, because I'm treating this as a programming exercise. The forum isn't going to be huge, just something my friends and I can keep in touch using.
 
Back
Top