// ############### Paul M - Who has visited today v1.40 #################
require_once('./includes/functions_misc.php');
$now = TIMENOW - intval($vboptions['hourdif']);
$cutoff = vbmktime(0, 0, 0, date('m', $now), date('d', $now), date('Y', $now));
//$cutoff = $now - 86400 ; // ## Uncomment this line if you want a rolling 24 hours display ## //
$todaysusers = $DB_site->query("SELECT userid, lastactivity, options, username, opentag, closetag
FROM " . TABLE_PREFIX . "user as user
LEFT JOIN " . TABLE_PREFIX . "usergroup as usergroup ON(user.usergroupid = usergroup.usergroupid)
WHERE lastactivity > " .$cutoff. " ORDER BY username" );
$totaltoday = 0;
while ($today = $DB_site->fetch_array($todaysusers))
{
$today[visible] = 1 ;
$totaltoday += 1;
if ($today[options] & $_USEROPTIONS[invisible])
{
$today[visible] = 0 ;
if (($permissions['genericpermissions'] & CANSEEHIDDEN) OR $today['userid'] == $bbuserinfo['userid'])
{
$today[visible] = 2 ;
}
}
if ($today[visible])
{
$wrdate = vbdate($vboptions['timeformat'], $today['lastactivity']);
$whotoday .= "<a href='member.php?u=$today[userid]' title='$wrdate' >";
if ($today[visible] == 2)
{
$whotoday .= $today['opentag'].$today[username].$today['closetag']."</a>*, ";
}
else
{
$whotoday .= $today['opentag'].$today[username].$today['closetag']."</a>, ";
}
}
}
if ($whotoday)
{
$whotoday = substr($whotoday, 0, strlen($whotoday)-2);
}
// ############# End of Who has visited today ###############