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™

s2member pro - how to search members

s2Member Plugin. A Membership plugin for WordPress®.

s2member pro - how to search members

Postby lordjoshua » May 10th, 2011, 1:29 am

One of the levels of membership on the project I am working on needs to be searchable. That is, this level has businesses signing up (level 3), and then customers (levels 0,1,2) need to be able to search the "directory" (which is anyone and everyone signed up on level 3. The search needs to be able to query any of the custom fields generated in the s2member program that apply to level 3. Is there an easy way to do this that I am missing? Some kind of shortcode i need to drop in a page to make this happen? Or is there a different pluggin that anyone is aware of that i can use to specifically tell it what fields in the s2member database to query? Any ideas?
User avatar
lordjoshua
Registered User
Registered User
 
Posts: 5
Joined: May 10, 2011

Re: s2member pro - how to search members

Postby Cristián Lávaque » May 10th, 2011, 11:50 am

You could create your custom directory using the get_users function to get the IDs of users at Level 3 and then get the rest of the data you want to display in the directory with get_user_option.

http://codex.wordpress.org/Function_Reference/get_users
https://codex.wordpress.org/Function_Re ... ser_option

Code: Select all
foreach(get_users("role=s2member_level3") as $user) {
    echo 
get_user_option('first_name'$user->ID);
}
 


I hope that 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: s2member pro - how to search members

Postby Cristián Lávaque » May 10th, 2011, 12:14 pm

Actually, since you need several things for each user, it may be best to use something like get_userdata. https://codex.wordpress.org/Function_Re ... t_userdata
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: s2member pro - how to search members

Postby lordjoshua » May 10th, 2011, 3:43 pm

Hi Cristian - this is my first "complicated" wordpress site, so I appreciate you bearing with me during my learning curve. Here is my first stupid question - where do I drop this code into?

The following are the slug names that i need searchable.

Text ( single line ) business_name_biz yes 3
Text ( single line ) first_name_biz yes 3
Text ( single line ) last_name_biz yes 3
Text ( single line ) email_biz no 3
Text ( single line ) contact_number_biz yes 3
Text ( single line ) business_number_biz yes 3
Text ( single line ) street_number_biz yes 3
Text ( single line ) street_name_biz yes 3
Text ( single line ) street_suffix_biz yes 3
Text ( single line ) city_biz yes 3
Select Menu ( drop-down ) state_biz yes 3
Text ( single line ) zip_code_biz yes 3
Textarea ( multi-line ) discount_details_biz yes 3
Select Menu ( multi-option ) business_catagory_biz yes 3

What would the code look like and where do I put it?

Again - I truly appreciate your patience with me. I love s2member, and besides this I have everything else all configured and figured out!
User avatar
lordjoshua
Registered User
Registered User
 
Posts: 5
Joined: May 10, 2011

Re: s2member pro - how to search members

Postby Cristián Lávaque » May 10th, 2011, 3:49 pm

No problem.

Hmm... My best suggestion would probably be that you get a freelance develper who creates this directory page for you. viewforum.php?f=37

I hope that 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


Return to s2Member Plugin

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron