There was some cause for alarm as the "Who's Online" box information did not match the extra information listed at the bottom of ubbthreads.php and this was taken to be an error.
It's not an error though. The information at the bottom includes users that are invisible so the number may be greater than the online box. I have attached an updated "Who's Online" box to include the invisible users.
This version seems to be working. I tested it on my main site's 5.4.6 threads version and it worked fine. (I did write it for 6.0 though)
Let me know what you think. I still don't know if I like the way it lays out but after a number of different attempts I stuck with this one.
I added <a href = "$phpurl/online.php?Cat=$Cat" $target>{$ubbt_lang['WHO_ON']}</a> before the who's online bit so that we have a link, but the URL is going back to the top level of my domain, rather than the threads directory.
I copied this straight from the registered_nav template, so I would have thought it should have worked.
Any thoughts as to why it is not? It seems like $phpurl is not being picked up.
some don't, but that's why... I am not sure why one is used in some places and not all, but Dave will probably be along before long and set me straight
this one's layout seems a bit odd and a bit wordy in seperating out the invisible members, I think maybe the 6.0 version seemed a bit better. Also, when logged out, the guest only sees something like "2 guests browsing in the last 10 min" where as the 6.0 version said "There are 4 members and 2 guests browsing this forum in the last 10 min" (the new one completely leaves off the member count for guests/non-logged-in members
We talked a bit about this in the other thread.... but *IF* I wanted to put this in the ubbt_registerednav.tmpl file... I know the coding would need to go into a different place. Allen suggested in the ubbt.inc.php file. But I tried several logical (to non-programmer me) places and it didn't work. Any idea where?
I was thinking about putting it in the registerednav.tmpl file because I think it would be cool to always see that.. when viewing a list of posts, or making a post etc..
**OR** Maybe you guys know better that it would produce way too many queries and not be practical. I wouldn't attempt it if you guys honestly thought it wasn't practical. I just don't know much about how many queries things generate etc... Dave you seem to be pretty knowledgeable from your work with the index page.
To get this to work on all pages that use the send_header function you will need to change this line:
$LastOn = $html -> get_date() - 600;
to this one:
$LastOn = $this -> get_date() - 600;
and then place the code inside of the send_header function of their ubbt.inc.php script below this:
code: // ------------------------------------------------- // Are we showing the user list to reged users only? if ( ($config['userlist'] == 2) || ($config['userlist'] == 1) ){ $template['members_link'] = " | <a href="$phpurl/showmembers.php?Cat=$Cat&page=1" $target>{$ubbt_lang['USER_LIST']}</a>"; }
Ok now in your registerednav.tmpl place this code:
This is awesome!!! Thank you... I was nowhere close in ubbt.inc.php
I did make a change to the ubbt_registerd.tmpl to make the Who's online box appear, attached, below the text menu... in the same place that the language flags appear. But I only display language flags for UNregisterd users... registerd users will have the who's online in that space.
Just after this: {$template['members_link']} </td> </tr>
in my ubbt_registerd.tmpl file
This looks cool. Now since I was on such a streak, I decided to add the words "who's Online:" before the text so that I could remove the "who's online" link from the menu....
I replaced the very last line of Dave's code in ubbt.inc.php to this: $whosOnline = "<a href = "{$config['phpurl']}/online.php?Cat=$Cat" $target>Who's Online:</a> $InvMembsOnline$VisMembsOnline$AnonsOnline have been online with in the last 10 minutes.";
Then removed the "Who's Online" link from the normal menu in ubbt_registerd.tmpl
Just delete this: | <a href = "$phpurl/online.php?Cat=$Cat" $target>{$ubbt_lang['WHO_ON']}</a>
Thanks for your help on this. I'm sure this looks very simple to y'all. But I was pretty proud. Josh
I'll look over the code and post the fix tomorrow night. I'm headed to bed now. Actualy will post later tonight I guess as it's already the next day. LoL
That doesn't explain the mismatch I see in guests. Right now it tells me both 1 and 2 guest/anon users. As a note, I've noticed when the count is wrong it is quite often double the expected count. Not always..but I'd say the majority of the time.
That doesn't explain the mismatch I see in guests. Right now it tells me both 1 and 2 guest/anon users. As a note, I've noticed when the count is wrong it is quite often double the expected count. Not always..but quite often, just a note.
the numbers match once you hit the who's online page and come back to the forum summary page. For some reason, the part you see that's in the base code for threads (the top line that doesn't mention names) doesn't get updated until you visit the who's online page then come back. The part that JustDave did is accurate.
This is a great Hack! Is there anyway to get it to show on the Categories pages when users are using categories View? (the default for my web site is categorie view)
I think I'll add them instructions into that latest attachment, 6.2, and post to the finished modifications board. I haven't heard of any more problems with this hack.
Hey Dave, I'm using this hack....at the top of every page as I posted here in this thread.
My chatroom is inside a php page (chat.php) and thus "who's Online" shows "In the Chatroom".
Is there a way...... in that hack on each page.... to show the number of users on the "chat.php" page, using Who's Online Data.
For example:
6 Visible members (joe, smith, bob, john, pete, dave) and 3 guests have been online in the last 10 minutes. 3 people are in the chatroom right now.
Or...
6 Visible members (joe, smith, bob, john, pete, dave) and 3 guests have been online in the last 10 minutes. 3 people (bob, john, pete)are in the chatroom right now.
Just a thought. Seems doable... but beyond me. Would that add too many queries to make it worth while?
Counting the number of users on the specific page should be easy enough to do. That will add one more query. I'll have to look at the code before I can say what needs to go where.
actually nevermind the last error, it stopped popping up. But now im not getting anything. The code is in the ubbt.inc.php and ubbt_registered.tmpl like you guys specified, but all I see is a thin narrow bar.
Josh its working for the unregistered users but once I login, it stops working. Heres what my ubbt_registerednav.tmpl looks like. I inserted the code just like I did for the ubbt_unregisterednav.tmpl
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.