<?php
    // m_whoOnline.php
    drawMenuTop("Who's Online?");
    //print "CurrentTime: ". date("H:i:s", time()) . "<br>";
    global $siteSettings;
    $tenMinutes = time() - 1800;
    $loggedIn = mysql_query("select user, max(date) as lastDate
        from hittracker
        where user <> 'Anonymous'
        and date > $tenMinutes
        group by user
        order by lastDate desc") or die(mysql_error());
    while ($row = mysql_fetch_array($loggedIn))
    {
        $timeDiff = date("i:s", (time() - $row['lastDate']));
         
        print "<small>" . $row['user'] . " - " . $timeDiff . "ago</small><br />";
    }
     
    drawMenuBottom();
     
?>
