Here is basic code for displaying who is currently active on your site within the last half hour (1800 secs). I placed it beneath the main menu on index.php. I originally wanted to show if a particular user was online so that others would know that they could chat with them ( a VIP who has his chat open when logged into Moodle) at this time.
Now, how can I alert the other user that I would like to chat to them? Or guide them to a particular chat room within Moodle? Any other uses, tangents to pursue?