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™

Custom Fields in usermeta Table

s2Member Plugin. A Membership plugin for WordPress®.

Custom Fields in usermeta Table

Postby nfavari84 » January 3rd, 2011, 1:14 pm

Hi everyone!

As of now the s2member custom fields get saved as a single, serialized array in the wp_s2member_custom_fields usermeta.
First of all: why is that so?

Then the problem is this:
how do I filter my users based on a s2Member custom field (like "province")?

If it was a simple usermeta field, I could have used a straightforward query like this one:
Code: Select all
$wp_user_search = $wpdb->get_results("
SELECT u.ID, u.display_name, um.meta_value
FROM $wpdb->users u
JOIN $wpdb->usermeta um ON um.user_id = u.ID
WHERE um.meta_key = 'province'
AND um.meta_value = 'value'
");


Given I can't, what's the fastest solution available?

(a "this feature is planned" response is very welcome, of course, but I need a viable solution with the stuff I have at present).

btw Happy new year everybody!
:D

edit: I'm also open to intercepting fields and creating usermeta during the signup process, but what's the exact hook? is there a hook that fires after a successful user registration?
User avatar
nfavari84
Registered User
Registered User
 
Posts: 1
Joined: January 3, 2011

Re: Custom Fields in usermeta Table

Postby Jwrbloom » February 23rd, 2011, 12:29 pm

Did you make any progress on this issue? I'm in the same boat as you are.
User avatar
Jwrbloom
Registered User
Registered User
 
Posts: 55
Joined: May 23, 2010

Re: Custom Fields in usermeta Table

Postby Cristián Lávaque » February 23rd, 2011, 10:06 pm

Maybe you'll need to create a new table where to store that data to do what you want. I have no idea how to create a WP plugin, otherwise I'd be happy to help.

I'd also store all the data that modifies access to content to manage drips simpler.
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: Custom Fields in usermeta Table

Postby dwbiz05 » April 19th, 2011, 4:48 pm

Tables are always better in my opinion, but this might be an option, at least it's working for me at the moment.

viewtopic.php?f=4&t=1668&p=12950#p12950

D.
User avatar
dwbiz05
Registered User
Registered User
 
Posts: 11
Joined: March 17, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 1 guest

cron