The (awesome) iframe template integration using shortcode

WordPress phpBB template integration

check all others shortcodes listed under the “common how to” section

NOTE that required settings of this shortcode resides under the WP_w3all Preferences menu

To use the w3allphpbbiframe shortcode it is required to apply into the phpBB template files overall_header.html and overall_footer.html the same javascript code and procedure as it is for the page-forum, and the result will be a full template integration that can be applied into any WP theme:

phpBB WordPress template integration iframe

NOTE that it is Mandatoryto set the WP page-names where the shortcode will be added, into the related shortcode option field, on the integration plugin admin page, or the shortcode will not fire!

then use like this:

wp_page_name param refer to the page/post name/slug where the shortcode will be added (see hint below about this param if omitted*)

wp_page_iframe_top_gap param refer to (in pixel) the position where the WP parent page will scroll to by default. If omitted value will be 0

url_push (since 2.5.9>) param if omitted is set to YES, that mean when links are clicked into the phpBB iframed, the URL will be pushed into the browser’s address bar. If you want to avoid this behavior, use/add this param like this into the shortcode: url_push="no"

note that the URL push is ever avoided when the shortcode is used into the homepage and should in several more conditions. In short words, in all these situations where, when if the URL is pushed into the parent address bar, it cause/lead to a WordPress page NOT found, in the case there is an intentionally browser’s page reload (because the pushed URL is an URL that WP will not found)

phpbb_default_url (since 2.5.7>) param (that can be omitted) refer to any phpBB URL where the iframe will be opened by default, so the above become something like this, if for example we want to display into a WP post the phpBB, that should open by default into a precise forum topic/post/page:

but it can be any other phpBB link like the ucp page used into another etc

it is possible to use multiple shortcode(s) into different contests/pages/posts

Again: NOTE that it is Mandatoryto set the WP page-names where the shortcode will be added, into the related shortcode option field, on the integration plugin admin page, or the shortcode will not fire!See Option:

The (awesome) iframe template integration using shortcode

scroll_default (since 2.6.0>) param if omitted is set to YES by default. To avoid the page scroll behavior set it to no:

scroll_default="no"

To edit some css/html output or something else if required, relevant files to look into are:

/wp-content/plugins/wp-w3all-phpbb-integration/common/wp_phpbb_iframe_shortcode.php

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

*Note wp_page_name: if using Plain permalinks, for example the page name for a post would be p=45 or if it is a page page_id=12

*Note also that the shortcode param wp_page_namecan be omitted if you created page-forum using the (other way) page-forum available iframe template integration: so that the loaded URL into the browser’s address bar when links clicked into iframe, will be the one set into the overall_header.html and overall_footer.html js added code (that so may point to another post or page where another shortcode has been added, or to the default page-forum if it has been created using related option on plugin admin)

Note important: if the iframe do not display and you get mixed insecure content on browser’s console, you have to fix it doing this:

open your WP header.php template file, and may just after others header meta tags add the follow:

That’s all here, follow instructions into the plugin admin page where there is iframe template integration using shortcode related option. Enjoy!

One applied right here on the post (below), but also see another simple example here: https://www.axew3.com/w3/board/

Advanced hint: this shortcode with little modifications could be easily used to display any iframed page, also cross domain.

Here it has been added the iframe using the shortcode with param phpbb_default_url set to open a specified phpBB post and with scroll_default set to no (since 2.6.0>)

[w3allphpbbiframe url_push=”no” phpbb_default_url=”https://www.axew3.com/w3/forums/viewtopic.php?t=774″ wp_page_name=”the-awesome-iframe-template-integration-using-shortcode” scroll_default=”no”]

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.