https://www.icyphoenix.com/viewtopic.php?f=32&t=3687&p=47824#p47824
-----------------------------------
Itsacraig
Sun 14 Feb, 2010 19:18

Re: Shoutbox For PHPBB3?
-----------------------------------
Hi, I am trying to implement the Ajax Chat, and trying to follow the instructions to what i need to edit in the functions.php script, but I got a feeling Im gonna end up with bugs due to syntax and what I should be adding exactly, so was wondering if someone could assist me with this? 

I will highlight the bits in the following code I need help with..

function getShoutBoxContent()
{
	global $phpEx, $phpbb_root_path;

	// Get the URL to the chat directory:
	if (!defined('AJAX_CHAT_URL'))  [b]WHEN IT ASKS FOR THE CHAT URL HERE, DO I INCLUDE HTTP:// ?[/b]
	{
		define('AJAX_CHAT_URL', $phpbb_root_path . 'chat/');  [b]AND I ADD THE SAME AS ABOVE HERE??[/b]
	}

	// Get the real path to the chat directory:
	if (!defined('AJAX_CHAT_PATH'))  [b]DO I NEED TO EDIT THIS BIT? IF SO, DO I ADD EXACTLY THE SAME???[/b]
	{
		if (empty($_SERVER['SCRIPT_FILENAME']))  [b]IT NOW JUST ASKS FOR THE SCRIPT NAME, DO I SIMPLY ENTER INDEX.PHP HERE?[/b]
		{
			$_SERVER['SCRIPT_FILENAME'] = $_SERVER['DOCUMENT_ROOT'] . $_SERVER['SCRIPT_URL'];  [b]AND IT ASKS FOR THE SCRIPT NAME AGAIN AND SCRIPT FILE NAME.  WHAT SHOULD BE PUT HERE???[/b]
		}
		define('AJAX_CHAT_PATH', realpath(dirname($_SERVER['SCRIPT_FILENAME']) . '/chat') . '/');  [b]AND HERE AGAIN FOR BOTH CHAT PATH AND SCRIPT FILE NAME[/b]
	}

	// Validate the path to the chat:
	if (@is_file(AJAX_CHAT_PATH . 'lib/classes.' . $phpEx))   [b]AND WHAT DO I ENTER HERE IN ALL THESE SECTIONS?[/b]
	{
		// Include Class libraries:
		require_once(AJAX_CHAT_PATH.'lib/classes.' . $phpEx);

		// Initialize the shoutbox:
		$ajaxChat = new CustomAJAXChatShoutBox();

		// Parse and return the shoutbox template content:
		return $ajaxChat->getShoutBoxContent();
	}

	return null;


