SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict CommanderZ's Avatar
    Join Date
    Apr 2006
    Location
    Czech Republic
    Posts
    236
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Detecting new posts

    Hello,
    my client wants me to do a custom forum&comment system for him. I haven't done such thing yet, so I expect to have some difficulties. Mainly, I don't know how to detect unread posts. I know I can make a special mysql table where will be one record per user and thread, but this is going to be horribly ineffective. There would be 100'000 records with 100 users and 1000 threads...

    I here any other more effective way?

    Thanks

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,506
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Interesting problem.

    First of all, you could make it like it seems to work on the sitepoint forums: after a certain amount of time, a post isn't 'new' anymore, even if a user hasn't read it yet.

    Second, you might add a record for each post that the user HAS read. If the user/post isn't present in the table, the post is new for that user. That way, the number of records dimishes. Surely, not all of your users will read all the posts.

  3. #3
    SitePoint Addict CommanderZ's Avatar
    Join Date
    Apr 2006
    Location
    Czech Republic
    Posts
    236
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, it should be viable - one post per thread user has read in last week. Older records will be deleted. Thanks.

  4. #4
    SitePoint Zealot detzX's Avatar
    Join Date
    Oct 2006
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why not have a match table(user_id,post_id). Once a user reads the post they get an entry into this table and it's now read for them...if the user doesn't have an entry for a post then it's unread unless it's XX days old or something.
    www.invoicejournal.com - Invoice clients for Free

  5. #5
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,506
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by detzX View Post
    Why not have a match table(user_id,post_id). Once a user reads the post they get an entry into this table and it's now read for them...if the user doesn't have an entry for a post then it's unread unless it's XX days old or something.
    Of course, you could also read all posts before answering...

  6. #6
    SitePoint Zealot detzX's Avatar
    Join Date
    Oct 2006
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by guido2004 View Post
    Of course, you could also read all posts before answering...
    I did read it but I didn't feel that it explained what to do properly therefor I put my own opinion/thoughts on the matter that I felt explained what I would do better. At least my post was constructive...coming in a thread telling me to re-read what you wrote because it sounds similar does not seem to help the thread much.
    www.invoicejournal.com - Invoice clients for Free


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •