README:
AJAX Chat is also usable as shoutbox - this is a short guide on how to set it up:
Add the following line to the stylesheet (CSS) of all pages displaying the shoutbox:
@import url("http://example.org/path/to/chat/css/shoutbox.css");
Replace http://example.org/path/to/chat/ with the URL to the chat.
Modify css/shoutbox.css to your liking.
Add the following function to your PHP 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;
}
?>
Make sure AJAX_CHAT_URL and AJAX_CHAT_PATH point to the chat directory.
Display the shoutbox content using the shoutbox function:
<div style="width:200px;"><?php echo getShoutBoxContent(); ?></div>
2. I feel like this is where my problem is. I'm confused with the difference between the AJAX_CHAT_URL and the AJAX_CHAT_PATH.I'm assuming the URL would be the same thing I put in the @import url statement, right? But what would I put for the PATH? I thought it would be just like the path you would find if you're using a FTP program like FileZilla, but I've tried multiple methods and it just won't work for me, it's getting pretty frustrating. Could someone post some example code?
define('AJAX_CHAT_URL', './chat/');
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').'/');
}
define(AJAX_CHAT_URL, './chat/'); The red part is the only thing you should change in the code,
BUT I don't really thing it's needed.
BUT I see one more issue. You have replaced several 'AJAX_CHAT_PATH' with 'MYBB_ROOT'.Is that some special instructions from the integrated readme? If not, I suggest you remove everything, and just insert thedefault code from readme into the forums index.php(or the page where you want the shoutbox to be visible).
Try this and get back.
I don't have any integrated version, so I don't really know exactly how they work.
So my suggestions are general, but hopefully I can give you some hint on how to proceed.
//FireWire
EDIT: I want to add, that the Wiki about this, is a bit unclear regarding what to do with
the code. It could be read as that you should replace 'AJAX_CHAT_URL' and 'AJAX_CHAT_PATH'
but that's not the case.