#1
  1. No Profile Picture
    Self Proclaimed
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    249
    Rep Power
    15

    Making a forum, how should I structure the new post notification


    First off, thanks for suggesting that I just use YaBB of PHP BB, but I'm just doing this for a hobby, and doing that would defeat the purpose.

    Now to my question, you know when you login to a forum and there is a little icon that lets you know there is a new post in that thread. I'm at a bit of a loss on how to make that.

    One method I know works, and would be easy is to just add a time stamp to the URL as a variable, so each time there is a new post, the newest time stamp is added to the URL and the URL changes. This way the visitors browser does all the work. The downside to this is that search engines will see many URL's with the same content, which is frowned upon.

    The other method I though of, (I think vBulletin uses this also) is to place a timestamp in the last post column of a thread, and a time stamp in the users profile. This way if the time stamp in the thread is newer then the time stamp in the users profile it's a new post. The downside to this (Something I noticed on vBulletin) is that once you make your first post, all posts are now marked as read since you have now updated your time stamp.

    Anyone know of any other waty to do this?
    Norics.com Web Developer Community
  2. #2
  3. Retired Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2004
    Location
    London, UK
    Posts
    6,669
    Rep Power
    150
    You could have an extra table in the database, with userid and post id, to keep a list of who has read what. When a user opens a post, their user id and the post id is added to the table.

    Therefore, if an entry in the table exists for current userid / post - they have read it - otherwise, they haven't read it.

    This works for my small environment with a small number of users, not sure if this would be sensible with lots of people.

    HTH,

    Edwin
  4. #3
  5. No Profile Picture
    Self Proclaimed
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    249
    Rep Power
    15
    Originally posted by edwinbrains
    not sure if this would be sensible with lots of people.
    That's the first through that entered my mind,

    You gave me a good idea though. In the table that holds the threads I have a column called something like last_poster. I can simply make a small check to see if the user is the last poster.

    if ($_SESSION['username'] != $last_poster) {

    echo "<img src='images/newpost.gif' alt='' />";

    }

    It should be very quick, and would be easy on the DB since it has to make a call to that table anyways.
    Norics.com Web Developer Community
  6. #4
  7. AZbb founder
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2004
    Location
    London, UK
    Posts
    843
    Rep Power
    14
    I am half way through coding a brand new BBS system myself.

    New posts are mainly handled in 2 ways.

    YaBB uses logs to keep track of the posts that have been read. Benefit is that it is accurate. On the downside, script has to log every thread read and keep it up-to-date. That adds a lot of extra works to the server.
    Searching for new posts is another killer with YaBB. I have YaBB running and hacked out the search as it was putting a lot of pressure on the server. As you can imagine, YaBB has to search all the posts and compare with the logged read posts.

    As already mentioned, in a large forum; that would be a lot of extra work.

    On the other hand, phpBB uses last online log entry to establish New posts. Benefits are that it is very fast and there is no extra logging which again adds to speed [not having to log every time].
    On the downside, you log to the phpBB read one post out of 50 new posts and leave. Next time you come back all those 50 are marked as read although you did not read them.
    Searching for new posts is very fast as the script would only need to compare the time against the last login[online].

    I am not sure what vBulletin uses but I guess it is a hybrid of two.

    Good luck
  8. #5
  9. No Profile Picture
    Self Proclaimed
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    249
    Rep Power
    15
    I think vBulletin uses something similar to PHP BB. I was just on a vBulletin forum and about 7 of 10 forums had a new post notification on them. I made one post and all the notifications turned off, but I didn't read them.

    I personally like he method I proposed above the most (Probably because I thought of it). I think it'll be the fastest and easy on the server.

    Send me a PM of the expected URL where you're going to launch it, I'd love to see it when you get it finished.
  10. #6
  11. AZbb founder
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2004
    Location
    London, UK
    Posts
    843
    Rep Power
    14
    Originally posted by Hero Doug
    Send me a PM of the expected URL where you're going to launch it, I'd love to see it when you get it finished.
    I have been working on it since August 2003 at up to 10-12 hour a day. It would be another good few months before it is ready for beta testing.

    You can read about it at:
    AZbb :: AZ Bulletin Board

    Some older screen shot:
    AZbb :: AZ Bulletin Board :: alfa Screen Shots




    ps. You may run into trouble with your $last_poster set up.
  12. #7
  13. No Profile Picture
    Self Proclaimed
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    249
    Rep Power
    15
    Could you tell me why? I don't see how it couldn't work. If they don't hold the last post then they either haven't read the post, or someone besides them has made a post. Either way there is a new post they haven't read.

    P.S, it looks good. But doesn't the marble outline go against your no excessive frills approach?
    Last edited by Hero Doug; February 7th, 2004 at 06:30 PM.
  14. #8
  15. AZbb founder
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2004
    Location
    London, UK
    Posts
    843
    Rep Power
    14
    Thank you.

    1- Base on the last post TIME instead. Compare the last post time with the users' time info i.e. last on line or login session. I use a different system than sessions but you can choose your preferred method.

    2- The skin is there to demonstrate the capabilities of the script to accommodate users' control over template and layout. It is fully template based and a lot easier than vBulletin or phpBB and others to create, edit or change templates. Styles are totally and completely control via CSS
    The approach was mainly towards security and speed. By frills I would categorise, MSN, ICQ, Yahoo etc as unnecessary frills that would slow down the serving of pages as it has to connect to their server to get the info in addition to being a security/privacy risk.
    Everyone visiting a forum with such feature would be added to the logs of those companies [ICQ, etc].

    There are other frills that I have simplified such as User profiles etc. But Skins is simplified in a sense that it is more user-friendly but expanded to give additional control over the way it can be personalised.

    BTW, the current skin looks a lot cooler.
    Unfortunately, my graphic skills are totally outdated. I haven't been doing regular graphic works since Photoshop2.5 and Freehand 5

    I leave that to the users to play with.

    Last edited by Clan admin; February 7th, 2004 at 07:26 PM.
  16. #9
  17. No Profile Picture
    Self Proclaimed
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    249
    Rep Power
    15
    Photoshop 2.5 lol, that must have been like MS Paint.

IMN logo majestic logo threadwatch logo seochat tools logo