Previous Thread
Next Thread
Print Thread
Rate Thread
#219148 06/17/2002 2:37 AM
Joined: Oct 2001
Posts: 157
Member
Member
Offline
Joined: Oct 2001
Posts: 157
Can someone find a way to display "Maximum Online Ever was:" in the Who's Online page? Additionally date and time stamp would be great!


Yors Truly

Who? Me? Worry?
Sponsored Links
Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
As used in UBB.Classic - I am guessing this would be fairly simple as the WOL would have to match the current figure to a variable, and if the figure was higher overwite the lower one, and display that variable. I guess the date/time could be passed at the same time.

I am not good at starting hacks - but if I get a chance, i will see if it can easily be done, unless I am beaten to it

Ian


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I think this was done once already? I seem to recall it being done but perhaps that was a while back in the perl days.

Joined: Oct 2001
Posts: 157
Member
Member
Offline
Joined: Oct 2001
Posts: 157
As far as I could search, I couldnt find anything like that for v6

Me too, not very good at starting a hack but given a framework, can develop.


Yors Truly

Who? Me? Worry?
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I'll add this to my list then. It's not that hard of a hack. I should have it out tonight.

Sponsored Links
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Ok, here goes...

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 />



And that should do it.

I have it working at my test site:
http://www.chattersonline.com/test/ubbthreads.php?Cat=


Edit Note: I have added some code so 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.

Last edited by JustDave; 06/29/2002 9:35 PM.
Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
This looks to be working fine for me so far

Thanks!

Joined: Oct 2001
Posts: 157
Member
Member
Offline
Joined: Oct 2001
Posts: 157
Works fine Justdave!! Thanks a ton!! You are Da Maan


Yors Truly

Who? Me? Worry?

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:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
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-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)