Coding a message forum...

Discussion in 'PHP' started by Tomp, Apr 27, 2007.

  1. #1
    So, on my site im developing a forum, not using a 3rd party script or anyhting entirley from the ground up..

    Now ive done everything, forums, catagories, adding posts, viewing posts etc...registrations etc all done too

    but ive come to a problem.

    How can i identify new posts?....how can i use php to tell which posts are new and which are read to each user.

    Im guessing something to do with sessions, any help would be appriciated

    Tom
     
    Tomp, Apr 27, 2007 IP
  2. micmic

    micmic Well-Known Member

    Messages:
    95
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    113
    #2
    Hi,
    About knew or old post you can sort your table by date.
    About the other thing I didn't really understand you....
     
    micmic, Apr 27, 2007 IP
  3. Tomp

    Tomp Well-Known Member

    Messages:
    279
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    105
    #3
    Yes but that wont change the new post indicator :).....i need to let the users know which topics have new posts in them since last time they were on, or while they have been on.

    Ordering would just displauy the newest first, not new posts since the user was last on etc.
     
    Tomp, Apr 27, 2007 IP
  4. Tomp

    Tomp Well-Known Member

    Messages:
    279
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    105
    #4
    will pay if someone is able to do this on my forum, PM me

    Tom
     
    Tomp, Apr 27, 2007 IP
  5. Felu

    Felu Peon

    Messages:
    1,680
    Likes Received:
    124
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Its pretty easy to do so. All you need to do is
    - Log the user's last visit in the database
    - Query the posts database for the new posts but display the ones which are were posted from the last time they were online.
     
    Felu, Apr 27, 2007 IP
  6. Tomp

    Tomp Well-Known Member

    Messages:
    279
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    105
    #6
    Yea but when would the last visit update?..also how would i identify posts that are made while they are online
     
    Tomp, Apr 28, 2007 IP
  7. Felu

    Felu Peon

    Messages:
    1,680
    Likes Received:
    124
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Well log the visits whenever they visit a new page. Make a log system on every page which logs the current user's activity and clears all activities which are like more that 5-10 mins old. I think this should do what you need.
     
    Felu, May 17, 2007 IP