Is there a easier solution out yet for user search with the s2member custom fields than two years ago in this post described?:
http://www.primothemes.com/forums/viewtopic.php?f=4&t=15658&p=48878#p48878
When I’m using the code from this site:
get_results ("SELECT `user_id` as `ID` FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = '" . $wpdb->prefix . "s2member_custom_fields' AND `meta_value` REGEXP '.*"country_code";s:[0-9]+:"US".*'");
if (is_array ($users) && count ($users) > 0)
{
foreach ($users as $user)
{
$user = /* Get full User object now. */ new WP_User ($user->ID);
print_r($user); /* Get a full list of properties when/if debugging. */
}
}
?>
I’m only getting the following line out:
WP_User Object ( [data] => stdClass Object ( [ID] => 22 [user_login] => username1 [user_pass] => $D$ZTVBHJ6789VGHBJNKMK. [user_nicename] => username1 [user_email] => usernam1@trash-mail.com [user_url] => [user_registered] => 2013-06-27 02:55:06 [user_activation_key] => [user_status] => 0 [display_name] => username1) [ID] => 22 [caps] => Array ( [subscriber] => 1 ) [cap_key] => wp_capabilities [roles] => Array ( [0] => subscriber ) [allcaps] => Array ( [read] => 1 [level_0] => 1 [access_s2member_level0] => 1 [subscriber] => 1 ) [filter] => )
I don’t know how to create a search form and how to get a formatted result.
Would be great to have a substitute for Buddypress Profile Search. BP Profile Search is perfect, it’s just sad that it isn’t compatible with s2member custom fields. Would be great to have a BP Profile search replacement.
Would be great to get some help on this.
Thank you