Welcome Guest, Not a member yet? Register   Sign In
New Topics .. since you were here.
#1

[eluser]CodeOfficer[/eluser]
I've always been curious on how this was most commonly implemented.

On this site, in the main forums list, you can click a link called "New Topics" to see those topics that were created since your last visit. What's the most common way for a site store when this kind of last visit was?

I imagine it cant be as simple as comparing against a last_visited field in the users table, since the first page you visit of the forums would set a current time, thus resetting your last_visit .... am I making this more complex than it needs to be? lol

*hangs head in shame* i could probably think this one out if i slept some ...
#2

[eluser]huggiebear[/eluser]
I'd imagine they're updating a timestamp field in the database on every page load. Then comparing it to the posts timestamp.

Regards
Huggie
#3

[eluser]CodeOfficer[/eluser]
but if its on every page load ...

Quote:I imagine it cant be as simple as comparing against a last_visited field in the users table, since the first page you visit of the forums would set a current time, thus resetting your last_visit
... to the current time.

If they were updating a timestamp field in the database on every page load, then the first page i loaded would set last_visited to now, which would mean if i then clicked New Topics then I'd get nothing ... no?

I read every single post that comes into this forum via that New Topics link. I might not check it for a day, but when I click that link it shows me all new posts since I was last on. An hour later, clicking that link will only show me new posts again, even if I've been surfing their forums the entire time. (unless I am mistaken)

*update* ... even now, since i have posted 2 posts within 20 minutes, i clicked the New Topics link as I haven't in about 8 hours, and it shows me posts going back almost 3 hours.
#4

[eluser]fredwu[/eluser]
In the cookie there are 'last_visit' and 'last_activity', so yeah... Smile




Theme © iAndrew 2016 - Forum software by © MyBB