Disclaimer: Please backup every file that you intend to modify. If the modification modifies the database, it's a good idea to backup your database before doing so.
Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.
Not by default. The new menubar doesn't have just one cell for it's table, but has two now. So as per the instructions, this causes a problem because the template code you need to add kinda fudges that up.
You can fix it easily by moving it in it's own seperate table.. which I have done, but I have yet another problem. In the past, when nobody was in the chat, that table didn't display at all. But now, even when nobody is chatting, the border of that table still displays (most likely because I added a new table in the template to hold the chat info).
So.. I haven't had time to play around with it enough to work properly, but when I figure it out I can post the update to the code.
Ok, I see whoever installed that hack here has it working properly with the new menubar... someone needs to share the wealth I've been poking around for 20 minutes and can't get it to look right for me.
Unless I'm screwing something up.. but when I do that on my site, it doesn't work, it puts the info only on the left column, and the far column is empty
No new tables no new anything. Just add this in the $chatoutput HTML define in the td call
So in ubbt-inc.php you entered this
// ---------------------------- // Let's see if there are any people in the chat room - by JoshPet $query = " SELECT COUNT(*) FROM {$config['tbprefix']}Online WHERE O_What = 'chatheader' OR O_What = 'chatroom' OR O_What = 'chat' "; $sth = $dbh -> do_query($query); list($chatcount) = $dbh -> fetch_array($sth); if ($chatcount == "1") { $chatoutput = "<tr><td class="lighttable" align="center"><b>There is currently $chatcount user in the <a href="{$config['phpurl']}/chat.php" target="_top">Chat Room</a>. Join them!</td></tr>"; } else if ($chatcount > "1") { $chatoutput = "<tr><td class="lighttable" align="center"><b>There are currently $chatcount users in the <a href="{$config['phpurl']}/chat.php" target="_top">Chat Room</a>. Join them!</td></tr>"; } else { $chatoutput = ""; } TWICE
CHANGE IT TO THIS
// ---------------------------- // Let's see if there are any people in the chat room - by JoshPet $query = " SELECT COUNT(*) FROM {$config['tbprefix']}Online WHERE O_What = 'chatheader' OR O_What = 'chatroom' OR O_What = 'chat' "; $sth = $dbh -> do_query($query); list($chatcount) = $dbh -> fetch_array($sth); if ($chatcount == "1") { $chatoutput = "<tr><td class="lighttable" colspan="2" align="center"><b>There is currently $chatcount user in the <a href="{$config['phpurl']}/chat.php" target="_top">Chat Room</a>. Join them!</td></tr>"; } else if ($chatcount > "1") { $chatoutput = "<tr><td class="lighttable" colspan="2" align="center"><b>There are currently $chatcount users in the <a href="{$config['phpurl']}/chat.php" target="_top">Chat Room</a>. Join them!</td></tr>"; } else { $chatoutput = ""; }
Usually you're missing a } if you're getting that error - you might need to double check the directions, make sure you copy and paste. Make sure you don't copy over the closing } for the send_header function.
This would work with any script that is 'chat.php' or you can alter it - but it really has nothing to do with the chat program - it just counts users in who's online showing a certain location - in this case 'chat.php'.
[]ChAoS said: Hmm..I changed chat.php to sigma_chat.php but nothing happened.. I don't see it anywhere lol.. [/] Any ideas on this? I tried it twice maybe my Generic Header is interfereing with it?
When you know that someone is in chat - you need to view the online table: SELECT * FROM w3t_Online
And see what location that user is being shown as - then this mod simply counts the number of users showing whatever in the online table. The mod is setup to count them if their online location shows 'chat' in the online table. But I'm not familiar with whatever mod you're using. So you'll need to see what the location is reporting in the online table and adjust this mod accordingly.
and I edited the four lines in ubbt.inc respectively (/sigma_chat.php)and still no worky.I double checked all my code several times too. This is such a simple modification and frankly I am baffled.
OK - that was helpful. You're editing the link to the chat room - which is good. But since it's showing as 'sigma_chat' in the online table - we need to alter the query to grab users at that location - right now it's looking for people on pages you don't have.
I think this query is used twice.... but basically find this:
Code
<br /> SELECT COUNT(*)<br /> FROM {$config['tbprefix']}Online<br /> WHERE O_What = 'chatheader'<br /> OR O_What = 'chatroom'<br /> OR O_What = 'chat'<br />
And change it to this:
Code
<br /> SELECT COUNT(*)<br /> FROM {$config['tbprefix']}Online<br /> WHERE O_What = 'sigma_chat'<br />
Josh I notice that sometimes the chat header dissappears and isnt showing. Does is not show up if the chatroom is empty? As of right now one person is in chat and it has dissappeared again. In fact I just ran the query in your above thread and SQL doesn't show him in chat. I believe he has been in there AFK for a while. Does SQL time out after a while if a user is not active?
They drop off the online table after whatever time period you specify (default 10 minutes). Threads cannot track them or update their activity time unless you are refreshing the page. So not sure what mod you're using. One of my mod used a pop-under window which refreshed every 9 mintues and updated their location - and my current Raidersoft mod updates a header (in an iframe) every 9 minutes to keep the table updated. But if the page isn't refreshing - they "drop off" the list after the specified time of inactivity. Even if they are in chat - threads isn't tied into the chat server in any way to know this.
[]jamie said: doesn't seem to do anything for me? i followed all the instructions correctly. [/]
My guess is you're limiting use to authenticated users, so you only need to show users in ubbt_registerednav.tmpl. Unfortunately, the comment above the include of ubbt_unregisterednav.tmpl in ubbt.inc.php is wrong:
// Now require the registerednav.php template $html = new html; list($tbopen,$tbclose) = $this -> table_wrapper(); if (!$debug) { include("$thispath/templates/$tempstyle/ubbt_unregisterednav.tmpl"); }
So you may end up adding it to a nav bar that will never show any users. I ran into that briefly.
Since I'd rather not add a whole other row to the nav bar, I just show the number of users in the chat room (if any) in parens next to the main link to it:
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.