How does SMF handle unread topics?

Started by G_G, August 16, 2011, 12:43:52 am

Previous topic - Next topic

G_G

I'm curious how does SMF handle unread topics? Does it store in the database? Where in the database? Does it use timestamps? I've spent an hour looking through SMF tables trying to figure it out. I was trying to set something up on my phone with a small android application.

I can't figure it out. I've tried searching but I've only ran into results talking about people not having their Show unread posts not working.

Blizzard

{$prefix}_log_topics is used to mark which topics are read. IDK how it works when marking whole subforums or everything read, but it's not done here.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

I guess that is the only way to do it but it seems heavy on the server. So everything stored here is read? Or unread?

Blizzard

It's read. When you open a topic, it adds an entry in there. e.g. When you edit the last post in the topic, SMF will mark that post for everybody else as unread by updating that entry so it looks like the topic is unread (the message ID is set to one less than the last message in the topic). I know that part because that's what I had to code myself back then so editing the last post in a topic would bump it.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.