PDA

View Full Version : [ Wanted ] Who's online Script


redspider
06-12-03, 03:08 AM
Hi all,

I'am searching for a "Who is online" (in the building) tool.
I want to use it in a contactmanager that i wrote for our intranet.
So users who want to contact an other user can see if they must use mail or phone.

My idea was to use something like the ping-commando.
When a users opens the page with info of an other employee a ping starts.
If there is a positive reply a gif (or text) with "user online" must printed in the page. If there is a "time-out" or "host not found" a gif (or text) with "user offline" must printed in the page.

Problem is that i don't know how to get the job done !

Is there someone who knows how to do this, or is there someone with a better suggestion ?

Thanks

Daniel141
06-12-03, 03:14 AM
Log the last time a person accessed a page on the site, if they don't access any pages for 5 minutes ( 300 seconds ) they are considered offline ( or offsite )

It's not very difficult...

I wrote a member based one, and a generic users online that just counts how many people are online.

http://poweredbygeeks.com/index.php?act=ST&f=4&t=31&hl=online& <-- how many people are online

You can look at the code for ideas...

redspider
06-12-03, 03:23 AM
Hi Daniel141,

Thanks for your fast reply, But I was searching for a different type of "Who is online" script. I want to use it to see who is in the building (and is working ???). But don't want to install extra software on every PC to do this.

I just edited my first post, but i will take a look at your suggestion.

Thanks

Daniel141
06-12-03, 03:31 AM
I seen a status script that checks to see if http/ftp/pop3/etc are responding, maybe you can tweak it and put it on a cron...

I'll get ya the code :)

Daniel141
06-12-03, 03:34 AM
http://us3.php.net/manual/en/function.fsockopen.php

I found the script and they use fsockopen... I don't know exactly how you would do this, but it may help :D

Shane
06-13-03, 08:44 PM
I think the easiest way to accomplish this would be to use a database. The database would be updated each time a person logs on and off of their workstation. The program on the PC would then update the DB every X minutes to let the DB know that the person is still using the computer.

A program on a server could then go through all the database records once in a while a remove all of the old records that haven't beed updated in a while. This is done because a users computer may crash or something else may happen. You could implement this in the ASP page if you wanted to. (IE- everytime a page is loaded, do some cleaning)

Your ASP page would simply pull things out of a database.

This, of course, is a very basic method and would require a program to be on the client machine.

There are third party solutions out there that can make this easier.