Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
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.

Sponsored Links
Entire Thread
Subject Posted By Posted
[UBBT 6.0] Maximum Users Online JustDave 06/30/2002 4:40 AM
Re: [UBBT 6.0] Maximum Users Online JoshPet 06/30/2002 4:46 AM
Re: [UBBT 6.0] Maximum Users Online Aglavalin 06/30/2002 7:20 AM
Re: [UBBT 6.0] Maximum Users Online AllenAyres 06/30/2002 7:25 AM
Re: [UBBT 6.0] Maximum Users Online Aglavalin 06/30/2002 8:25 AM
Re: [UBBT 6.0] Maximum Users Online msula 07/03/2002 5:46 AM
Re: [UBBT 6.0] Maximum Users Online Aglavalin 07/03/2002 6:19 AM
Re: [UBBT 6.0] Maximum Users Online msula 07/03/2002 6:26 AM
Re: [UBBT 6.0] Maximum Users Online msula 07/03/2002 6:32 AM
Re: [UBBT 6.0] Maximum Users Online yors 07/04/2002 7:22 AM
Re: [UBBT 6.0] Maximum Users Online Deejay_dup1 08/27/2002 4:59 AM
Re: [UBBT 6.0] Maximum Users Online JoshPet 08/27/2002 5:50 AM
Re: [UBBT 6.0] Maximum Users Online Aglavalin 09/13/2002 10:32 AM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Shock Hosting
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
badfrog
badfrog
somewhere on the coast of Maine
Posts: 94
Joined: March 2007
Forum Statistics
Forums63
Topics37,583
Posts293,955
Members13,824
Most Online151,614
Nov 14th, 2025
Today's Statistics
Currently Online 37729
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 12
Top Posters
AllenAyres 21,080
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2026 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260108)