Integration of MyChat and phpBB3 forum
You can receive notifications about all new messages on the forum in MyChat.
- Set up a connection to MyChat Server
- Editing function_posting.php
- Specify notification recipients
- Debugging, or what to do if messages are not being sent?
1. Set up a connection to MyChat Server
Take the file template MyChatSendMessage.php (C:\Program Files\MyChat Server\doc\IntegrationAPI\phpBB3\) and set connection parameters for your MyChat Server:
Go to the directory of your forum and find the folder "includes\". Copy the file MyChatSendMessage.php to the folder.
2. Editing function_posting.php
Find a file function_posting.php in the folder "includes\" of your forum. Make a backup copy before changing it!
Find in the file code function_posting.php this line:
function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $update_message = true, $update_search_index = true)
At the function's end, after lines:
$url = (!$params) ? "{$phpbb_root_path}viewforum.$phpEx" : "{$phpbb_root_path}viewtopic.$phpEx";
$url = append_sid($url, 'f=' . $data['forum_id'] . $params) . $add_anchor;
you need to add this code:
if ($post_mode == 'reply' || $post_mode == 'post') {
include ('MyChatSendMessage.php');
MyChatSendMessage::Send($data['message'], $user->data['username'], $subject, $current_time,
generate_board_url(), $data['forum_id'], $data['topic_id'], $data['post_id'], $user->data['user_id']);
}
After all changes the code function_posting.php must look like this:
3. Specify notification recipients
In MyChat Administration, section "Tools", "Integration", you need to enable the tool "phpBB 3":
In this section, you can also configure a list of recipients so they can receive notifications about new messages on the forum.
You can specify separate people, user groups, and conference.
4. Debugging, or what to do if messages are not being sent?
If somehow messages are not being sent to the chat you need to make sure that you configured everything for the forum.
There is a debugging mode. Take the file MyChatSendMessage_test.php (C:\Program Files\MyChat Server\doc\IntegrationAPI\phpBB3\debug\) and write it to the forum folder "includes\".
In the file function_posting.php replace the line include ('MyChatSendMessage.php'); with include ('MyChatSendMessage_test.php');
After that you can see all errors in the file MyChat_errors_log.txt in the forum root folder.
Notice! Do not forget to end debugging after complete configuration. The debugging mode works in synchronous mode and slows down execution of forum scripts.
Important! In the version phpBB 3.2.2 and higher, the variable $data must be replaced with $data_ary.
Created with the Personal Edition of HelpNDoc: Effortlessly upgrade your WinHelp HLP help files to CHM with HelpNDoc