WordPress Shortcode: phpBB posts into WP post

WP_w3all 1.7.4 or >

see also:
WordPress phpBB Latest phpBB Topics shortcode how to
Latest phpBB Topics by specific forums ids shortcode how to

and all others listed under the “common how” to section

phpBB posts – WP post shortcode how to

To add a WP_w3all shortcode, and display a phpBB post into a WordPress post, you need to choose a phpBB Post ID (note: post ID NOT Topic ID) to display, and add it into WordPress post, like this:

Change the value 1202 with the post ID you need to display.
( POST ID NOT TOPIC ID )

If you want display the post as plain text (so the bbcode will be removed from the output) use:

The simple bbcode parser function, display all default bbcode tags, excluded flash, attachments and email, check the list on this phpBB help page, phpBB bbcode how to
which are:

[b] [u] [i]  [list] (all lists type) [size] [color] [url] [image] [code]

added: [media] bbcode parsing (video etc embed)
useful if in phpBB is installed the media embed  mod.

Note: on this phpBB installation, is not installed the phpBB Media Embed mod to display media/video into phpBB posts,  by the way, adding the [media] bbcode into a phpBB post like this:

in this case the [media] bbcode into the real phpBB post will not be parsed (because  the Media Embed mod has not been installed in phpBB) but will be parsed into the WP post, because recognized and parsed by the WP_w3all plugin code.

It can be considered as 1.0 version, that work quite fine until bbcode tags structure is respected.

Here an example for a phpBB postID 2249
which you can see in phpBB at this link: https://www.axew3.com/w3/forums/viewtopic.php?f=13&t=566&p=2249#p2249

the shortcode used into this WP post to display the phpBB postID 2249, with bbcode formatted, will be this:

Shortcode output for post id 2249 is right here:

This is huge red text
so i want this text bold,
and after i like to display a piece of code: <?php function test() { $foo = "local variable"; echo '$foo in global scope: ' . $GLOBALS["foo"] . "\n"; echo '$foo in current scope: ' . $foo . "\n"; } $foo = "Example content"; test(); ?> then i want display a big test but without colorize it:
WoW! i like it ...
and i hev some list to display:
  • The first possible answer
  • The second possible answer
  • The third possible answer
in different format
  1. The first possible answer
  2. The second possible answer
  3. The third possible answer
and i want underline text
or quoted text:
una canzone per te
so a nice image:

then more strange bad code: <test />$find = array( '~\[img\].*?\[/img\]~si', // if there links/text for the image elsewhere, remove. Done above '~(^(\r\n|\r|\n))|^\s*$~m', ......... ); an url with text
Visit phpBB!
and an url
https://www.wordpress.org/
and more code for bbcode parsing: // partial bbcode regex $find = array( '~\[b\](.*?)\[/b\]~usi', '~\[i\](.*?)\[/i\]~usi', '~\[u\](.*?)\[/u\]~usi', '~\[quote\](.*?)\[/quote\]~usi', '~\[size=(.*?)\](.*?)\[/size\]~usi', ); and an image link also:



NOTE: on this phpBB example is not installed the phpBB Media Embed mod, to display video into phpBB posts, but if i add this bbcode into this phpBB post like this:

it will not be parsed into this phpBB post, because the mod has not been installed in phpBB, but will be parsed into the WP post because recognized and parsed by the WP_w3all plugin code.

you cannot add, expecting it will be parsed: an attachment, flash or email bbcode tag.
see the result of this post parsed into a WordPress post via Shortcode here: https://www.axew3.com/w3/2017/07/wordpress-shortcode-phpbb-posts-into-wp-post/

you need a more improved version of the function that do this? email me here: me@you.us
As you see was not so important to add email parsing .... (what?)

Cheers to all cool people!

WP_w3all for WordPress MS MU (Multisite, Multiuser network installations)

To configure WP_w3all on WordPress MS MU please read all the follow:

WP_w3ll plugin from 1.7.0 – WordPress MU MS  . The plugin can be also network activated, but the linked phpBB on each subsite, need to be the same (same path and same url setting value). If plugin is network activated, it is mandatory that the sub admin or super admin, setup/configure  into (each) subsite the same config of the main site for the integration plugin, because if not, when an user login into a subsite where the plugin is not configured, the phpBB cookie will not be released, and when same logged user visit the main site or another subsite where the plugin run instead configured, the user will be logged out. Registered phpBB users are added as users only into the FIRST WP site (or subsite) where users will login or that they will visits while coming already logged in into phpBB. *But you could use a plugin to add coming phpBB logged users, into each or just few WordPress site/subsites they visits, see more below.

NOTE: from 1.9.0 patched at date of this post ( or from 1.9.0 > ) it is NOT more necessary to execute this step editing the wp-config.php file
but check an hint and a warning more for WP mums installations more below on this same post.

OPEN wp-config.php file:

search for line (value wp_ can be maybe different):

immediately after ADD:

 

BEWARE that if a different phpBB is linked on subsites, the integration in this state lead to unpredictable results! … in true it is very predictable what can happen, but really long to explain and too hard for my Eng! In short, it is NOT possible to link a different phpBB into WP network subsites with actual code.
Setup into sub-sites, if the plugin is network activated, same path and url in WP_w3all config, with same values of main site.

*Hint: you could use a plugin to add coming phpBB logged users, into each WordPress they visits, or just to few, and with several different features:  search for Join My Multisite plugin at WordPress plugins directory.

NOTE: WP_w3all phpBB integration plugin when an user is deleted in WordPress (so it become deactivated in phpBB, and then you may go to delete this user in phpBB) also clean up from signup table in WordPress this user. This is necessary for compatibility (as the code is) with phpBB integration to avoid that another user register with same email into phpBB (if you allow users to register also on phpBB side, and you have also deleted this user also in phpBB) while the user has been deleted in WP, but his email/username remain stored into WP database signups table for some more time.

WP_w3all overall_footer.html for iframe JS/Ajax: PM on address bar and right click/copy links

OLD OBSOLETE

follow the new iframe v3 template procedure

OLD OBSOLETE

Since 1.7.2, follow iframe  instructions installation:

Embed phpBB into WordPress template:iframe responsive how to

WP_w3all .htaccess and Javascript for phpBB: rewrite URLs to point iframe how to (Spiders friendly)

Open .htaccess file of your phpBB root folder, search for this line:

just below add the follow:

Change on lines

RewriteRule . /yourwp/index.php/forum/?%3post_id=%5%6 [R,L]

and

RewriteRule . /yourwp/index.php/forum/?%3 [R,L]

the relative iframe URL that need to point to your correct WP forum page (leave index.php in place).

To help understand, this is the correct .htaccess code for this online working example:

WP page forum URL (that contain and display the iframe in this case): https://www.axew3.com/w3/forum/

Resulting .htaccess code based on this will be:

 

To complete the redirect flow to the iframe phpBB, embedded into WP page, for phpBB email notification messages links to point to iframe follow also with these two steps (get ready files for phpBB 3.2 on bottom of this page):

For email notification links that you want to redirect to iframe forum page of WP, assuming we point to three main behaviors we are interested in, which are for example PM notifications, New posts and Topics on forum, we need to change so 3 phpBB files in this way:

open folder  your-phpBB/phpBB/notification/type

on this folder, as working example, we go to open and so modify the following files:

pm.php, post.php, topic.php

on each file, you’ll find very similar code like this (in pm.php there is only one to change, on topic.php and post.php there are 4 or 5. Do not apply this edit to the last one string on post.php and topic.php):

you should change these urls, adding iframe=true& on each line, exactly after the ? char, like this:

Ready files for phpBB 3.2 zip:
notification-pm-post-topic-x_phpbb32_ready

How are users identified when you add/transfer existent user
integration of same username/email users

Problem: i have WordPress users and I have phpbb users, they have different usernames but the same email addresses.

Solutions:

user A into phpBB with email C
user B into WP with email C

user A into phpBB come to try to login WP: NOT added can’t login WP side.

If you use the transfer process of WP users into phpBB:

user A Same above.
user B transferred into phpBB, B now can login into both phpBB and WP.
You’ll have two users into phpBB with same email, which is possible as option into phpBB.

You can also merge posts/users into one user in this way:

Change email to the user B in WP.
Login with the phpBB user A into WP, that will be added, as no same email found.
Now delete user B in WP, and retain posts assigning to A.

Result: an unique user, with all his posts on both phpBB and WP.

NOTE: This is just to give an idea on how to resolve common problems about an integration with pre existent users in phpBB that may have same email. But there are several more possibilities: in phpBB ACP there are many options to manage users and posts, and combining these and from the above, you should get the way to resolve any possible scenario.

Based on this topic: How are users identified? (when adding/transfer existent users)

 

Install phpBB WordPress domain/subdomain integration: how to hints

phpBB installed at plugins.w3tasks.com
WP installed at w3tasks.com

To install wp_w3all on a subdomain/domain i have use the custom config.php option, as we are here in subdomain installation. I’ve see it was not working about connession. It was failing because, the custom wp_w3all phpBB config.php file, was lacking the follow setting, which was REQUIRED to connect on my/this server correctly (as on plesk config setting i had set allow only from localhost connections), so:

(this my setting, check your host/port)

So, on phpBB ACP cookie setting:
i had as default phpBB cookie value:
plugins.w3tasks.com
i’ve modify it to:
.w3tasks.com
I have also set admin of phpBB with same email of WP.
NOW I’VE LOGOUT from phpBB.
SO I HAVE CLEAN COOKIES on browser, and login successfully.
All working nice.

(For security reasons by the way, should be not good practice to have an administrator named admin: commonly it should be removed and replaced by someone not so clear as one named admin, if no other security measures applied on wp).

The above suppose you have follow also steps about phpBB WordPress integration here:
http://www.axew3.com/w3/cms-plugins-scripts/wordpress-plugins-scripts-docs/wordpress-phpbb-integration/

phpBB images and .htaccess:
how to set phpBB avatars images available over all your domain

On Apache server, the default phpBB .htaccess file in phpBB/images/avatars/upload folder, by default, is setup to deny access to images files if these are requested by an external resource, or the call to images files are done outside the phpBB installation folder.

So, to get working WP_w3all avatar option, it is required to edit the default .htaccess file of phpBB that reside inside phpBB/images/avatars/upload folder, setting it to serve images for requests that are done within your domain(s) or localhost test server. You could also remove or disable the .htaccess, but you are noticed that in this case, images on this folder if linked from external sites, are accessible.

The default phpBB/images/avatars/upload/.htaccess file look like this:

so you’ll edit it, allowing instead requests that are done from your host with something like this (this first example is for localhost):

this example instead is for an online site:

on Unix/Linux systems, you may also check for correct folder chmod in case the above still not let you to get available avatars, from the phpBB avatar’s folder.

WP_w3all manual setup phpBB
config.php and path setting how to

To setup a custom phpBB config.php file and setup the relative absolute path setting to it on WP_w3all admin config page, follow these steps:

Open folder:
wp-content/plugins/wp-w3all-phpbb-integration/addons
inside you’ll find the folder:
wp-w3all-config that contain two files, config.php and .htaccess.
COPY the entire FOLDER wp-w3all-config AS IS and paste it or upload it via ftp in:
wp-content/plugins
so you’ll have:
wp-content/plugins/wp-w3all-config
with a text editor open the file config.php contained into folder
wp-content/plugins/wp-w3all-config
and follow hints inside: you just need to add values, the same as are on your phpBB root config.php file, if you do not know how to fill required fields. Remember to un-comment, removing the pre pending // chars in front the very last line on your custom config.php file, as explained on inline file hints, or even if on Wp_w3all config page the path value that need to point to this file will be correct, the plugin will not result active.
Hint: memo that you can so also deactivate the WP_w3all plugin safely any time, by opening this file and commenting out this line (or you could do it for testing purpose by setting wrong the path to this file, into WP_w3all admin config page).

Now setup the Path value on WP_w3all admin config page that need to point to this config.php file.
Example: /web/htdocs/home/wp-content/plugins/wp-w3all-config
For help on how to know/setup your correct path value, refer to this post:
How to find and set correct absolute path

WP_w3all has been installed. Remember to transfer old existent WordPress users into phpBB when integration start. This is a MANDATORY step. Configure options and widgets. Read more FAQ and hints here:
http://www.axew3.com/w3/cms-plugins-scripts/wordpress-plugins-scripts-docs/wordpress-phpbb-integration/

Embed phpBB into WordPress template:
iframe responsive how to

This is the old  iframe procedure.
New iframe procedure and code is available here:
https://www.axew3.com/w3/2018/09/wordpress-phpbb-template-embed-v3/

!!OLD OBSOLETE!! follow link above for the new v3 code and procedure!

PAGE HELP – UPDATED on 19 Sept 2018
(related views/page-forum.php – updated on 27 Sep 2017)
/trunk/addons/page-forum.php

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

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…, to complete the procedure and get the responsive iframe height for the embedded 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 the second line on added code:

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

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
YOURWP/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.



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.

If any question, use the forum here or at axew3Posted on Categories Wordpress phpBB integrationTags , , , , ,