phpBB WordPress template integration (iframe v5)

v5 version (for cool people)

PAGE HELP – JS code – updated on 01 Jul 2020
(related addons/page-forum.phpupdated on 22 Feb 2020)

wp-w3all-phpbb-integration/trunk/addons/page-forum.php

wp_w3all plugin 2.1.1 or >

phpBB SEO mods compatible – (READ ALL this page)

wp_w3all responsive iframe procedure

WordPress phpBB iframe template integration

MEMO: to update to latest code, it is required to rebuild page-forum.php (or whatever you named it) via plugin admin, OR manually substitute it into your active WP template folder, with the new one that you find/copy into /wp-content/plugins/wp-w3all-phpbb-integration/addons. You’ll may need to update also the iframeResizer.contentWindow.min.js file added into phpBB root, with the new one you find into /wp-content/plugins/wp-w3all-phpbb-integration/addons/resizer folder (this step is not ever required, but only when iframe resizer library updates, which is notified on plugin changelog when plugin released). Done this, substitute the phpBB overall_header.html and overall_footer.html code (re-adding needed values) with the new v5 code here below. Do not forget to rebuild phpBB template to make phpBB template modifications take effect.

NOTE for domains like: mydomain.co.uk – note that to fix the resizer to work fine on this kind of domains you have to open page-forum(or whatever you named it).php into your active WP template folder and search for these two lines of code, adjusting as they need to be, to match the same domain you setup into overall_footer.html code

WP_w3all template integration steps

After you built/create the WP forum template page via option
WP_w3all phpBB embedded on WordPress Template
on WP_w3all admin config page, and the blank page on WordPress Admin -> Pages -> Add New, titled the same of created wp_w3all template page, so forum or board  etc (then you’ll have into your active WordPress template folder a file named page-forum.php or page-board.php etc), to complete the procedure and get the responsive iframe height for the embedded/iframed phpBB into WordPress template page you need:

overall_footer.html code

Open with a text editor your phpBB template file overall_footer.html

and just before the closing </body> tag, add this code (do not select rows numbers on copied code):

after you pasted this code into phpBB overall_footer.html
edit following lines:

change document.domain value to fit your domain name (example axew3.com)
do NOT add http(s):// OR the point in front or anything else, just add
yourdomain.com or set it as localhost if on localhost test. If phpBB is at subdomain.domain.com, add domain.com as value, if wp is at domain.com
(MANDATORY!) or resizer won’t work
now check the other line to change:

change value
https://subdomain.w3host.com/wordpress/forum
on this line, to point to the URL of the WordPress created/named forum page (do not add final slash and change http or https as needed)
MANDATORY!

Change the w3 value of the line

to fit the value you may changed in plugin admin where option: Fancy URL query string for the WordPress page forum that embed phpBB

Finally, check this line

in the code you added (last line): this should correctly point to the iframeResizer.contentWindow.min.js file that you’ll go to add into phpBB root folder. You need to use the absolute URL (use http or https as needed, and adjust the url to fit your needs)
(MANDATORY!) or resizer won’t work

AFTER EDITED, save and load the modified overall_footer.html into your phpBB style folder, overwriting the default one, and so

load via ftp into the phpBB root folder (or copy/paste), both files
iframeResizer.contentWindow.min.js AND iframeResizer.contentWindow.map
that you find inside the folder
wp/wp-content/plugins/wp-w3all-phpbb-integration/addons/resizer

After this, phpBB require to recompile the template, or modifications to template files not affect (to overall_footer.html in this case). Open phpBB ACP, and so under:

Server Configuration -> Load settings -> Recompile stale style components set to YES and save. Load one time a phpBB full forum page. Leave as is at moment, especially if you follow adding also the code on overall_header.html (more below) to redirect any phpBB direct URL to the iframed WP page: then after tested that all work fine, return to ACP, and reset to NO and save. This step is needed to load the template modifications on phpBB (and any time you edit a phpBB template file to for modifications take effect), but this option should be ever set to NO into an online/production site to save server resources. It is normally set to yes only for testing/devel purpose or to apply modifications on phpBB templates files.

overall_header.html code

If you want phpBB email notification links or any phpBB direct url to be redirected to the wp iframed forum page follow this step:

Open with a text editor your phpBB template file overall_header.html and immediately after the closing </title> tag add the following code:

On added code, change URL on the line where:

to fit/point to the WordPress iframed forum page: DO NOT ADD final slash and setup as http or https as needed.

Change the w3 value of the line:

to fit the value you may changed in plugin admin where option: Fancy URL query string for the WordPress page forum that embed phpBB

All working!? You’re cool!

Reset to No the Recompile phpBB template option, here we go! … But before, READ NEXT NOTE and memo!

NOTE: if you need to disable/remove the overall_header.html javascript code, that do not allow (until javascript enabled on browser) to access front end real phpBB urls, forcing the redirect to the WP forum page. You can  disable javascript on browser, if you do not want to remove/disable the added js snippet into the phpBB overall_header.html file. It is also !important to remember this if in trouble with login, and recompile Stale Template option in phpBB is set to Off at this time.

For testing or for any other reason, you could also comment out the line where:

change into this:

so phpBB direct URL’s will not being redirected to the WP page forum URL. Remember that to apply template modifications, phpBB require to recompile templates files.

NOTE: if you added the code above into phpBB overall_header.html then you’ll never activate (it is not active by default) this part of the code you added into the overall_footer.html:

Refer to v2 or v1 code for htaccess old solution editing phpBB notifications files.