Topic: AJAX Chat integration errors
I've installed PunBB, and it's working great. Then I wanted to add AJAX Chat 0.8.3 punbb-version... and that doesn't work.
On index.php in the chat-folder I get "This page contains the following errors:
error on line 2 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error."
Looking at the coding on the page I get this:
<br />
<b>Fatal error</b>: Call to a member function escape() on a non-object in <b>/home/stedri/public_html/punbb/chat/lib/class/CustomAJAXChat.php</b> on line <b>113</b><br />
The line it refers to is part of this function:
function &getChannels() {
if($this->_channels === null) {
global $db,$pun_user;
$this->_channels = array();
// Get valid PunBB forums:
$sql = 'SELECT
id,
forum_name
FROM
'.$db->prefix.'forums AS f
LEFT JOIN
'.$db->prefix.'forum_perms AS fp
ON
(fp.forum_id=f.id AND fp.group_id=\''.$db->escape($pun_user['g_id']).'\') //<----This is line 113
WHERE
(fp.read_forum IS NULL OR fp.read_forum=1);';
$result = $db->query($sql);
$defaultChannelFound = false;
while ($row = $db->fetch_assoc($result)) {
// Check if we have to limit the available channels:
if($this->getConfig('limitChannelList') && !in_array($row['id'], $this->getConfig('limitChannelList'))) {
continue;
}
$forumName = $this->trimChannelName($row['forum_name']);
$this->_channels[$forumName] = $row['id'];
if(!$defaultChannelFound && $row['id'] == $this->getConfig('defaultChannelID')) {
$defaultChannelFound = true;
}
}
$db->free_result($result);
if(!$defaultChannelFound) {
// Add the default channel as first array element to the channel list:
$this->_channels = array_merge(
array(
$this->trimChannelName($this->getConfig('defaultChannelName'))=>$this->getConfig('defaultChannelID')
),
$this->_channels
);
}
}
return $this->_channels;
}
Please help me figure this out. If you need more info, please let me know.