Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Oct 2001
Posts: 157
Member
Member
Offline
Joined: Oct 2001
Posts: 157
Josh, we tried IIP earlier, but wasnt too much of a success in our forum. Everyone was bookmarking and directly landing into the main forums

Anyway, I found the hack among the depths of my hard disk. Can someone please tell me if it will work with 6.2.3? Thanks in advance

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


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 JoshPet; 06/19/2003 10:41 PM.

Yors Truly

Who? Me? Worry?
Sponsored Links
Entire Thread
Subject Posted By Posted
Maximum Users Online... yors 06/09/2003 12:54 PM
Re: Maximum Users Online... JoshPet 06/09/2003 4:03 PM
Re: Maximum Users Online... yors 06/09/2003 5:32 PM
Re: Maximum Users Online... AKD96 06/10/2003 3:49 AM
Re: Maximum Users Online... ericgtr 06/10/2003 3:42 PM
Re: Maximum Users Online... JoshPet 06/10/2003 7:18 PM
Re: Maximum Users Online... ericgtr 06/10/2003 7:57 PM
Re: Maximum Users Online... yors 06/19/2003 6:07 PM
Re: Maximum Users Online... Dalar 06/20/2003 5:30 AM
Re: Maximum Users Online... JoshPet 06/20/2003 5:42 AM
Re: Maximum Users Online... AKD96 06/20/2003 5:44 AM
Re: Maximum Users Online... Dalar 06/20/2003 9:01 AM
Re: Maximum Users Online... AKD96 06/20/2003 3:51 PM
Re: Maximum Users Online... Rick 06/20/2003 9:29 PM
Re: Maximum Users Online... yors 06/21/2003 8:16 AM
Re: Maximum Users Online... JoshPet 06/21/2003 8:28 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:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Zarzal
Zarzal
Berlin, Germany
Posts: 808
Joined: July 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
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 20240506)