by axew3 » Thu Sep 07, 2017 8:19 pm
This is the last
going on log before 1.7.5 release, to fix points about Buddypress complete profile fields integration: after all will be more precisely explained on the WP_w3all plugin installation procedure (i hope, but u know about my Eng that is bad!).
By the way, all is working fine, but the fact that the code has been write to search for matches between phpBB/WPBP
Profile Fields Names, this present some aspect that need to be explained and applied, to get all working ok.
How the WPBP profile fields integration work:
1) This features have been added as option for Buddypress, so it can be activate or not on WP_w3all config (as well avatar integration option for Buddypress is option to be activated or not).
2) Any custom field can be added into WPBP: but only
default phpBB profile fields will be updated (read post above to know what are), or a manual code addition/removal will be necessary into WP_w3all queries to have the joke work.
3) In Buddypress, is possible to name any field as more like, but if it need to be updated also in phpBB,
the field name displayed to the user, need to contain:
for
youtube, the word
youtube (lower or capital or both mixed letters, into a phrase also)
for
facebook, the word
facebook (lower or capital or both mixed letters, into a phrase also)
for
icq, the word
icq (lower or capital or both mixed letters, into a phrase also)
for
skype, the word
skype (lower or capital or both mixed letters, into a phrase also)
for
twitter, the word
twitter (lower or capital or both mixed letters, into a phrase also)
for
googleplus, the word
google (lower or capital or both mixed letters, into a phrase also (just google, so it can be used for one google service we like, and not just googleplus))
for
yahoo, the word
yahoo (lower or capital or both mixed letters)
for
aol, the word
aol (lower or capital or both mixed letters)
So it is important to
not repeat and use as
Fields Names of Buddypress some word that is already used to detect another field (or 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 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 these 4 fields, IT IS REQUIRED that these Profile Fields Names are named in Buddypress as
single word like:
for
occupation, the word
occupation, lower or capital or both mixed letters, or any of the words in the following array:
Code: Select all
array(
"en" => "occupation",
"it" => "occupazione",
"fr" => "occupation",
"de" => "occupation",
"nl" => "bezetting",
"es" => "ocupacion"
);
for
interests, the word
interests, lower or capital or both mixed letters, or any of the words in the following array:
Code: Select all
array(
"en" => "interests",
"it" => "interessi",
"fr" => "interets",
"de" => "interest",
"nl" => "belangen",
"es" => "intereses"
);
for
location, the word
location, lower or capital or both mixed letters, or any of the words in the following array:
Code: Select all
array(
"en" => "location",
"it" => "locazione",
"fr" => "emplacement",
"de" => "lage",
"nl" => "plaats",
"es" => "location"
);
for
website, the word
website, lower or capital or both mixed letters, or any of the words in the following array:
Code: Select all
array(
"en" => "website",
"it" => "sito web",
"fr" => "site web",
"de" => "website",
"nl" => "website",
"es" => "sitio web"
);
as is easy to understand, these arrays for these 4 BP profile field names, contains pairs of values about
"language" => "translated word"
in these arrays,
is easy to add any other language, OR, you can also choose to modify the translation of the Profile Field Name into something different. like for example:
"en" => "website"
we could change into:
"en" => "your web space"
so as profile field name in Buddypress, we'll set for website field profile 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 on the related array).
These arrays can be added into the custom WP_w3all phpBB config.php file, so when plugin update nothing will be lost, if changed something from the default,
maybe due to addition of your language.
after this ... i stop for a moment, it is very hard to write a comprehensible Eng explaining things like this, more than code it!
Hope it is sufficient clear, but will be improved before to be published into the install help pages, when 1.7.5 will be released.
... for programmers: to get the result, it has been added two queries in WP because i've not find out any way to access to any Buddypress array containing user's profile fields data at runtime, as explained on code comments. It seem to me strange that there is no way to access to ready user's profile data provided by the BP loop, so maybe, after, some hint will help to improve, removing even this single added query! That would be amazing!
This is the last [i]going on log[/i] before 1.7.5 release, to fix points about Buddypress complete profile fields integration: after all will be more precisely explained on the WP_w3all plugin installation procedure (i hope, but u know about my Eng that is bad!).
By the way, all is working fine, but the fact that the code has been write to search for matches between phpBB/WPBP [b]Profile Fields Names[/b], this present some aspect that need to be explained and applied, to get all working ok.
How the WPBP profile fields integration work:
1) This features have been added as option for Buddypress, so it can be activate or not on WP_w3all config (as well avatar integration option for Buddypress is option to be activated or not).
2) Any custom field can be added into WPBP: but only [b]default phpBB profile fields[/b] will be updated (read post above to know what are), or a manual code addition/removal will be necessary into WP_w3all queries to have the joke work.
3) In Buddypress, is possible to name any field as more like, but if it need to be updated also in phpBB,
the field name displayed to the user, need to contain:
for [i]youtube[/i], the word [i][b]youtube[/b][/i] (lower or capital or both mixed letters, into a phrase also)
for [i]facebook[/i], the word [i][b]facebook[/b][/i] (lower or capital or both mixed letters, into a phrase also)
for [i]icq[/i], the word [i][b]icq[/b][/i] (lower or capital or both mixed letters, into a phrase also)
for [i]skype[/i], the word [i][b]skype[/b][/i] (lower or capital or both mixed letters, into a phrase also)
for [i]twitter[/i], the word [i][b]twitter[/b][/i] (lower or capital or both mixed letters, into a phrase also)
for [i]googleplus[/i], the word [i][b]google[/b][/i] (lower or capital or both mixed letters, into a phrase also (just google, so it can be used for one google service we like, and not just googleplus))
for [i]yahoo[/i], the word [i][b]yahoo[/b][/i] (lower or capital or both mixed letters)
for [i]aol[/i], the word [i][b]aol[/b][/i] (lower or capital or both mixed letters)
So it is important to [b]not repeat[/b] and use as [i]Fields Names of Buddypress[/i] some word that is already used to detect another field (or 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 four default phpBB profile fields, which are: [b]occupation, interests, location, website[/b] can be differently named: in Italian the Eng word [i]occupation[/i] is written [i]occupazione[/i], in Dutch it is [i]bezetting[/i] etc etc.
For these 4 fields, IT IS REQUIRED that these Profile Fields Names are named in Buddypress as [b]single word[/b] like:
for [i]occupation[/i], the word [i][b]occupation[/b][/i], lower or capital or both mixed letters, or any of the words in the following array:
[code]array(
"en" => "occupation",
"it" => "occupazione",
"fr" => "occupation",
"de" => "occupation",
"nl" => "bezetting",
"es" => "ocupacion"
);[/code]
for [i]interests[/i], the word [i][b]interests[/b][/i], lower or capital or both mixed letters, or any of the words in the following array:
[code]array(
"en" => "interests",
"it" => "interessi",
"fr" => "interets",
"de" => "interest",
"nl" => "belangen",
"es" => "intereses"
);[/code]
for [i]location[/i], the word [i][b]location[/b][/i], lower or capital or both mixed letters, or any of the words in the following array:
[code]array(
"en" => "location",
"it" => "locazione",
"fr" => "emplacement",
"de" => "lage",
"nl" => "plaats",
"es" => "location"
);[/code]
for [i]website[/i], the word [i][b]website[/b][/i], lower or capital or both mixed letters, or any of the words in the following array:
[code]array(
"en" => "website",
"it" => "sito web",
"fr" => "site web",
"de" => "website",
"nl" => "website",
"es" => "sitio web"
);[/code]
as is easy to understand, these arrays for these 4 BP profile field names, contains pairs of values about
[i]"language" => "translated word"[/i]
in these arrays, [b]is easy to add any other language[/b], OR, you can also choose to modify the translation of the Profile Field Name into something different. like for example:
[i]"en" => "website"[/i]
we could change into:
[b]"en" => "your web space"[/b]
so as profile field name in Buddypress, we'll set for website field profile name:
[i]Your Web Space[/i] OR [i]Your web space[/i] (or any other mixed lower/capital letters, but the phrase NEED TO BE THE SAME as it is on the related array).
These arrays can be added into the custom WP_w3all phpBB config.php file, so when plugin update nothing will be lost, if changed something from the default, [b]maybe due to addition of your language.[/b]
after this ... i stop for a moment, it is very hard to write a comprehensible Eng explaining things like this, more than code it!
Hope it is sufficient clear, but will be improved before to be published into the install help pages, when 1.7.5 will be released.
... for programmers: to get the result, it has been added two queries in WP because i've not find out any way to access to any Buddypress array containing user's profile fields data at runtime, as explained on code comments. It seem to me strange that there is no way to access to ready user's profile data provided by the BP loop, so maybe, after, some hint will help to improve, removing even this single added query! That would be amazing!