Integration with Flarum
(BlaB! AX Pro v21.07+)
Before you begin
-
You are supposed to have BlaB! AX Pro installed and running in standalone mode.
-
Make sure that BlaB! AX Pro and Flarum are installed in the same database.
-
The proper place to put BlaB! AX Pro folder is under Flarum (Flarum public folder) so that BlaB! AX Pro is able to read Flarum session cookie:
- website.com/forum/ » website.com/forum/chat/
- forum.website.com » forum.website.com/chat/
-
A common www issue: if you login to Flarum from www.website.com BlaB! AX Pro will not be able to read Flarum session cookie if loaded without www and vice-versa. If possible set relative links only. A solution with a .htaccess file for Apache - Google Search.
-
The MySQL table prefix of Flarum can be seen from phpMyAdmin. Alternatively, use Adminer which is an excellent one-file MySQL manager.
-
The easiest way to determine the name of the required login/session cookie of Flarum:
- Login to Flarum with Chrome/Chromium
- Press CTRL+SHIFT+I to open Developer tools » Network » press F5 to reload » Select the 1st URL » Cookies
- You'll have a hint what to look for in the instructions below.
- How to find a cookie name (This one is for WordPress, the process is identical): YouTube Video
-
In case you login to both: Flarum and BlaB! AX Pro your BlaB! AX Pro login is preferred! Since you are most probably logged in as SuperAdmin when you adjust settings in BlaB! AX Pro AdminCP use another browser to test the integration.
Integration
- Have you read carefully
Before you begin
above? All clear? - Go to BlaB! AX Pro AdminCP » Integration and set:
- Bulletin Board or CMS you want to integrate with: Flarum
- Session or other cookie set by your BB or CMS: flarum_session
- Flarum MySQL table prefix, probably: flarum_ or fla_ or nothing
- Review the other variables and SAVE
- With a text editor in config.php (at the bottom) set:
$fla_session_dir
- relative or absolute path to Flarum session folder$fla_avatars_dir
- relative path from chat to Flarum avatar folder
- Go to BlaB! AX Pro AdminCP » Groups and click on Delete and link groups.
- If the integration variables are set properly, and you are logged onto Flarum, you should be able to enter the chat directly with your Flarum username.
How to embed BlaB! AX Pro in Flarum
- Download SPA Companion Pack and unzip its content in the Flarum web folder.
- Open blabloader.js and set at the beginning of the file the URL of //URL-TO-FLARUM/chat/index.php
- Install the following Flarum extension HTML Head Items:
composer require ianm/html-head
and enable it. - Flarum Administration » HTML Head Items » Create:
- Description: blabloader.js
- Custom Head Item:
<script src="//URL-TO-FLARUM/blabloader.js"></script>
- Flarum Administration » HTML Head Items » Create:
- Description: blabloader.css
- Custom Head Item:
<link rel="stylesheet" href="//URL-TO-FLARUM/blabloader.css">