I figured I should post this here also so that it's more evident.
In your ubbthreads.php script find this:
code:
// -----------------------
// Grab the total # online
$query = "
SELECT O_Type,COUNT(*)
FROM w3t_Online
GROUP BY O_Type
";
$sth = $dbh -> do_query($query);
while(list ($type,$count) = $dbh -> fetch_array($sth)) {
${$type} = $count;
}
if (!$a) { $a = "0"; }
if (!$r) { $r = "0"; }
and change it to this:
code:
// -----------------------
// Grab the total # online
$LastOn = $html -> get_date() - 600;// back 10 minutes
$query = "
SELECT O_Type,COUNT(*)
FROM w3t_Online
WHERE O_Last > '$LastOn'
GROUP BY O_Type
";
$sth = $dbh -> do_query($query);
while(list ($type,$count) = $dbh -> fetch_array($sth)) {
${$type} = $count;
}
$onNow = $a + $r;// part of "Maximum Users Online" hack
if (!$a) { $a = "0"; }
if (!$r) { $r = "0"; }
// --------------------------------
// Get and Set Maximum Users Online
$query = "
SELECT U_PostsPer,U_Registered
FROM w3t_Users
WHERE U_Number = '1'
";
$sth = $dbh -> do_query($query);
list ($maxOn,$When) = $dbh -> fetch_array($sth);
if ($onNow > $maxOn) {
$date = $html -> get_date();
$date_q = addslashes($date);
$onNow_q = addslashes($onNow);
$query = "
UPDATE w3t_Users
SET U_Registered = '$date_q', U_PostsPer = '$onNow_q'
WHERE U_Number = '1'
";
$dbh -> do_query($query);
$maxOn = $onNow;
$When = $date;
}
$When = $html -> convert_time($When,$user['U_TimeOffset']);
Now in your ubbthreads.tmpl template file find this:
code:
{$ubbt_lang['C_ONLINE']} $r {$ubbt_lang['C_ONLINE2']} $a {$ubbt_lang['C_ONLINE3']}
<br />
and change it to this:
code:
{$ubbt_lang['C_ONLINE']} $r {$ubbt_lang['C_ONLINE2']} $a {$ubbt_lang['C_ONLINE3']}
<br />
Maximum Users Online was <strong>$maxOn</strong> on $When
<br />
That should do it.

Example
Here.
Note: This hack will only count those that have been online in the last 10 minutes. This is the same amount of time the "Who's Online" page uses so the information matches. I think that this will also make .threads extra information match my "Who's Online" box.
