Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2002
    Location
    NY, NY
    Posts
    3,975

    how does VB show current online users?

    So how do forums like vbulletin show current online users.
    I don't have vb, so I'm not asking for a plugin or anything.
    I want to use something similar on a site.. how is it done?

    My guess is that it has something to do with sessions.

    Thanks for your help

  2. #2
    Join Date
    Sep 2004
    Location
    Flint, Michigan
    Posts
    5,765
    It more or less works off of a last activity field in the database (I am guessing here, I don't have a VB installation to look at right now).

    For example when you view a thread, make a post, etc.. it updates your "last activity" by your username. Then the online users shows all users who have been active in a given amount of time (i.e. less than 15 minutes). If you don't do anything for 15 minutes you will not be displayed on the active users area.

    Make sense?
    Mike from Zoodia.com
    Professional web design and development services.
    In need of a fresh hosting design? See what premade designs we have in stock!
    Web design tips, tricks, and more at MichaelPruitt.com

  3. #3
    Join Date
    Dec 2002
    Location
    NY, NY
    Posts
    3,975
    hmm that makes sense but it seems so expensive in terms of database use.

    Every action you make (posting, viewing a page, etc) causes a field in the DB to be updated....

    I guess it would make more sense just to do it when you view a thread since you can't really reply or do other things without seeing the page first.

    What do you guys think?

    Thanks

  4. #4
    Join Date
    Feb 2003
    Location
    Canada
    Posts
    958
    Quote Originally Posted by ilyash View Post
    hmm that makes sense but it seems so expensive in terms of database use.

    Every action you make (posting, viewing a page, etc) causes a field in the DB to be updated....

    I guess it would make more sense just to do it when you view a thread since you can't really reply or do other things without seeing the page first.

    What do you guys think?

    Thanks
    Definitely not very database efficient.

    Ideally the 'number of users active' could be something caculated every 5-10 minutes and stored in a memcache. It wouldn't have to be real time.

    If you are performing an auto-logout on idle (which for security most people do) then you are updating their last_active in the database on page load anyways, so a cron script parsing these and calculating if they are active or not would be easier on the database.

Posting Permissions

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