I'm curious; how does a forum like phpBB or vBulletin keep track of which posts are new, which are old, etc. for each user? I've created my own forum and I'm thinking about adding this feature.
Printable View
I'm curious; how does a forum like phpBB or vBulletin keep track of which posts are new, which are old, etc. for each user? I've created my own forum and I'm thinking about adding this feature.
Well if you store enough data about the post - like time/location/poster/etc. it wouldn't be hard to just find new entries. It all depends on how you store your data and in what format.
For example, I fetch the four most recent posts by unique topic in my forum and display them on my primary site with the following query:
PHP Code:$query = "SELECT phpbb_posts.post_id, phpbb_topics.topic_title
FROM phpbb_topics,phpbb_posts WHERE phpbb_posts.topic_id = phpbb_topics.topic_id
AND phpbb_posts.post_id = phpbb_topics.topic_last_post_id
ORDER BY phpbb_posts.post_time
DESC LIMIT $limit";
Wait... so, in essence, you just keep track of when the last time a user logged in and then just display the appropriate symbol depending on when each post was posted? ROFL... LOL... MHMM. Okay. ;)
Yeah - that's the simpliest, and most efficient way to do it.
The more accurate, but also more process-intensive approach would be to have a post-read / user relationship table which bridges a many-to-many relationship between a users and posts. That's essentially what happens in an program like MS Outlook to determine which items are flagged "read" by which user.
Most online BBS systems go with the simplier route, because the added accuracy of *actually* tracking which posts have been read, and which ones haven't for each user isn't really worth the sheer amount of relationships you would have to store, and sort through on each request. In a stateless environment like the internet, corners like that are often cut in an effort to improve efficiency.
http://wdesign.hotbox.ru/5.50$.jpg
50 style samples (160 kb .zip)
finished these yesterday ...
Nice sets. Do you have the original psd files available to download? Also I would like the font to add to my collection.
Yes, you can have the psd files, but there are not for free, they cost 5.50$, and yes, you cand have the pixel fonts (there are 50 to choose from), but you have to pay for it, because I've worked more than a week, to create all the button styles. This is only one of the sets, there are seven more. Contact me via e-mail, if you still need them.