phpBB WordPress template integration (iframe v5)

V5 version (for cool people)

PLUGIN VERSION 2.7.4>

PAGE HELP – JS code – updated on 7 Dec 2023
(related addons/page-forum.phpupdated on 7 Dec 2023)

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

wp_w3all responsive iframe procedure

WordPress phpBB iframe template integration

UPDATE PROCEDURE: rebuild page-forum.php (or whatever named) 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 also update the iframeResizer.contentWindow.min.js and iframeResizer.contentWindow.map files added into phpBB root, with news updated files you’ll find into /wp-content/plugins/wp-w3all-phpbb-integration/addons/resizer folder (this step is not always 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 required values) with the new v5 code here below. Do not forget to rebuild phpBB template to make phpBB template modifications take effect, and may cleanup phpBB cache.

To do an awesome Template integration by Shortcode, that’s compatible with any WP theme, you have to add the same code as more below int this page explained, into the overall_header and overall_footer phpBB files, and then read here:

NOTE – relevant files: page-forum(or whatever you named it).php into your active WP template folder, while if using the awesome phpBB iframe shortcode the  file is /wp-content/plugins/wp-w3all-phpbb-integration/views/wp_w3all_phpbb_iframe_short.php)

WP_w3all template integration steps

Build/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, 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), then 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 the w3allAllowDomain var value to fit your WP URL.
Now check the other line to change:

change value on this line that need 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 that (if) you may changed it into the 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 (together with the file iframeResizer.contentWindow.map). 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 template files modifications do not affect. 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 phpBB into the WP page: then after tested that all work fine, return to ACP, and reset to NO and save. This step is needed to load/rebuild template modifications in phpBB if there are, 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 default w3 value of the line:

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

Reset to No the Recompile phpBB template option after some test. So before to follow READ NEXT IMPORTANT NOTE

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.

if the iframe do not display and you get mixed insecure content on console, you have to fix it doing this: open your WP header.php template file, and may just before others header meta tags add the follow:

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">

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 be redirected to the WP page forum URL. But you can open the page-forum to see the iframed result in the while. Remember that to apply template modifications, phpBB require to recompile templates files.

NOTE: if the iframe still do not display correctly:

Iframe height do not resize to match my theme! (how to change heightCalculationMethod)

If using the Awesome iframe template integration via shortcode, relevant file to look into is:

/wp-content/plugins/wp-w3all-phpbb-integration/views/wp_w3all_phpbb_iframe_short.php

Check related shortcode page to know more about customization.

Enjoy your awesome template integration!

Appreciations: https://www.paypal.com/paypalme/alessionanni/

© 2023 axew3.com

Iframe resize library by: https://github.com/davidjbradshaw/iframe-resizer

phpBB WordPress template integration (iframe v4)

v4 version (for cool people)

FROM 2.1.1 USE V5 code: https://www.axew3.com/w3/2020/01/phpbb-wordpress-template-integration-iframe-v5/

OLD CODE: cool people moved to V5

FROM 2.1.1 USE V5 code: https://www.axew3.com/w3/2020/01/phpbb-wordpress-template-integration-iframe-v5/

SINCE 2.1.1 the following code, even if still working with his related page-forum (linked below) into any plugin version, is now obsolete.

PAGE HELP – JS code – UPDATED on 15 Gen 2020
(related addons/page-forum.phpupdated on 14 Gen 2020)

wp-w3all-phpbb-integration/tags/2.1.0/addons/page-forum.php

wp_w3all plugin 1.9.9 until 2.1.0

phpBB SEO mods compatible – (READ ALL this page)

wp_w3all responsive iframe procedure

WordPress phpBB iframe template integration

MEMO: to update to latest v4 code, you’ll need 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 need to update also the iframeResizer.contentWindow.min.js file you added into phpBB root, with the new one you find into /wp-content/plugins/wp-w3all-phpbb-integration/addons/resizer folder. Done this, substitute the phpBB overall_header.html and overall_footer.html code (re-adding needed values) with the new v4 code here below. Do not forget to rebuild phpBB template to make phpBB template modifications take effect.

 Domain/subdomains installations it’s REQUIRED to read this: How to Domain/subdomain iframe template integration

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 localhost to fit your domain name (example axew3.com)
do NOT add http(s):// OR the point in front nor 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
(MANDATORY!) or resizer won’t work
now check the other line to change:

change value
https://localhost/wp53/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!

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 through ftp on the phpBB root folder (or copy/paste), the file
iframeResizer.contentWindow.min.js
that is contained inside 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

The new V4 w3all iframe code do not use anymore htaccess to force redirects, but use pure Javascript (reload) code, that as you may imagine, lead to some different result: you’ll not have to edit phpBB notification links on phpBB notification files as on V1 or V2 code, to force users redirect to iframe when they click (for example) on notification email link or some other forum’s link. But in this case, any user except bots, will be redirected (as code is, but it can be easily changed to assume different behaviors, may excluding admins or moderators etc) to the WP iframed page, if the forum accessed via real phpBB url.

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 just immediately after this code (or by the way, just before the closing tag </head>)

add the following code:

On added code, change URL on the line where (line 3):

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

All working!?

Reset to No the Recompile phpBB template option, here we go!

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:

P.s – whenever you want: to get the iframe responsive for ACP phpBB admin panel, read this post. My (personal) suggestion is to stop here and try to use the integration leaving ACP out of iframe joke. If by the way you want to follow, before to apply then you’ll have to little change the above code for overall_footer.html and overall_header.html in this way:

on code for overall_footer.html remove this part:

on code for overall_header.html remove this part:

change into:

* For domain/subdomain installations
READ THIS HOW TO:
How to Domain/subdomain iframe template integration

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

phpBB WordPress template integration (iframe v2)

See  NEW v3 phpBB WordPress template integration code

v2 version (OBSOLETE)

See  NEW v3 phpBB WordPress template integration code

PAGE HELP and JS code – UPDATED on 21 Dec 2018
(related views/page-forum.phpupdated on 26 Sep 2018)

you need to use this version of page-forum.php for this javascript code:
/tags/1.9.3/addons/page-forum.php

wp_w3all responsive iframe procedure

After you’ve built/created the WP forum template page via
WP_w3all phpBB embedded on WordPress Template
option 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:

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 lines numbers column on copied code):

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

change axew3.com to fit your domain name (example axew3.com)
do NOT add http(s):// OR the point in front nor 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
(MANDATORY!) or resizer won’t work
now check the other line to change:

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

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 through ftp on the phpBB root folder (or copy/paste), the file
iframeResizer.contentWindow.min.js
that is contained inside 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. So return to ACP and reset to NO, save. This step is needed one time 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.

How to update to latest iframe js code and page-forum.php?

Update the plugin (or download plugin and copy files by /resizer folder)
so files inside folder
/wp-content/plugins/wp-w3all-phpbb-integration/addons/resizer
results updated (or do it manually substituting these files with latest released https://github.com/davidjbradshaw/iframe-resizer)
so substitute/replace the file you added into phpBB root folder with latest iframeResizer.contentWindow.min.js
copy it from
/wp-content/plugins/wp-w3all-phpbb-integration/addons/resizer
folder and replace in phpBB root folder.

Replace the old code added into phpBB overall_footer.html file with the new one above into this page, take care to setup on it needed values as now  required.

Remember to rebuild phpBB template after these steps to let changes take effect.

Now rebuild the page forum in WP w3all admin page, or manually copy the new page-forum.php version contained on folder
/wp-content/plugins/wp-w3all-phpbb-integration/addons
and paste it into your WordPress template folder, renaming it as needed, so for example page-board.php if you setted up board for the forum page name on wp_w3all admin page.

Done.

Note: if you want a custom page-forum, just open the page-forum.php (or whatever you named it) and read inline hints inside. It is so easy to create a custom page forum (for example with two columns etc). If any help more. just post on help forums here at axew3.com or at wordpress.org.



If you want phpBB email notification links to point to iframe, follow this step about htaccess:

phpBB htaccess for phpBB notification email to point WP forum page (1.6.9>)

to activate the rewrite right click/copy links on iframe, to point to iframe, activate the related code removing the two lines:

/* remove this line to activate htaccess trick
and
*/ //remove this line to activate htaccess trick

NOTE: to get the iframe to be responsive for ACP phpBB admin panel, read this post.