Results 1 to 5 of 5

Thread: Read Messages on Forums

  1. #1

    Thread Starter
    Hyperactive Member richy's Avatar
    Join Date
    Jan 1999
    Location
    Liverpool, England
    Posts
    353

    Read Messages on Forums

    I have a forum on my site and want to add the feature that each user can see which threads they have viewed and which they haven't.

    What is the best way of doing this? Is the only way to have a list of which threads every single user has viewed in a database. Surely in a message board like this table will be massive, especially as every thread is archived or is there someway of checking the cache and dates?
    ASP, PHP, VB, JavaScript, CSS, HTML, a little C and a little CGI.

    Richard Whitehouse.
    Join the Footie Predictions League


    "Make it idiot proof and someone will make a better idiot."

  2. #2
    Fanatic Member Matt_T_hat's Avatar
    Join Date
    Dec 2001
    Location
    '76 Male Body Evil-Errors: 666
    Posts
    774

    Re: Read Messages on Forums

    Originally posted by richy
    [B]I have a forum on my site and want to add the feature that each user can see which threads they have viewed and which they haven't.[B]
    By makeing a few asumptions you should be able to get around alsorts of problems and only add one perminant field to the user table.

    Use this field to record the exact time and date "Now()" that they last visited the site. Then mark each post that is new since then. If you use the session variable to store the unique ID of these tables before updateing [Date Of Last Visit] for this visit with the new time and date then you can remove viewed IDs from the list as they get viewed.

    If that sounds like too much you could just do:

    Code:
    <p>There are :<%=Sum(Records > LastVisit)%> 
    new posts since your last visit</p>
    ?
    'What's this bit for anyway?
    For Jono

  3. #3
    Fanatic Member Matt_T_hat's Avatar
    Join Date
    Dec 2001
    Location
    '76 Male Body Evil-Errors: 666
    Posts
    774
    Admittidly you might have to use a different name for the function and probably have a more realistic input for it like

    VB Code:
    1. CountOfPosts(Rs.fields("LastvisitDate").value)
    ?
    'What's this bit for anyway?
    For Jono

  4. #4

    Thread Starter
    Hyperactive Member richy's Avatar
    Join Date
    Jan 1999
    Location
    Liverpool, England
    Posts
    353
    Thanks very much Matt. Now its time to get to the drawing board!
    ASP, PHP, VB, JavaScript, CSS, HTML, a little C and a little CGI.

    Richard Whitehouse.
    Join the Footie Predictions League


    "Make it idiot proof and someone will make a better idiot."

  5. #5
    Fanatic Member Matt_T_hat's Avatar
    Join Date
    Dec 2001
    Location
    '76 Male Body Evil-Errors: 666
    Posts
    774
    'sok

    good luck
    ?
    'What's this bit for anyway?
    For Jono

Posting Permissions

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



Click Here to Expand Forum to Full Width