Show forums with new posts indicator

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
AlecH
Forum Commoner
Posts: 27
Joined: Fri Feb 24, 2006 4:22 pm
Location: New Hampshire

Show forums with new posts indicator

Post by AlecH »

Hello all,

I am trying to make a bulletin board system for my site and I am trying to make a Forums with new posts inidcator on the index page. For example, when you make a new post in a forum that hasnt been posted in in a while, the icon next to the forum turns a different color or something normally. Well I know this has something to do with cookies, but I cant figure it out. So, could someone possibly give me a real straight forward example of how you might do this.

Thanks!
-maddog39
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

This does not necessarily have to do with cookies. What is your comparison of new based on?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

There's a couple of things recorded: The major one is the last time the user was seen from a previous login. This creates your new posts list. The second recording is when posts/threads are read, so they disappear from the new list. The time of reading is needed for each of them so you know when the thread becomes new again during their session.
AlecH
Forum Commoner
Posts: 27
Joined: Fri Feb 24, 2006 4:22 pm
Location: New Hampshire

Post by AlecH »

Okay, but what I dont understand is how you record the last time the user visited, because I cant figure out how and when you would update that,
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

You update it as the user visits... in their row of the sessions table (if you are using stored session data).
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

The only time it ever gets updated would be when the user logs in, or visits from a machine that uses some form of "Remember Me" that doesn't have a current session.
AlecH
Forum Commoner
Posts: 27
Joined: Fri Feb 24, 2006 4:22 pm
Location: New Hampshire

Post by AlecH »

Okay, thanks I think i've got it now.
Tom420
Forum Newbie
Posts: 15
Joined: Sun Aug 13, 2006 1:50 am
Location: Sherbrooke, Québec, Canada

Post by Tom420 »

Or you get phpBB at
http://www.phpbb.com/

Free (as in Free Speech) forum. You are using phpBB at the moment :)
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: Show forums with new posts indicator

Post by RobertGonzalez »

AlecH wrote:I am trying to make a bulletin board system for my site and I am trying to make a Forums with new posts inidcator on the index page.
He's trying to make one, not find one.
Tom420
Forum Newbie
Posts: 15
Joined: Sun Aug 13, 2006 1:50 am
Location: Sherbrooke, Québec, Canada

Post by Tom420 »

I was just giving a suggestion. Maybe he didn't know phpBB was freely available. Sometime, people go for the long solution without realizing there is an easy solution available. I didn't says phpBB would suits his needs though.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Fair enough. Typically I give the poster the benefit of the doubt... when they say that are building something then I assume they actually want to do that. But I can see your point. I have approached several posts that way before. No harm done.
Post Reply