apri il file includes/functions.php
incolla questo codice prima della tag di chiusura ?>
- Codice: Seleziona tutto
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();
}
cerca
- Codice: Seleziona tutto
$online_userlist .= ($online_userlist != '') ? ', ' . $user_online_link : $user_online_link;
e incolla questo codice al di sopra
- Codice: Seleziona tutto
if(in_array($row['user_id'], getChatOnlineUserIDs()))
{
$user_online_link = '<span title="* = '.strip_tags($row['username']).' is logged into the Chat">'.$user_online_link.'*</span>';
}
cerca
- Codice: Seleziona tutto
// The following assigns all _common_ variables that may be used at any point in a template.
$template->assign_vars(array(
e incolla questo codice al di sotto
- Codice: Seleziona tutto
'CHAT_LINK' => 'chat/',
'CHAT_LABEL' => 'Chat ['.count(getChatOnlineUserIDs()).']',
'CHAT_TITLE' => 'Online: '.htmlentities(implode(', ', getChatOnlineUsers()), ENT_QUOTES, 'UTF-8'),
apri il file styles/[STYLE_NAME]/template/overall_header.html
e incolla questo codice dove vuoi che compaia il link alla chat
- Codice: Seleziona tutto
<a href="{CHAT_LINK}" title="{CHAT_TITLE}">{CHAT_LABEL}</a>