go into phpmyadmin or other database tool and run this SQL
ALTER TABLE phpbb_chat ADD COLUMN forum_id mediumint(8) UNSIGNED NOT NULL DEFAULT '0' AFTER time;
ALTER TABLE phpbb_chat ADD COLUMN forum_id mediumint(8) UNSIGNED NOT NULL DEFAULT '0' AFTER time;
define('BOTS_TABLE', $table_prefix . 'bots');
define('CHAT_TABLE', $table_prefix . 'chat');
define('CHAT_SESSIONS_TABLE', $table_prefix . 'chat_sessions');
?>
// chat language for new replies and new topics
$lang = array_merge($lang, array(
'CHAT_NEW_POST' => '%1$s replied to <a href="%2$s">%3$s</a>',
'CHAT_NEW_TOPIC' => '%1$s started a new topic: <a href="%2$s">%3$s</a>',
));
unset($sql_data[POSTS_TABLE]['sql']);
insert_into_chat($subject, $data, $post_mode);
?>
/**
* Insert new posts and topics into the chat
* @param string $subject
* @param string $data
* @param string $type
*/
function insert_into_chat($subject, $data, $type)
{
global $user, $phpEx, $phpbb_root_path, $db;
if ($type == 'reply')
{
$lang = 'CHAT_NEW_POST';
}
else
{
$lang = 'CHAT_NEW_TOPIC';
}
$username = get_username_string('full', $user->data['user_id'], $user->data['username'], $user->data['user_colour']);
$url = append_sid($phpbb_root_path . 'viewtopic.' . $phpEx, 'f=' . $data['forum_id'] . '&t=' . $data['topic_id'] . '&p=' . $data['post_id'] . '#p' . $data['post_id']);
$message = sprintf($user->lang[$lang], $username, $url, $subject);
$uid = $bitfield = $options = '';
$allow_bbcode = $allow_urls = $allow_smilies = true;
generate_text_for_storage($message, $uid, $bitfield, $options, $allow_bbcode, $allow_urls, $allow_smilies);
$sql_ary = array(
'chat_id' => 1,
'user_id' => $user->data['user_id'],
'username' => $user->data['username'],
'user_colour' => $user->data['user_colour'],
'message' => $message,
'bbcode_bitfield' => $bitfield,
'bbcode_uid' => $uid,
'bbcode_options' => $options,
'time' => time(),
'forum_id' => $data['forum_id'],
);
$sql = 'INSERT INTO ' . CHAT_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
$db->sql_query($sql);
}
'CHAT_NEW_POST' => '%1$s replied to <a href="%2$s">%3$s</a>',
'CHAT_NEW_TOPIC' => '%1$s started a new topic: <a href="%2$s">%3$s</a>',
'CHAT_NEW_POST' => ' replied to <a href="%2$s">%3$s</a>',
'CHAT_NEW_TOPIC' => ' started a new topic: <a href="%2$s">%3$s</a>',