<?php
define('AJAX_CHAT_PATH', realpath(dirname($_SERVER['SCRIPT_FILENAME'])).'/');
define('AJAX_CHAT_URL', realpath(dirname($_SERVER['SCRIPT_FILENAME'])).'/');
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();
}
else echo "classes.php not found";
return null;
}
function regularChat()
{
// Initialize the chat:
$ajaxChat = new CustomAJAXChat();
}
echo '<html lang="en">
<head>
<style>
@import url("./css/shoutbox.css");
</style>
</head>
<body>';
echo getShoutBoxContent();
echo'</body>
</html>
';
?>