Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: May 1999
Posts: 241
Coder
Coder
Offline
Joined: May 1999
Posts: 241
Hey Poil,

I really like this hack, however, I think one thing needs to be added... a date/time field... looking at my site, it's wonderful to know that I had 21 people on at once... my big question is, 'when did it happen?' []https://www.ubbdev.com/threads/php/images/icons/smile.gif[/]

Not a big thing to add in... I'll see if I can get to it today.

edit:

done! Here's the modified code:

[:blue]If you've already installed this hack, run this from the Admin Database Manager -> SQL Commands window:

[:green]ALTER TABLE w3t_Total ADD T_Time INT (9) UNSIGNED not null

[:blue]then modify the code in ubbt.inc.php/main.inc.php thusly:
[:green]

// boom get everyone logged in right now and post into
// w3t_Total
// Total

$query = "SELECT COUNT(*) FROM w3t_Online";
$sth = $dbh -> do_query($query);
list($Number) = $dbh -> fetch_array($sth);
// insert this number into the DB if it is larger than it ?
// so first query db
$query = "SELECT Total FROM w3t_Total";
$sth = $dbh -> do_query($query);
list($TNumber) = $dbh -> fetch_array($sth);
if ($Number > $TNumber) {
[:red]$date = $this -> get_date();
$query = "UPDATE w3t_Total
SET Total = '$Number'[:red],
T_Time = '$date'
WHERE Total = '$TNumber'
";
$dbh -> do_query($query);
}
$dbh -> finish_sth($sth);
$dbh -> finish_sth($query);
}


[:blue]And, make the following code changes in online.php:
[:green]

echo "<tr class="darktable"><td>$lang[ONLINE_BODY]";
$html -> close_table();

echo "<p>";

$query = "SELECT Total[:red],T_Time FROM w3t_Total";
$sth = $dbh -> do_query($query);
list($TNumber[:red],$TTime) = $dbh -> fetch_array($sth);

$html -> table_header("Most Users Online");
$html -> open_table();
[:red]$TTime = $html -> convert_time($TTime,$user['U_TimeOffset']);
echo "<tr class="darktable"><td>The Most Users online at one time is: $TNumber [:red]at $TTime";

$html -> close_table();
$dbh -> finish_sth($sth);
echo "<p>";


if you haven't already installed the hack, then modify poil's instructions with the code above...

That should do it!

Enjoy!

Last edited by MattyJ; 11/19/2001 7:24 AM.

--------------------
Matt Reinfeldt
http://www.mattreinfeldt.com/
Sponsored Links
Entire Thread
Subject Posted By Posted
Most users online at the same time poil 11/12/2001 8:47 PM
Re: Most users online at the same time Pilgrim 11/12/2001 9:46 PM
Re: Most users online at the same time poil 11/12/2001 10:00 PM
Re: Most users online at the same time J.C. 11/12/2001 10:41 PM
Re: Most users online at the same time poil 11/12/2001 10:51 PM
Re: Most users online at the same time Pilgrim 11/13/2001 12:59 AM
Re: Most users online at the same time J.C. 11/13/2001 1:22 AM
Re: Most users online at the same time poil 11/13/2001 5:04 PM
Re: Most users online at the same time MattyJ 11/16/2001 4:14 PM
Re: Most users online at the same time MattyJ 11/19/2001 12:51 PM

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
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,583
Posts293,956
Members13,826
Most Online151,614
Nov 14th, 2025
Today's Statistics
Currently Online 2278
Topics Created 0
Posts Made 0
Users Online 2
Birthdays 24
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)
isaac 1
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 20261016)