2009-02-20, 12:42 AM
Hello.
I have a problem with creating shoutbox out of AJAX chat.
I downloaded AJAX chat from here: https://blueimp.net/ajax/
It is supposed to work well also as a shoutbox on MyBB forums.
I read through the readme file, AJAX Chat Wiki, I was looking for an answer at this forum (e.g. this thread) and at some other forums as well and I couldn't find one.
That's the part of readme file which says about "shoutbox function":
I tried adding the code from the first point to global.css (through ACP>Templates&Styles>Themes>Default>), adding the code from second point to functions.php and adding code from third point to the footer of my forum. But it didn't work.
If it can be of any help, here is an instruction on how to integrate the AJAX Chat shoutbox with phpBB3 forum.
Link to my forum (test forum, that's why it's nothing in there): http://inwgaz.unl.pl/
Link to chat directory: http://inwgaz.unl.pl/chat/
Thanks for help
m_i-k_i
I have a problem with creating shoutbox out of AJAX chat.
I downloaded AJAX chat from here: https://blueimp.net/ajax/
It is supposed to work well also as a shoutbox on MyBB forums.
I read through the readme file, AJAX Chat Wiki, I was looking for an answer at this forum (e.g. this thread) and at some other forums as well and I couldn't find one.
That's the part of readme file which says about "shoutbox function":
Shoutbox:
=========
AJAX Chat is also usable as shoutbox - this is a short guide on how to set it up:
1. Shoutbox stylesheet
----------------------
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.
2. Shoutbox function
--------------------
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', <<MYBB_ROOT>>'./chat/');
} <<$mybb, $orig_dir, $db, $base_url>>
// 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.
2. Shoutbox output
------------------
Display the shoutbox content using the shoutbox function:
<div style="width:200px;"><?php echo getShoutBoxContent(); ?></div>
Can you tell me, step by step, what should I do? In which files should I put this codes? Should I change something in them or not?I tried adding the code from the first point to global.css (through ACP>Templates&Styles>Themes>Default>), adding the code from second point to functions.php and adding code from third point to the footer of my forum. But it didn't work.
If it can be of any help, here is an instruction on how to integrate the AJAX Chat shoutbox with phpBB3 forum.
Link to my forum (test forum, that's why it's nothing in there): http://inwgaz.unl.pl/
Link to chat directory: http://inwgaz.unl.pl/chat/
Thanks for help
m_i-k_i