Запустил install.php, все таблички создались успешно
Законтачил чат с IPBWI /lib/custom.php
// Include custom libraries and initialization code here
require_once('../ipbwi/ipbwi.inc.php');
// Error Output
echo $ipbwi->printSystemMessages();
И непосредственно интеграция логинов: /lib/class/CustomAJAXChat.php
class CustomAJAXChat extends AJAXChat {
// Initialize custom request variables:
function initCustomRequestVars() {
global $ipbwi;
// Auto-login IPB users:
if(!$this->getRequestVar('logout') && $ipbwi->member->isLoggedIn()) {
$this->setRequestVar('login', true);
}
}
// Returns true if the userID of the logged in user is identical to the userID of the authentication system
// or the user is authenticated as guest in the chat and the authentication system
/*function revalidateUserID() {
global $ipbwi;
$m_info = $ipbwi->member->info();
if($this->getUserRole() === AJAX_CHAT_GUEST && !$ipbwi->member->isLoggedIn() || ($this->getUserID() === $m_info["id"])) {
return true;
}
return false;
}*/
// Returns an associative array containing userName, userID and userRole
// Returns null if login is invalid
function getValidLoginUserData() {
global $ipbwi;
if ($ipbwi->member->isLoggedIn()) {
$m_info = $ipbwi->member->info();
$userData = array();
$userData["userID"] = $m_info["id"];
$userData["userName"] = $this->trimUserName($m_info["members_display_name"]);
if ($ipbwi->member->isAdmin()) {
$userData["userRole"] = AJAX_CHAT_ADMIN;
} elseif ($ipbwi->member->isSuperMod()) {
$userData["userRole"] = AJAX_CHAT_USER;
} else {
$userData["userRole"] = AJAX_CHAT_USER;
}
return $userData;
} else {
// Guest users
return $this->getGuestUser();
}
}
}
// Store the channels the current user has access to
// Make sure channel names don't contain any whitespace
function &getChannels() {
if($this->_channels === null) {
$this->_channels = array();
$allChannels = $this->getAllChannels();
// Get the channels, the user has access to:
if($this->getUserRole() != AJAX_CHAT_GUEST) {
$validChannels = $allChannels;
}
// Add the valid channels to the channel list (the defaultChannelID is always valid):
foreach($this->getAllChannels() as $key=>$value) {
// Check if we have to limit the available channels:
if($this->getConfig('limitChannelList') && !in_array($value, $this->getConfig('limitChannelList'))) {
continue;
}
if(in_array($value, $validChannels) || $value == $this->getConfig('defaultChannelID')) {
$this->_channels[$key] = $value;
}
}
}
return $this->_channels;
}
// Store all existing channels
// Make sure channel names don't contain any whitespace
function &getAllChannels() {
if($this->_allChannels === null) {
// Get all existing channels:
$customChannels = $this->getCustomChannels();
$defaultChannelFound = false;
foreach($customChannels as $key=>$value) {
$forumName = $this->trimChannelName($value);
$this->_allChannels[$forumName] = $key;
if($key == $this->getConfig('defaultChannelID')) {
$defaultChannelFound = true;
}
}
if(!$defaultChannelFound) {
// Add the default channel as first array element to the channel list:
$this->_allChannels = array_merge(
array(
$this->trimChannelName($this->getConfig('defaultChannelName'))=>$this->getConfig('defaultChannelID')
),
$this->_allChannels
);
}
}
return $this->_allChannels;
}
function &getCustomUsers() {
// List containing the registered chat users:
$users = null;
require(AJAX_CHAT_PATH.'lib/data/users.php');
return $users;
}
function &getCustomChannels() {
// List containing the custom channels:
$channels = null;
require(AJAX_CHAT_PATH.'lib/data/channels.php');
return $channels;
}
?>
В итоге сам чат работает нормально(логины проходят, пользователи определяются и могут слать сообщения).
НО: Список пользователей онлайн работает неверно, залогинившиеся пользователи в него не добавляются.
Прошу помочь кто чем может :(
Рекомендованные сообщения
Создайте аккаунт или войдите в него для комментирования
Доброго времени суток дорогие форумчане ^_^ !
Имеется проблема интеграции форума с AJAX Chat
(Выбрал по причине скорости удобства и бесплатности, а главное он нормально работает по https в отличии от многострадального IP.Chat)
Сама интеграция происходит через IPBWI, который сконфигурирован верно и работает исправно.
Чат установлен в отдельную папку в корне форума(Standalone версия)
Интеграцию делал по этому гайду
По пунктам:
/lib/custom.php
// Include custom libraries and initialization code here require_once('../ipbwi/ipbwi.inc.php'); // Error Output echo $ipbwi->printSystemMessages();/lib/class/CustomAJAXChat.php
class CustomAJAXChat extends AJAXChat { // Initialize custom request variables: function initCustomRequestVars() { global $ipbwi; // Auto-login IPB users: if(!$this->getRequestVar('logout') && $ipbwi->member->isLoggedIn()) { $this->setRequestVar('login', true); } } // Returns true if the userID of the logged in user is identical to the userID of the authentication system // or the user is authenticated as guest in the chat and the authentication system /*function revalidateUserID() { global $ipbwi; $m_info = $ipbwi->member->info(); if($this->getUserRole() === AJAX_CHAT_GUEST && !$ipbwi->member->isLoggedIn() || ($this->getUserID() === $m_info["id"])) { return true; } return false; }*/ // Returns an associative array containing userName, userID and userRole // Returns null if login is invalid function getValidLoginUserData() { global $ipbwi; if ($ipbwi->member->isLoggedIn()) { $m_info = $ipbwi->member->info(); $userData = array(); $userData["userID"] = $m_info["id"]; $userData["userName"] = $this->trimUserName($m_info["members_display_name"]); if ($ipbwi->member->isAdmin()) { $userData["userRole"] = AJAX_CHAT_ADMIN; } elseif ($ipbwi->member->isSuperMod()) { $userData["userRole"] = AJAX_CHAT_USER; } else { $userData["userRole"] = AJAX_CHAT_USER; } return $userData; } else { // Guest users return $this->getGuestUser(); } } } // Store the channels the current user has access to // Make sure channel names don't contain any whitespace function &getChannels() { if($this->_channels === null) { $this->_channels = array(); $allChannels = $this->getAllChannels(); // Get the channels, the user has access to: if($this->getUserRole() != AJAX_CHAT_GUEST) { $validChannels = $allChannels; } // Add the valid channels to the channel list (the defaultChannelID is always valid): foreach($this->getAllChannels() as $key=>$value) { // Check if we have to limit the available channels: if($this->getConfig('limitChannelList') && !in_array($value, $this->getConfig('limitChannelList'))) { continue; } if(in_array($value, $validChannels) || $value == $this->getConfig('defaultChannelID')) { $this->_channels[$key] = $value; } } } return $this->_channels; } // Store all existing channels // Make sure channel names don't contain any whitespace function &getAllChannels() { if($this->_allChannels === null) { // Get all existing channels: $customChannels = $this->getCustomChannels(); $defaultChannelFound = false; foreach($customChannels as $key=>$value) { $forumName = $this->trimChannelName($value); $this->_allChannels[$forumName] = $key; if($key == $this->getConfig('defaultChannelID')) { $defaultChannelFound = true; } } if(!$defaultChannelFound) { // Add the default channel as first array element to the channel list: $this->_allChannels = array_merge( array( $this->trimChannelName($this->getConfig('defaultChannelName'))=>$this->getConfig('defaultChannelID') ), $this->_allChannels ); } } return $this->_allChannels; } function &getCustomUsers() { // List containing the registered chat users: $users = null; require(AJAX_CHAT_PATH.'lib/data/users.php'); return $users; } function &getCustomChannels() { // List containing the custom channels: $channels = null; require(AJAX_CHAT_PATH.'lib/data/channels.php'); return $channels; } ?>В итоге сам чат работает нормально(логины проходят, пользователи определяются и могут слать сообщения).
НО: Список пользователей онлайн работает неверно, залогинившиеся пользователи в него не добавляются.
Прошу помочь кто чем может :(