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, the result will be a full template integration that can be applied into any WP theme:
phpBB WordPress template integration iframe
then use like this:
1 |
[w3allphpbbiframe wp_page_name="board" wp_page_iframe_top_gap="300"] |
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:
1 |
[w3allphpbbiframe phpbb_default_url="https://www.axew3.com/w3/forums/viewforum.php?f=2" wp_page_name="board" wp_page_iframe_top_gap="300"] |
but it can be any other phpBB link like the ucp page used into another etc
1 |
[w3allphpbbiframe phpbb_default_url="https://www.axew3.com/w3/forums/viewtopic.php?f=2&t=1670&p=5509#p5509" wp_page_name="secrets"] |
it is possible to use multiple shortcode(s) into different contests/pages/posts
It is mandatory to set WP page-names where the shortcode will be added, into related shortcode option field on plugin admin page, or the shortcode will not fire
security_token (since 2.5.9>) param (that can be omitted) refer to a secret token that can be used to restrict the use of the iframe shortcode only to certain users, when there are more roles allowed to create posts or pages. If this option is set (not empty) the shortcode will be parsed only when the token exist and will match. To add the security secret token into the iframe shortcodes, add it like this:
security_token="MySecretToken"
assuming that into related option field on plugin admin, MySecretToken is the token that had set
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 created using related option on plugin admin)
Note important: 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 after others header meta tags add the follow:
1 |
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> |
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>)
1 |
[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"] |