MyBB Community Forums

Full Version: Ajax chat tab
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
How can I display how many members are in the chat box?

Like this forum: http://www.ezeegaming.com/
is this ajax chat a mybb plugin or just an iframe linking to another php/ajax script?
(2012-07-06, 10:31 PM)JamieJackson Wrote: [ -> ]is this ajax chat a mybb plugin or just an iframe linking to another php/ajax script?

It's a MyBB plugin.

https://blueimp.net/ajax/
judging from the screenshots on their website online users is already there?
if its not there for you maybe try downloading and installing the plugin again
(2012-07-06, 10:46 PM)JamieJackson Wrote: [ -> ]judging from the screenshots on their website online users is already there?
if its not there for you maybe try downloading and installing the plugin again

I'm talking about on ezeegaming.com, in the header they have chat then it shows the online users.
They probably wrote their own script. Create your own PHP script and INSERT into your template.

Perform a mysql query for: mysql_query("SELECT * FROM ajax_chat_online");
(2012-07-07, 03:12 AM)bgrella Wrote: [ -> ]They probably wrote their own script. Create your own PHP script and INSERT into your template.

Perform a mysql query for: mysql_query("SELECT * FROM ajax_chat_online");
I preformed the query, what would I insert?
$total_chatters1 = mysql_query("SELECT * FROM ajax_chat_online");
$total_chatters = mysql_num_rows($total_chatters1);

echo $total_chatters;

Where you want it.

You need the plug in that lets you use PHP in templates to do this.
I pasted it exactly where I wanted and it doesn't display. I have this plugin too:
http://community.mybb.com/thread-31860.html
If your ajaxchat tables are in a separate database than MyBB (most likely), then you need to connect to your ajaxchat database first. Did you do that? You should close the ajaxchat connection after the echo and reestablish your MyBB database connection.

define ('chatDB_USER', '');
define ('chatDB_PASSWORD', '');
define ('chatDB_HOST', '');
define ('chatDB_NAME', '');

$linkconnect = mysql_connect (chatDB_HOST, chatDB_USER, chatDB_PASSWORD) or die(mysql_error());
Pages: 1 2