Solve:
Code:
Step 1.
In Index.php ;
Find ;
// ### LOGGED IN USERS #################################################
And insert this code above it ;
// ############### Paul M - Who has visited today v2.31 #################
$tnow = date('YmdHis',TIMENOW - $vboptions['hourdiff']);
$cutoff = TIMENOW - (substr($tnow,8,2)*3600 + substr($tnow,10,2)*60 + substr($tnow,12,2));
//$cutoff = TIMENOW - 86400 ; // ## Uncomment this line if you want a rolling 24 hours display ## //
$todaysusers = $db->query("SELECT userid, lastactivity, options, username, user.usergroupid, displaygroupid,
groupa.opentag as opentaga, groupa.closetag as closetaga, groupb.opentag as opentagb, groupb.closetag as closetagb
FROM " . TABLE_PREFIX . "user as user
LEFT JOIN " . TABLE_PREFIX . "usergroup as groupa ON(user.usergroupid = groupa.usergroupid)
LEFT JOIN " . TABLE_PREFIX . "usergroup as groupb ON(user.displaygroupid = groupb.usergroupid)
WHERE lastactivity > " .$cutoff. " ORDER BY username" );
$totaltoday = 0;
unset ($whotoday);
while ($today = $db->fetch_array($todaysusers))
{
$totaltoday += 1;
$today['opentag'] = $today['opentaga'] ;
$today['closetag'] = $today['closetaga'] ;
if ($today['displaygroupid'])
{
$today['opentag'] = $today['opentagb'] ;
$today['closetag'] = $today['closetagb'] ;
}
$today[visible] = 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 ###############
Step 2.
In the FORUMHOME Template ;
Find;
<!-- end logged-in users -->
and add after;
<!-- Todays active users -->
<tbody>
<tr>
<td class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_todayusers')"><img id="collapseimg_forumhome_todayusers" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_todayusers].gif" alt="" border="0" /></a>
Total users that have visited today: $totaltoday
</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_todayusers" style="$vbcollapse[collapseobj_forumhome_todayusers]">
<tr>
<td class="alt2"><img src="$stylevar[imgdir_misc]/whos_online.gif" alt="Users online today" border="0" /></td>
<td class="alt1" width="100%"><div class="smallfont">$whotoday</div></td>
</tr>
</tbody>
<!-- Todays active users -->
Step 3.
This is optional, but will speed up the query if you have a large number of members;
Run the following SQL query;
ALTER TABLE user ADD INDEX (lastactivity)