Hey guys,
I have created a forum.
The db structure is like this
1 table of subcategories (ie general, coding, marketplace, etc)
1 table of topics
and 1 table of replies
I want each individual user to be able to hit a "view new posts" button to see posts that they havent seen yet, similar to what we have here on devnetwork.
How can something like this be achieved? What is the best route and method to do something like this?
Creating a Forum: View new posts?
Moderator: General Moderators
Re: Creating a Forum: View new posts?
PHPBB uses cookies for this.
Probably something along the lines of storing post ID's that have been viewed, then querying for posts that are new and not in this list from the cookie.
Probably something along the lines of storing post ID's that have been viewed, then querying for posts that are new and not in this list from the cookie.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Re: Creating a Forum: View new posts?
Do i need to create an array in the cookie?
Isnt there a limit on how big a cookie can be? If a user views 100 posts, wont it start being excessive?
Isnt there a limit on how big a cookie can be? If a user views 100 posts, wont it start being excessive?
Re: Creating a Forum: View new posts?
There is a limit, although I'm not certain what the limit is, exactly. I know that some forums will treat every post that has a reply which is older than two weeks as "read" by default, and only classify the others as unread. Although it's not exactly "read", this will assure some performance. Other than that, it's just the question of where you store the info: in the database or in a cookie. You might want to do both: if the cookie is stale (too old) or not present, you can generate a new list of unread topics. Let me know how this turns out, as I might have to implement this myself soon, too.zeve wrote:Isnt there a limit on how big a cookie can be? If a user views 100 posts, wont it start being excessive?
Re: Creating a Forum: View new posts?
I've thought of an issue with using cookies...
What if they use a different computer???
What if they use a different computer???
Re: Creating a Forum: View new posts?
Then store it in the session and persist the session to the DB after each visit.
Re: Creating a Forum: View new posts?
You only need to track viewed forums during the session. After the session ends you prune out 1,000s of forums you don't have to check, since their last_posted_in timestamp < session_began_timestamp