|
Joined: Oct 2001
Posts: 157
Member
|
Member
Joined: Oct 2001
Posts: 157 |
Someone made me a little mod for 6.1 which added a line in the Main Index Page, showing "Maximum Users Ever Online: xxx".
can someone suggest what to do in 6.2.3 please.
Thanks in advance.
Yors Truly
Who? Me? Worry?
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
IIP (Integrated Index Page) will keep track and store this info. You can find it at the top of "Forum Design Integration". 
|
|
|
|
Joined: Oct 2001
Posts: 157
Member
|
Member
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 <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?
|
|
|
|
Joined: Aug 2000
Posts: 1,609
Addict
|
Addict
Joined: Aug 2000
Posts: 1,609 |
They don't have to visit IIP to be counted. It counts users that are logged-on and anywhere within your Threads site.
|
|
|
|
Joined: May 2003
Posts: 1,068
Junior Member
|
Junior Member
Joined: May 2003
Posts: 1,068 |
Something isn't right with that on my site. If you go to http://www.vhfans.com/boards/index.php and look at Max Online the count is off. I have seen 12 members and 18 guests on at one point and it only shows 5 and 1.
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
Have you had more than 6 online?
I think the issue is that in order to "update" or store the total - somebody needs to load the Index Page which captures the newer number.
If nobody goes to that page - then the information will never get updated.
I haven't played with the hack you posted above to see if it works... because most of use IIP and/or the sidebar like here.
|
|
|
|
Joined: May 2003
Posts: 1,068
Junior Member
|
Junior Member
Joined: May 2003
Posts: 1,068 |
Thanks for pointing that out Josh, yes I have had several more than that at one time. I was just going off of what AKD96 said above, you explained it though 
|
|
|
|
Joined: Oct 2001
Posts: 157
Member
|
Member
Joined: Oct 2001
Posts: 157 |
[]JoshPet said: I think the issue is that in order to "update" or store the total - somebody needs to load the Index Page which captures the newer number.[/]
Exactly my point. End of the day, we removed the entrance page bcos not many were using it.
Yors Truly
Who? Me? Worry?
|
|
|
|
Joined: Apr 2002
Posts: 206
Member
|
Member
Joined: Apr 2002
Posts: 206 |
how did this thread get so wide?
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
There was a big huge long line inside the code tag above. I edited it and now it seems back to normal.
|
|
|
|
Joined: Aug 2000
Posts: 1,609
Addict
|
Addict
Joined: Aug 2000
Posts: 1,609 |
Way to go PetJosh!! 
|
|
|
|
Joined: Apr 2002
Posts: 206
Member
|
Member
Joined: Apr 2002
Posts: 206 |
Do code tags not do wordwrapping then? Hmm...
|
|
|
|
Joined: Aug 2000
Posts: 1,609
Addict
|
Addict
Joined: Aug 2000
Posts: 1,609 |
That is the sole-purpose of them.
|
|
|
|
Joined: May 1999
Posts: 3,039
Guru
|
Guru
Joined: May 1999
Posts: 3,039 |
Nope, no word wrapping. It's basically like the html pre tag. I was going to use the php wordwrap() function in there but there is an exploit with wordwrap() in a range of php versions.
UBB.threads Developer
|
|
|
|
Joined: Oct 2001
Posts: 157
Member
|
Member
Joined: Oct 2001
Posts: 157 |
[] JoshPet said:There was a big huge long line inside the code tag above.  [/] Sorry for that
Yors Truly
Who? Me? Worry?
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
No problem. I used to do it all the time, and Dave_L used to smack me for it all the time. 
|
|
|
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.
|
|
Posts: 417
Joined: November 2001
|
|
Forums63
Topics37,575
Posts293,930
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|