Page 1 of 1

Search by custom profile fields?

PostPosted: October 9th, 2011, 1:44 am
by zameer
Hi,
I'm building a buddypress based site and I'm leaning more towards using s2Member fields rather than BP extend profile fields due to number of reasons.
What I wan to know is, is it possible to build a search plugin for s2Member profile fields (similar to BP Profile Search plugin)? If so can you show me the right direction?

Re: Search by custom profile fields?

PostPosted: October 9th, 2011, 3:30 pm
by Cristián Lávaque
The fields are stored in a serialized array, so they're a bit harder to search than if they were in their own columns in the database table.

Code: Select all
$s2_custom_fields get_user_option('wp_s2member_custom_fields'$user_id); 


Look at it in the database so you see how they're stored and how you could search them.

I hope this helps. :)

Re: Search by custom profile fields?

PostPosted: October 9th, 2011, 11:20 pm
by zameer
Yup, I was looking at this yesterday and understood it to be a JSON string.
I think I'm gonna have a custom table that duplicates the data in a queryable way on profile update.
I actually need admins to approve profile modifications, so I can use the duplicate table as the intermediate destination for new data works as well.

Thanks!

Re: Search by custom profile fields?

PostPosted: October 11th, 2011, 12:24 pm
by Cristián Lávaque
No problem! Keep us updated, please. Would love you to know how you finally solve it and how. :)