WordPress and Buddypress phpBB profile fields integration

NOTE x Buddypress profile fields integration: IT IS MANDATORY that the User Groups option on
WP admin -> Settings -> Buddypress
is active option!
NOTE x Buddypress: phpBB 3.2 or > required.

Note: Buddypress avatar integration option work in another way by others profile fields (more below explained) so is possible to activate the Buddypress avatar integration option without activating the Buddypress profile fields integration option.

How the WordPress + phpBB or WordPress + phpBB + Buddypress profile fields integration work:

On WordPress + Buddypress,  it’s required that default phpBB profile fields  exists as they are into a default phpBB install, while in the case of WordPress default without Buddypress it is not required: if phpBB profile fields mismatch from default, no update will be executed, EXCEPT for email and password fields (updated in any case). By the way, into a default WordPress there is only another field of interest on user’s profile, that’s site URL.

Remember that in the case phpBB profile fields aren’t the same like into a default phpBB install, no update will be done on phpBB profile fields (EXCEPT for email and password) when profile update will be executed in WordPress side.

The how to resolve and check about this, can be done reading this post:
WP_w3all phpBB integration and phpBB PROFILE FIELDS

The following is ONLY if Buddypress installed in WordPress and Buddypress integration option activated:

If on Buddypress, the WP_w3all feature about integration of Profile Fields can be activated on WP_w3all config.
If you choose to activate this option, check that phpBB profiles fields matches a phpBB default install configuration ( WP_w3all phpBB integration and phpBB PROFILE FIELDS  ), so will be also necessary to name these fields in Buddypress as explained in this procedure:

any custom field can be added into Buddypress, but only default phpBB default profile fields are synchronized and updated between phpBB and  WP Buddypress, and only if these Profile Fields in Buddypress are named as explained here below. You can add any profile field in Buddypress. But only these that match phpBB as explained below are synchronized/updated.
To have Buddypress integrated  about profile fields and synchronized with phpBB profile fields, phpBB profile fields need to be AS are ON A DEFAULT phpBB installation (as the code is), plus it is required to name these Profile Fields Names in Buddypress in this way:

Buddypress and phpBB default fields integration how to

In Buddypress, is possible to name any field as more like, but if it need to be updated also in phpBB and vice versa, the field name shown to the user, need to contain:

for youtube, the word youtube (lower or capital or both mixed letters, also into a phrase)
for facebook, the word facebook (lower or capital or both mixed letters, also into a phrase)
for icq, the word icq (lower or capital or both mixed letters, also into a phrase)
for skype, the word skype (lower or capital or both mixed letters, also into a phrase)
for twitter, the word twitter (lower or capital or both mixed letters, also into a phrase)
for googleplus, the word google (lower or capital or both mixed letters, into a phrase also (just google, so it can be used for any google service, and not just googleplus: so for gmail may could be used Google gmail))
for yahoo, the word yahoo (lower or capital or both mixed letters, also into a phrase)
for aol, the word aol (lower or capital or both mixed letters, also into a phrase)

So it is important to not repeat these words using as Profile Fields Names on Buddypress some word that is already used to detect another field name (or one of the others 4 fields below).

This can work very fine until the name of the field is about services, because normally these are named in any language the same, while remaining 4 (four) default phpBB profile fields, which are: occupation, interests, location, website can be differently named: in Italian the Eng word occupation is written occupazione, in Dutch it is bezetting etc etc.

For those 4 fields, IT IS REQUIRED that these Profile Fields Names named in Buddypress as single word, or changed to fit your language or different language or phrase or word, as explained more below.

For occupation, the word occupation, lower or capital or both mixed letters, or anyone of the words in the following array:

for interests, the word interests, lower or capital or both mixed letters, or anyone of the words in the following array:

for location, the word location, lower or capital or both mixed letters, or any of the words in the following array:

for website, the word website, lower or capital or both mixed letters, or any of the words in the following array:

as is easy to understand, these arrays for these four BP profile fields names, contains pairs of values:
“language” => “translated word/or phrase”

in these arrays,  is possible to add any other language, OR, you can also choose to modify the translation of some of the Profile Field Names into something different, like for example:
“en” => “website”
could be changed into (use EVER lower case letters here!):
“en” => “your web space”
so as Profile Field name in Buddypress, we’ll set for the website field name:
Your Web Space OR Your web space, or any other mixed lower/capital letters, but the phrase NEED TO BE THE SAME as it is set on the related array.

These arrays can be added into the custom WP_w3all phpBB config.php file, or root phpBB config.php if you use it, so on plugin update nothing will be lost in case of custom additions or modifications, maybe due to addition of your language, or translated phrase/word change.
To do this, open your wp_w3all custom phpBB config.php file (or phpBB root config.php file if you use it) and add the follow (or what for you needed) just below all others existent code lines:

Edit any of those adding custom language for Buddypress profile fields names, that you’ll use to name the related Buddypress profile field. Memo that all added values in these arrays need to be LOWER CASE.

As example, assume we need to add for the occupation field a language like Icelandic, that translate the word occupation in starf: then we’ll go to modify the array $w3_bpl_profile_occupation adding what needed just in this way:

As you can see, it has been added to the array $w3_bpl_profile_occupation the value
“icelandic” => “starf”,

NOTE how it is not important the first value “icelandic” that could be also setup with any other word (if isn’t already used as key for another value in the same array):  the important is the word starf
added as LOWER CASE, that you’ll use as Buddypress Profile Field  Name you’ll dedicate to the occupation field (and that will be recognized and synchronized also in phpBB). So you can use as field name in Buddypress Starf, or StarF, or any mixed lower/capital letters. Remember for these four fields that you can name these Fields Names in Buddypress as lower or capital or both mixed letters, but exactly like the phrase or word as is the value in one of these arrays.

WP_w3all phpBB integration and phpBB profile fields

Original post, shortcoded here is at this URL:
https://www.axew3.com/w3/forums/viewtopic.php?f=13&t=573&p=2300#p2300

About WP_w3all and Profile Fields integration

The WP_w3all integration between WordPress and phpBB, to be fully compatible without any change into his default queries (code), require that profile fields in phpBB are the same as these are into a default phpBB install. If not:

On a default WordPress install (no Buddypress) from WP_w3all 1.7.5, if phpBB profile fields not match the default install fields list, no error is thrown when user update his profile in WordPress, but no updates are done in phpBB except for email and password. So in this case there is no profile fields integration when update is done in WP side for others phpBB profile fields, except for email and password. On a default WordPress install by the way, unique other profile field that can really interest is the user's URL. It will not be updated in phpBB (when update is done via WP) if default number of phpBB profile fields on db mismatch or fields aren't named as a default phpBB install.
This may will be fixed on next version(s).

On WP + Buddypress, if on WP_w3all you go to activate Synchronize Buddypress/phpBB user's profile fields option, then you need to have the phpBB default Profile Fields configuration on phpBB. This is explained in this following procedure:

suppose that on phpBB, one of the default profile fields, let say the Website profile field for example, has been removed in
phpBB ACP -> Users and Groups Tab -> Custom profile fields
On updating user profile in WP, php return an error that +- will look like this: WordPress database error: [Unknown column 'pf_phpbb_website' in 'field list'] UPDATE phpbb_profile_fields_data SET pf_phpbb_website = 'http://php.net/' WHERE user_id = '2' Or suppose you have add one or more custom phpBB profile fields. Also in this case the WP_w3all plugin will return an error similar to the above.
The plugin integration of Buddypress fields with phpBB, as is at moment of this post, require that profile fields in phpBB are the same as these are into a default phpBB install.

If you have add custom (or removed) profile fields in phpBB than the default phpBB install, solutions are only two:

1) Eliminate custom profile fields in phpBB ACP, re-adding needed default fields if you deleted one or some of these, and/or eliminating what added as custom profile fields, if you have not delete any of default profile fields but only added. Follow with this procedure to resolve.

2) Directly edit the plugin queries code to match custom phpBB profile columns on DB. If necessary some help, post a topic on appropriate forum, i will be glad to help understand whenever necessary, if someone want resolve some issue in short. On next versions, the code about profile fields queries will be unified, and all will result more easy and comfortable to customize for any more advanced use of it. At moment of this post, there are some points (queries that are all the same), that need to be edited to match a non default phpBB install, profile fields configuration.

Procedure to reset to a default phpBB profile fields configuration, as it is when phpBB is installed.

phpBB 3.2 > profile fields

On phpBB 3.2 default profile fields are as follow:

phpbb_location, phpbb_website, phpbb_interests, phpbb_occupation, phpbb_aol, phpbb_icq, phpbb_yahoo, phpbb_facebook, phpbb_twitter, phpbb_skype, phpbb_youtube, phpbb_googleplus

On phpBB 3.1 < there is one more by default:
phpbb_wlm

which are referring to: location, website, interests, occupation, aol, icq ... etc profile fields, as you can imagine.

If there are fields you have add that aren't in the above list, and you have not delete any of these default phpBB profile fields, just remove custom fields you've add, and all is done.
If you need to recreate some of these, after you have delete added customs profiles fields, go to recreate these missed default fields in this way:

Open phpBB ACP -> Users and Groups Tab -> Custom profile fields
assuming for example we need to recreate the Website profile field, which is an URL (Link) field type, we'll go to recreate it with same default name for the field in the database, as was on default.
Before to click on Create new field button, choose from the options menu, right on the left of the button, the option URL (Link), than click Create new field button.
The page Add profile field display now.
There are various options to setup, but what is important and that need to be setup precisely with correct phpBB default value is the:

Field identification: The field identification is a name to identify the profile field within the database and the templates.
In this case, as Field identification value we'll put phpbb_website . Setup all the rest as you prefer.
Than click on button Profile type specific options
Than click on button Language specific options
Than click save.

Repeat these steps for each field you need to recreate, choosing the field type you need to recreate, following this list hint:

Field identification -> phpbb_location -> Single text field
Field identification -> phpbb_website -> URL (Link)
Field identification -> phpbb_interests -> Textarea
Field identification -> phpbb_occupation -> Textarea
Field identification -> phpbb_aol -> Single text field
Field identification -> phpbb_icq -> Single text field
Field identification -> phpbb_yahoo -> Single text field
Field identification -> phpbb_facebook -> Single text field
Field identification -> phpbb_twitter -> Single text field
Field identification -> phpbb_skype -> Single text field
Field identification -> phpbb_youtube -> Single text field
Field identification -> phpbb_googleplus -> Google+


phpBB 3.1< contain by default one field more (about Windows live messenger) that is the follow:

Field identification -> phpbb_wlm -> Single text field