Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Who Is online

  1. #1
    Regular Coder
    Join Date
    Oct 2006
    Location
    Bristol
    Posts
    128
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Who Is online

    Hi, How would I go about making a script that would allow people to see who is online? I want it to display the members name if they are logged in, otherwise display 'guest' if they are not. So, if someone could either explain it here or direct me to a tutorial that'd be great

    Thanks
    Alex

  • #2
    New to the CF scene
    Join Date
    Aug 2006
    Location
    Germany, Heilbronn
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    One way you can do this is to store the ip, username (or "guest") and a timestamp in a db-table. Id a user klicks on a page, you look in your table if the ip exists. If you fount the ip, set the timestamp for this row to NOW().

    To display the online-user, just query the db-table for the rows which timestamp is greater than NOW()-10 minutes.

    You need also a "cleanup"-script for this table. All rows which are smaller than NOW()-10 minutes should be removed, so you have a clean and small table.

  • #3
    Regular Coder
    Join Date
    Oct 2006
    Location
    Bristol
    Posts
    128
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok...thanks. I'll have a go at it

    Alex


  •  

    Posting Permissions

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