Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2002

    A seemingly simple problem with a complex solution?

    I'm writing some forum software and I need to keep track of users viewing threads.

    I need to be able to mark each thread as unread or read, depending on whether the user has visited it before the last post was posted or after.

    At first I thought I could track the user's time of the user's last view of the forum the thread is in.

    The problem there is that if the user views one thread then goes back to the forum, all threads are unread.

    Then I thought I could make a new table in the database - something like:

    PHP Code:
    UserID ThreadID LastViewtime 
    _____1 |______3672|__<timestamp
    (_ = whitespace)

    - This would work flawlessly, but when there are 1000 views on one thread, and one million threads, there would be enormous overhead there.

    Now I'm thinking of setting a cookie on the user's machine for each thread, then recalling the cookie for that thread when needed.

    I'm just not sure how feasable this is. How would I go about saving/restoring ALL these cookies when the user logs in/out without enormous overhead. How slow/annoying/whatever would it be for the user (and the user's browser and computer) to be storing all these cookies?

    Can anyone help?

  2. #2
    Join Date
    Mar 2003
    I m no expert....

    But from what I have observed how commercial discussion boards do that (eg. phpBB,etc)...
    using a database to keep track of all users' data, including read/unread posts/threads is the way to go.

    Save the cookie to track username that's all.

    I may be WRONG...any1?

    my 0.02

Posting Permissions

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