Description - This will add a box listing users online to the bottom of your main index page. There are also instructions to add this info to the top of every page for Registered users
Working Under - UBB.Threads 6.2
Pre-requisites - none
Author - JustDave
Credits - JoshPet for adapting instructions to add to top of every page
Files Altered - ubbthreads.php, ubbthreads.tmpl (if you are doing every page - ubbt.inc.php, ubbt_registerednav.tmpl)
Database Altered - none
New Files - none
Notes - This has been around for a few versions. JustDave gets all the credit for creating this.
Thanks for the mod. However, on my site, it seems that there's a little problem. If you click on a user's name (in the who's online box), it seems that you cannot view their profile. You would get an error saying that the user is not in the database. Do you know what could have went wrong? Thanks!
I was wondering if anyone has gotten this to work so you get it at the top of every page? I know Josh had it this way with the old version but I can't figure out how to do it .
Thanks omegatron, that worked great. The only thing is that I was wondering if you would know how to get it on every page like the IIP index and all the other pages?
The code required to define the variable is loaded in ubbthreads.php. There is no way currently as is to do that. However i am playing a bit to see what I can do.
I updated JustDave's documentation a bit (per his request) as he hates to document... and we'd all rather have him creating cool stuff rather than documenting.
I've updated the ZIP file as well. To the bottom of his instructions, I have added instructions to add this to the ubbt_registerednav.tmpl file.
To do that, insert the Who's Online code into ubbt.inc.php just above:
// ------------------------------------------- // Now require the registerednav.php template $html = new html; list($tbopen,$tbclose) = $this -> table_wrapper(); if (!$debug) { include("$thispath/templates/$tempstyle/ubbt_registerednav.tmpl"); } }
And change the first line of the Whos Online code from:
$LastOn = $html -> get_date() - 600;
To this:
$LastOn = $this -> get_date() - 600;
Then insert the Template code into the ubbt_registerednav.tmpl file.
Then it will appear at the top of the page for registered users. If you wish to do it for unregistered users you'll need to place the modified Who's Online code above the require statement for ubbt_unregisterednav.tmpl and edit the ubbt_unregisterednav.tmpl file as well.
it was still leaving the User number off the link to visible user's profiles. I think just dave fixed it, but maybe the instructions I started modifying were downloaded before that.
Small problem... I can get it to show up at the bottom of every page like normal. But for adding to the top of every page, the who's online box is there, but no users are inside of it
Did you alter the first line of the code in ubbt.inc.php.... and did you place it before the registered nav template. There are two similar places. I had that trouble too... If the code is in the wrong place in ubbt.inc.php it won't show any users.
I did change the first line, and I thought I double checked everything, but that's ok. I didn't want it on every page anyway. Just the top of ubbthreads.php so I just edited that template and removed the other part of the hack All is well.
I believe Josh has some instructions around here somewhere that explain how to do that. Off hand I don't know what it would take for sure.
Ohhh Josh....
(I just looked over this thread and I see that Josh's instructions place this on all pages for registered users using the ubbt_registerednav.tmpl file)
This is a great mod. I can't believe that I have overlooked it. I have one question.....I altered the code a little and took out the header so it just shows the list, it was starting to look too busy with the other mods, is there anyway to make it "join" the bottom of the menubar to look like one thing with the tablewrappers around it? I think it looks Much better.
I am having trouble getting the guests to show up. This is using the show whos online on every page... on top.
Other mods installed are the chat online, extra online user info. (both functioning)
the guests are visiting cause I can see them in the extra online info screen in whos online. Its just the generic line that tells how many guests are online. My users like to see how many are visiting. Doesn't help me much but they like it..
Josh I realize that, but guests count stays at zero all the time. Even when I can see them browsing from the other extra info mod in the whos online main screen. It does show the registered guests with no problems.
Is there anyway for it to work with unregistered/not logged in users as well. If I add the code to the ubbt_unregistered template it just shows the 'guests' that are online and not the registered members that are online at the time. Yet unregistered users can still see the members online by clicking on the 'Who's Online' Link.
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.