MyBB Community Forums

Full Version: AJAX Chat - including MyBB integration
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
I would like to know how to add custom usergroups besides admin, moderator, default. So that their usergroup color from the forum shows up in chat. Thanks.
I've had nothing but issues with the script. There's a bug somewhere where the connection to the database does not close. The thing lags, locks up and errors. I get over 225 errors at a clip with this.

Type: 2
File: 100x/lib/class/AJAXChatMySQLiQuery.php (Line no. 23)
Message
mysqli::query(): Couldn't fetch mysqli

Type: 2
File: 100x/lib/class/AJAXChatMySQLiDataBase.php (Line no. 40)
Message
mysqli::select_db(): Couldn't fetch mysqli

Type: 2
File: 100x/lib/class/AJAXChatMySQLiDataBase.php (Line no. 42)
Message
AJAXChatDataBaseMySQLi::select(): Couldn't fetch mysqli

Type: 2
File: 100x/lib/class/AJAXChatMySQLiDataBase.php (Line no. 41)
Message
AJAXChatDataBaseMySQLi::select(): Couldn't fetch mysqli

Anyone have a clue? I talked to my hosting company and they said its' the script from the errors.
I tried on the site for support but it's been a long time and no answer.
I am not a programmer, but I think you have to check whether you are using mysql or mysqli
Any update !?
Hi guys,
I have installed Ajax chat on MyBB forum! it works! but users in MyBB can not login automatically into Ajax chat by their account!
only 4 accoutns (Admin, Modertaur, Users and Guest in lib/data/users.php) of Ajax chat can login to Ajax chat! what should i to do?
best regards...

(2011-01-24, 05:13 PM)behnam9856 Wrote: [ -> ]Hi guys,
I have installed Ajax chat on MyBB forum! it works! but users in MyBB can not login automatically into Ajax chat by their account!
only 4 accoutns (Admin, Modertaur, Users and Guest in lib/data/users.php) of Ajax chat can login to Ajax chat! what should i to do?
best regards...

help please...Sad
i think this plugin is no longer supported by the author..
the last visit of the Plugin Author was lately 2008.
(2011-01-24, 05:13 PM)behnam9856 Wrote: [ -> ]Hi guys,
I have installed Ajax chat on MyBB forum! it works! but users in MyBB can not login automatically into Ajax chat by their account!
only 4 accoutns (Admin, Moderator, Users and Guest in lib/data/users.php) of Ajax chat can login to Ajax chat! what should i to do?
best regards...

No any idea??? Huh

I'm using this as a chat room on my forum, seems pretty good and I made a few changes to suit my forums theme. Also added a link in the forum top-menu area and footer area leading to it. And added some links to the Ajax Chat itself leading back the forum and portal (vice versa).
(2009-11-20, 03:58 PM)ows Wrote: [ -> ]
(2009-07-10, 09:31 PM)ecanikajo Wrote: [ -> ]I would like to insert the Ajax chat on the index page as Shoutbox.

(2009-07-29, 11:41 PM)gimmezell Wrote: [ -> ]I'm interested in using this as a shoutbox too.

First of all ... install and activate this plugin to enable php-code in templates.

Open your themes "global.css" in advanced mode and add this code on top:

@import url("./chat/css/shoutbox.css");

Create a new file with this code:

<?php
function getShoutBoxContent() {
	// URL to the chat directory:
	if(!defined('AJAX_CHAT_URL')) {
		define('AJAX_CHAT_URL', './chat/');
	}
	
	// Path to the chat directory:
	if(!defined('AJAX_CHAT_PATH')) {
		define('AJAX_CHAT_PATH', realpath(dirname($_SERVER['SCRIPT_FILENAME']).'/chat').'/');
	}
	
	// Validate the path to the chat:
	if(@is_file(AJAX_CHAT_PATH.'lib/classes.php')) {
		
		// Include Class libraries:
		require_once(AJAX_CHAT_PATH.'lib/classes.php');
		
		// Initialize the shoutbox:
		$ajaxChat = new CustomAJAXChatShoutBox();
		
		// Parse and return the shoutbox template content:
		return $ajaxChat->getShoutBoxContent();
	}
	
	return null;
}
?>

and save it as "shoutbox.php" in your forums root directory.

Edit your MyBB-Forums "index.php", search for (~line 27)

// Load global language phrases
$lang->load("index");

AFTER add:

// START Shoutbox-Code
ob_start();
include("shoutbox.php");
$shoutbox = ob_get_contents();
ob_end_clean();
// END Shoutbox-Code

Edit your themes template "Index Page Templates --> index". Search for

{$header}

AFTER add:

<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" width="100%" class="tborder">
<thead>
<tr>
<td class="thead">
<div class="expcolimage">
<img src="{$theme['imgdir']}/collapse{$collapsedimg['shoutbox']}.gif" id="shoutbox_img" class="expander" alt="[-]" title="[-]" />
</div>
<div><strong>Shoutbox</strong></div>
</td>
</tr>
</thead>
<tbody style="{$collapsed['shoutbox_e']}" id="shoutbox_e">
<tr>
<td class="trow1"><div style="width:100%;"><?php echo getShoutBoxContent(); ?></div></td>
</tr>
</tbody>
</table>
<br />

Youre done Wink

Demo-Link (sorry, german only)

Nothing happens?

1. Check the path to your chat-directory in "global.css" and "shoutbox.php" (lines 5 and 10)!

2. Activate Output template start/end comments? in Admin-CP --> Configuration --> Settings --> Server and Optimization Options

I made changes carefully. All's ok. but its doesnt work!!!
I'm using MyBB 1.6
help please?
It sure does work - link to an english language site >>

http://www.leefish.nl/mybb/thread-766.html

However, I should warn you that if you are on a shared server then you MAY get problems with your host using this as a chat.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38