PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Search by custom profile fields?

s2Member Plugin. A Membership plugin for WordPress®.

Search by custom profile fields?

Postby zameer » October 9th, 2011, 1:44 am

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?
User avatar
zameer
Registered User
Registered User
 
Posts: 3
Joined: August 31, 2011

Re: Search by custom profile fields?

Postby Cristián Lávaque » October 9th, 2011, 3:30 pm

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. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Search by custom profile fields?

Postby zameer » October 9th, 2011, 11:20 pm

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!
User avatar
zameer
Registered User
Registered User
 
Posts: 3
Joined: August 31, 2011

Re: Search by custom profile fields?

Postby Cristián Lávaque » October 11th, 2011, 12:24 pm

No problem! Keep us updated, please. Would love you to know how you finally solve it and how. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 1 guest

cron