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 (To the top of the page you want the shoutbox displayed on. Also you can place in a separate file and call it like this include('path/shoutbox.php');:
<?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 (This is the code that will display the shoutbox. Place this code where you want the shoutbox):
<div style="width:200px;"><?php echo getShoutBoxContent(); ?></div>
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
Please let me know if you have any questions.
Okay, you guys are going to probably get tired of me posting my questions in the thread, but I'm a total n00b at the backend side of AJAX Chat. I've only used the client side. I need help on setting up the shoutbox of my AJAX chat room. I have two websites ,one for the "full screen" mode of the site, and one where I plan to put the shoutbox on. How can I set this up?
--
You received this message because you are subscribed to the Google Groups "AJAX-chat" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ajax-chat+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.