SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    Korea
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    To show when a page has been updated(noob?)

    Hello,

    My main profession is Enlgish Teacher, so I am not too knowlegable on this web stuff.

    I have a site at shawkorea.com
    On that site, I have movabletype Blogs from my students.

    When a student updates there blog, I want an icon or message to show up on the main homepage. The icon/message would show "new" or "updated" so everyone would know that the blog had been updated. After the person views the blog, the "new" icon/message would be gone.

    So, my question is if anyone would know how I could begin setting something like this up?

    Thanks

  2. #2
    SitePoint Zealot
    Join Date
    Jan 2004
    Location
    vta,ca,usa
    Posts
    180
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One method is to use a cookie to store the user's last visit date/time. When the user visits again, you compare the date/time stored in the cookie to the date/time of the last post / news item. Based on that comparison, you can show a 'here are the new posts since your last visit' type of message or icon.

  3. #3
    does not play well with others frezno's Avatar
    Join Date
    Jan 2003
    Location
    Munich, Germany
    Posts
    1,391
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd do this using a database, setting up fields for the page for the description and date fields for created new, update and last view.
    We are the Borg. Resistance is futile. Prepare to be assimilated.
    I'm Pentium of Borg.Division is futile.Prepare to be approximated.

  4. #4
    SitePoint Wizard davidjmedlock's Avatar
    Join Date
    Dec 2002
    Location
    Nashville, TN USA
    Posts
    1,688
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by frezno
    I'd do this using a database, setting up fields for the page for the description and date fields for created new, update and last view.
    But, you won't know which visitor has seen what posts that way, unless you track by IP address which may not always work due to many hosts assigning from an IP pool. (Okay, that didn't sound right )

    For example:
    Student adds blog on 2/11/2004 at 10:00 AM
    Visitor comes to site for the first time
    If no cookie is set, all blogs (maybe all blogs for the past n days) are marked as new... (notice that vB seems to do this if you close your browser/delete cookies and return later...)
    If cookie is not set, create a cookie with the current date and time
    If cookie is set, mark all blogs added after the date and time in the cookie as "new"

    Apply the same methodology for showing updated blogs, except base it on an updated date column instead of an added date column.

    This is just me spewing forth what first comes to mind, so others may come up with better ideas... This seems like it would work, though. (And this is probably how vB works with the various icons on the forum pages...)

  5. #5
    does not play well with others frezno's Avatar
    Join Date
    Jan 2003
    Location
    Munich, Germany
    Posts
    1,391
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by davidjmedlock
    But, you won't know which visitor has seen what posts that way,
    right, this would only work if you use some kind of login system.
    Tracking IP-address is too unreliable to rely on.
    We are the Borg. Resistance is futile. Prepare to be assimilated.
    I'm Pentium of Borg.Division is futile.Prepare to be approximated.

  6. #6
    SitePoint Wizard davidjmedlock's Avatar
    Join Date
    Dec 2002
    Location
    Nashville, TN USA
    Posts
    1,688
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by frezno
    right, this would only work if you use some kind of login system.
    Tracking IP-address is too unreliable to rely on.
    Ah, I thought we were just tracking random visitors with no login available. If they're logging in, that's a different story. Then I would implement something similar to your idea, since some users disable cookies for privacy and security reasons. (Although, I imagine they can visit only a very few websites w/out cookies enabled.)

    It would be more reliable to store it in a database as well, since a user may clear their cookies and then all of a sudden all the blogs for the past n days may be new again, despite the fact that they've already looked at them.


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
  •