Hello, I am currently using Blueimp's Ajax Chat. I would like to place some PHP codes into my Tinyportal PHP block to show my members how many chatters are currently chatting. Thanks in advance for your help.
Quote from Blueimp:
Lainaa
Currently I don't have time to add those howtos myself.
Maybe you'll find an experience mod author on the SMF forums who can tell you where to put custom PHP code so you can use it for the template files of your forum.
The code used to access AJAX Chat will always be the same, no matter which forum software you use:
function getChatInterface() {
static $ajaxChat;
if(!$ajaxChat) {
// 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 chat interface:
$ajaxChat = new CustomAJAXChatInterface();
}
}
return $ajaxChat;
}
function getChatOnlineUsers() {
return ($chatInterface = getChatInterface()) ? $chatInterface->getOnlineUsers() : array();
}
function getChatOnlineUserIDs() {
return ($chatInterface = getChatInterface()) ? $chatInterface->getOnlineUserIDs() : array();
}
Hi vno
You might already know this but just for saying I will tell anyway. Did you open the necessary blok in PHP/Script mode.
Because when you open a block in TP Block manager it asks you what kind of block you need. If you choose PHP it would help. If this does not help try java/script block.
Sorry if you already know these.
Good Luck.
Thanks for the reply, bro.
But apparently these *functions have to go somewhere else... I think... place them into *$Source/load.php???
Then use a php block to *echo the info. Heck I don't know...(hehe).
But anyway, I did try to place the above codes using both scriptbox and php blocks, they don't work that way, bro. :)
Do those functions already exist in a file?
If they do you just need to include the file and call the function.
Lainaus käyttäjältä: SleePy - joulukuu 13, 2007, 12:41:30 IP
Do those functions already exist in a file?
If they do you just need to include the file and call the function.
how can w make that?