Not Solved Where can i put this code? lol
Not Solved
It probably won't work in mybb but if there is a way to put it in i would appreciate some help...

'CHAT_TITLE' => 'Online: '.htmlentities(implode(', ', $chat_online_user_names), ENT_QUOTES, 'UTF-8'),

It is part of madblueimp's code for the ajax chat.. I've done everything else to put the icon in the toplinks but i would really like to show the users in the chatroom next to the toplink if possible...

Is there are a way to do this? Or is there a way to put it into another area on the forums?

Here is madblueimps coding for the icon using PHPBB3

I greatly appreciate any help or suggestions you can offer Smile
Not Solved
That won't work =P What you can do, is adding a new count-query in global.php of the table 'ajax_chat_online'.


// Run global_start plugin hook now that the basics are set up

Add Below
// With MYBB Prefix
$chat_query = $db->simple_select(TABLE_PREFIX."ajax_chat_online", "COUNT(*) AS online", "");
// Without MYBB Prefix
// $chat_query = $db->simple_select("ajax_chat_online", "COUNT(*) AS online", ""); 
$chat_onlineusers = $db->fetch_field($chat_query, "online");
if($db->num_rows($chat_query) == 0)
       $chat_onlineusers = 0;

Then Open your header template

Add a new link
<li><a href="{$mybb->settings['bburl']}/<FILENAME>"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/<IMAGENAME>" alt="Chat" />Chat [{$chat_onlineusers}]</a></li>

Don't forget to change <FILENAME> and <IMAGENAME>
Not Solved
Excellent, thanks Lex! I have an error, i know why, it's because in the database the ajax_chat_online doesn't have the mybb_ before it like the rest of the tables.. Have you any idea how i could go around this?
Not Solved
Use this query,

$chat_query = $db->simple_select("ajax_chat_online", "COUNT(*) AS online", "");
Not Solved
That worked perfectly!! Thanks so much again Lex, you're awesome Big Grin
Not Solved
Dunno what it will show if there are no users =P probably just '[]'
Not Solved
Yea i think so but that's fine lol Smile
Not Solved
worked great thank you!

And if anyone needs DIY help ill be happy to help
Not Solved
LeX-...could you please take a look at the rest of the code for displaying the online users on AJAX Chat ??? i would really appreciate it if you could figure out the code for displaying WHO is online on the chat! PLS !!! thnx in advance !!! Big Grin
Not Solved
i would also be interested in the whos online in chat but have it where the boards whos online is.

i tried my self an just got an error...

Forum Jump:

Users browsing this thread: 1 Guest(s)