I've created my own messageboard and now im worndering, how on this messageboard, when you leave the forum and come back the next day, it has all the new topics that you haven't read yet w/ a lil ARROW, and once you've read it, the arrow goes away, but only for the one you read.
I thought it would be w/ a lastvisit cookie, and it shows everything posted above that time, but that wouldnt work too well if you wanna make it work like this forum.
Im pretty sure this forum uses Sessions for this, but how are they used? are there session variables assigned for each topic above the time of last visit and then the session variable is destroyed after you view the topic??
I've never worked w/ sessions b4, but if thats how its done, i'll look into it.
If there's another way of doing this, let me know as well.
THanks
Messageboard: How do they do it?
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
hrm
I made mine in like 2 days ^_^ It's very easy. Although it's about 3:15 in the morning, and I have no sense of what thinking is. :/
Its just a field in the database. I've looked at the source for these forums before and I remember thats how they do it. They take each post ID and save it into a field in the DB that is in the user table. They separate every ID by a comma or something so they can split it in the code. Hope that helps.
hum, I see, I tried looking at the source as twigletmac stated, but it was a lil confusing for me :/
I'll see if i can get to work.
But the thing is, when do they reset the LAST TIME VISITED, like w/ this forum, if you close the browser and come back an hour or so later, it'll have all the new posts listed, then (without looking at any of the new posts), just close the browser again and come back to the forum, they're gone and the lastvisit time is set to the current time.
Am i making sense?
Just wondering how they did that...
I'll see if i can get to work.
But the thing is, when do they reset the LAST TIME VISITED, like w/ this forum, if you close the browser and come back an hour or so later, it'll have all the new posts listed, then (without looking at any of the new posts), just close the browser again and come back to the forum, they're gone and the lastvisit time is set to the current time.
Am i making sense?
Just wondering how they did that...
Thats a fairly easy one too. When a link is clicked, and a page is loaded, it stores the time in the database. Then when another page is called, if that time is so many minutes ago, then it says "hey, this person left for a while, so lets add all posts that are between that time, and so many minutes after that time to the 'read' pile". Thats kinda the basic idea of how it all works... peicing it together with code will be your part
Have fun 
