Gossamer Forum
Home : Products : Gossamer Links : Pre Sales :

Re: Users online

Quote Reply
Re: Users online In reply to
Okay, I realize this thread is quite old, but thought I'd post to it anyway.

It's relatively easy to do a who's online system, we have created one for one client that does a dating service using cgi scripts and a mysql database.

Basically in a nutshell, it goes like this.

Use your existing users database, add an extra field, named time, then in each cgi script you add a subroutine to check the database users to see if there is already an entry for that particular person, if there is update the time in the time field, if there isn't then add it in. Then also in every cgi script that does anything for a logged in user, you have a cleaning routine that checks the time field for each row, and deletes it if more than xx minutes. Then if the person really is still logged in, on their next action it will rewrite a time for them to the time field.

Then you create a who's online script that reads the userdatabase, and if it finds a time in the time field, then it will display that person on the who's online script output page. Then if you have a logout script, you can have it remove the time data from the time field of that persons users information, regardless of whether or not they use the logout button, the cleaning routines will clean them out when the next person comes along after xx minutes of inactivity. The only thing we havn't been able to work out yet, and Im sure it would be easy for a perl guru, is to check the hour as well, and remove the time data if it's over xx minutes or over 1 hour and xx minutes, currently it only checks the minutes, so if you had a not busy site, and user A logs in at 10am and doesn't logout , but leaves the site at 1005am, then user B logs in at 1103, they will still see the othe person logged in until xx minutes have elapsed, or if the time is set to default after 10 minutes, then user B will see the other person as being logged in until 1111am


This works well, and has been working well on a virtual server for almost a year, without a complaint from the server admins, and this particular clients site gets thousands upon thousands of members visiting every day.

Unfortunately I don't have the time right now to rewrite it to use the links database, and I havn't checked the mods resources, so perhaps someone else has already done this, but like I said it took us all of 5 hours to do the whole entire thing for this one particular clients site.

Regards,
Harrison


"I've got if's pretty good, but that's about it"
Subject Author Views Date
Thread Users online Robert 5925 Jul 31, 2000, 3:44 PM
Thread Re: Users online
pugdog 5792 Jul 31, 2000, 4:37 PM
Thread Re: Users online
Robert 5758 Aug 3, 2000, 5:57 PM
Thread Re: Users online
harrison 5735 Sep 29, 2000, 2:43 AM
Post Re: Users online
pugdog 5720 Sep 29, 2000, 9:06 AM
Thread Re: Users online
Stealth 5701 Sep 29, 2000, 9:53 AM
Post Re: Users online
jsu 5728 Sep 29, 2000, 10:30 PM
Thread Re: Users online
Alex404 5700 Sep 30, 2000, 2:43 AM
Thread Re: Users online
Stealth 5688 Sep 30, 2000, 8:26 AM
Thread Re: Users online
Bearwithme 5684 Sep 30, 2000, 8:57 AM
Post Re: Users online
Stealth 5699 Sep 30, 2000, 9:09 AM