Page 1 of 1

Highlighting at Unread topic.

Posted: Tue May 27, 2008 9:07 pm
by scottrichardson
Hi guys.

Currently I'm working on building some simple discussion boards / forums. ( Don't worry I know all about phpbb etc etc, and use it on a couple of my own sites ).

What I need explained to me, in a general way, is....

How does the forum know I have not read a topic? How does handle all that sessions stuff so that it can set the icon to be red, for example, to indicate that there are new posts or topics since the last time I loaded that page.

I get the basics of sessions etc... but I'm doing my head in.

I want to inform my users when a new topic has been posted by changing something visually on the site (change the icon colour, make topic text bold etc etc).

But what sort of session handling is going on?

Can someone attempt to explain this to me in a basic way (at first)?

I took a look at the source for phpBB and it's session stuff is WAY WAY WAY beyond what I THINK I need.

Thanks in advance.. I know this is a bit of a big question.

Scottie

Re: Highlighting at Unread topic.

Posted: Tue May 27, 2008 10:54 pm
by s.dot
PHPBB uses cookies to determine unread topics.

Re: Highlighting at Unread topic.

Posted: Tue May 27, 2008 11:03 pm
by scottrichardson
Hey, OK that's a start then, thanks man.

So how does it work?

Every time you visit a thread, it saves a cook for that thread and the time you visited?

Then next time you load the topics page, it checks the time of the newest thread against the time saved in your cookie? If the thread has a newer time, it highlights it as new?

Does that mean we're storing a cookie for every single thread, every single time we load the topic? Wouldn't that get a little heavy on back and forth between client and server? Or is this fairly routine?

Scottie

Re: Highlighting at Unread topic.

Posted: Tue May 27, 2008 11:56 pm
by scottrichardson
hrmm

actually.. I just did a little more digging through the source of phpBB and took a look at the database tables.

PHPBB stores every time you look at a thread or forum it a database table.. and constantly checks against your cookie's last visit time.

It's WAAAAAAAAAAAY complex :(

Was hoping there was a simpler way to do this..

Bugga

Scottie