Strona 1 z 1

Ajax Chat na stronie głównej forum ?

: 02 września 2009, 18:02
autor: Baki
Zainstalowałem i zintegrowałem z forum PHPBB3 specjalną wersję chatu "Ajax Chat". Mój problem polega na tym że nie wiem gdzie wstawić kod, aby chat znajdował się na głównej stronie forum. Moja znajomość php jest minimalna, więc proszę o wyrozumiałość.

Aby chat pojawił się na stronie trzeba gdzieś wpisać te kody, ale ja nie wiem gdzie:

Kod: Zaznacz cały

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', './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.


2. Shoutbox output
------------------

Display the shoutbox content using the shoutbox function:

<div style="width:200px;"><?php echo getShoutBoxContent(); ?></div>

Re: Ajax Chat na stronie głównej forum ?

: 02 września 2009, 20:12
autor: huber2t
Podaj link do tego chata

Re: Ajax Chat na stronie głównej forum ?

: 03 września 2009, 07:04
autor: Baki
Link do chatu
http://www.bam.boo.pl/chat/index.php
Link do strony:
http://www.bam.boo.pl

Wstawiłem chat na stronę ale przez kod <irframe>, więc to rozwiązanie na krótką metę, bo chat działa z opóźnieniem, więc dalej potrzebuję pomocy.