PDA

View Full Version : Forum Question



JoeJones
19-05-10, 20:56
(excuse my laziness for not downloading and examining the source)


I'm curious as to how this forum knows what a new post is per user.

I can see the links include "goto=newpost" and therefore there's a bit of PHP magicness carried out....but how does it work out what the new post is for me?

It sounds daft to have the pointers in the thread table or holding a user table which contains posts viewed...and I can't see any cookies leaving trails, so I'm a bit confused/curious.


Does anyone know how it's working?

DoubleTop
20-05-10, 01:04
indeed I do :lol:

The 'state' is held in the DB, it can be cookie based or DB based but DB is generally more reliable for the users as it's server side and many users have usage of multiple machines which kinda kills the cookies method.

Get hold of the OpenSource phpbb code, I think it does it in the same manner.

DT.

JoeJones
20-05-10, 13:39
Thanks DoubleTop.

Any chance you could elaborate on the design? Is the 'state' held as a per user table or in a thread table?


It runs fast as **** however it's working.

DoubleTop
20-05-10, 18:48
at the moment, these forums run off a database marker, and threads older than 7days old if you don't log in for a while are automatically marked as read - to save the load on the server.

To go a little more technical, there is table with userid, forumid and time read, that's where the data is pulled from.

DT.

JoeJones
24-05-10, 13:10
Thanks for that DT...gives me something to think about.