by axew3 » Thu Jun 15, 2017 1:23 pm
Problem: how to have sincro-update for profile fields between phpBB and Buddypress in WordPress?
When you need to do this for a specific installation where you know what fields are existent into both phpBB and WP, it is very easy.
But how to code something that could be suitable for any custom field?
It seem +- impossible with short solutions. And really hard, even if possible with some (there are necessary many i think) functions.
So, i've look into database tables, and i see one thing that could help: names of fields.
Could be possible to extract something from a know array we can provide and check against, so let say an array that contain words like:
'google','yahoo','twitter','facebook'
this can be a valid concept, because when admin go to create a field, normally will name it with something that belong to the name of the service.
So, should be possible do the follow:
on update, extract fields from both db, check for fields that match for both, update fields: the update fields should be provided/built by a dynamic function that will create the correct update query, based on passed data.
Since fields can be of different types (text, option etc), maybe we can start to add just one type of field, considered by the code to be updated: the text field type (that is commonly used for linked services).
Problem: how to have sincro-update for profile fields between phpBB and Buddypress in WordPress?
When you need to do this for a specific installation where you know what fields are existent into both phpBB and WP, it is very easy.
But how to code something that could be suitable for any custom field?
It seem +- impossible with short solutions. And really hard, even if possible with some (there are necessary many i think) functions.
So, i've look into database tables, and i see one thing that could help: [b]names of fields[/b].
Could be possible to extract something from a know array we can provide and check against, so let say an array that contain words like:
'google','yahoo','twitter','facebook'
this can be a valid concept, because when admin go to create a field, normally will name it with something that belong to the name of the service.
So, should be possible do the follow:
on update, extract fields from both db, check for fields that match for both, update fields: the update fields should be provided/built by a dynamic function that will create the correct update query, based on passed data.
Since fields can be of different types (text, option etc), maybe we can start to add just one type of field, considered by the code to be updated: the [i]text field[/i] type (that is commonly used for linked services).