Distinguish between renewal and new members?

I’ve been searching but I haven’t been able to find exactly what I’m looking for. I have a customer who needs to be able to distinguish between who’s renewing vs who is new members when they export the members list. Is there a way to determine this by the data given or a way to see how many years someone has been a member?

By default, s2Member records a member’s date of first registration. It’s also displayed on the list of users that is found in WP back-end. So that might be all you need.

But if you want more, there are tons of hooks and functions that would enable you to create the records programmatically. The function c_ws_plugin__s2member_user_notes::append_user_notes is especially useful in recording events relating to a user’s membership.

For example, you could add this function to record changes of user role:

function add_role_change_note( $user_id, $new_role ) {
	c_ws_plugin__s2member_user_notes::append_user_notes ( $user_id, "User role changed to " . $new_role .': '. date ( "D M j, Y g:i a T" ) );
}
add_action( 'set_user_role', 'add_role_change_note', 10, 2);

And you might use the following hook as the basis for generating a record of a renewal via PayPal:

ws_plugin__s2member_during_paypal_notify_during_subscr_payment
1 Like

Thanks Tim. I was able to get the list setup to display the registered date and the date of last payment, which would give us what we need except for the fact that both dates are in unix time. The customer doesn’t want to have to convert every date. Is there not a way to display it in a human readable format in the user list?

Great!

Just Google for

php convert unix to human readable time

and you’ll come up with a ton of ways to do it. Just pick which one suits you.