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™

Display Expiry Date

s2Member Plugin. A Membership plugin for WordPress®.

Display Expiry Date

Postby mrasmith » July 3rd, 2011, 11:28 pm

Is there a way to display the expiry date to a member? I.e. a shortcode we could place on the page that they see after logging in? It would also be helpful to display the membership level name.
User avatar
mrasmith
Registered User
Registered User
 
Posts: 1
Joined: July 3, 2011

Re: Display Expiry Date

Postby Cristián Lávaque » July 3rd, 2011, 11:33 pm

You may find the get_user_field function helpful for that. viewtopic.php?f=40&t=9015&src_doc_v=110605#src_doc_get_user_field%28%29

Code: Select all
$s2member_auto_eot_time = get_user_field ("s2member_auto_eot_time"); # Auto EOT-Time for the current User ( when applicable ).
$s2member_access_label = get_user_field ("s2member_access_label"); # An s2Member Membership Access Label ( i.e. Bronze, Gold, Silver, Platinum, or whatever is configured ).
 
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: Display Expiry Date

Postby camillemm » July 4th, 2011, 3:18 am

I was looking for this ! Great.
User avatar
camillemm
Registered User
Registered User
 
Posts: 86
Joined: September 7, 2010

Re: Display Expiry Date

Postby camillemm » July 4th, 2011, 3:33 am

But how to translate the number in a clear presentation ???
User avatar
camillemm
Registered User
Registered User
 
Posts: 86
Joined: September 7, 2010

Re: Display Expiry Date

Postby Cristián Lávaque » July 4th, 2011, 11:00 am

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: Display Expiry Date

Postby camillemm » July 4th, 2011, 11:08 am

I thought it was something like this. I need to study this. Thank you.
User avatar
camillemm
Registered User
Registered User
 
Posts: 86
Joined: September 7, 2010

Re: Display Expiry Date

Postby highfive » August 8th, 2011, 10:14 pm

Is there a field to display the date they are currently paid up to?
User avatar
highfive
Registered User
Registered User
 
Posts: 14
Joined: August 8, 2011

Re: Display Expiry Date

Postby kgweber » August 10th, 2011, 10:12 am

I would also like to be able to display the renewal date to the user, and am using Authorize.NET. From what I can tell, the renewal date is managed in Authorize.NET, not s2member, is this right? If so, is there a way to query Authorize.NET for this info?
User avatar
kgweber
Registered User
Registered User
 
Posts: 10
Joined: July 6, 2011

Re: Display Expiry Date

Postby Cristián Lávaque » August 10th, 2011, 12:44 pm

highfive wrote:Is there a field to display the date they are currently paid up to?


"s2member_auto_eot_time", but that doesn't get set for those paying lifetime access or with an ongoing subscription; at the moment subscriptions only set that time when it's stopped (cancel, refund, etc.).

If there's a time in that file, look at this code for ideas on how to display the remaining days: viewtopic.php?f=4&t=6196#p13641
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: Display Expiry Date

Postby highfive » August 10th, 2011, 2:12 pm

How do you tell, from the database, if they are active then. Like if you wanted to query to get a list of active members. Is it a different meta field?
User avatar
highfive
Registered User
Registered User
 
Posts: 14
Joined: August 8, 2011

Re: Display Expiry Date

Postby Cristián Lávaque » August 10th, 2011, 4:33 pm

Well, if you have your auto-EOT behavior to demote to Level 0, then you'll know that anyone above that level is active. You can use one of the conditionals mentioned here WP Admin -> s2Member -> API / Scripting -> Simple/Shortcode Conditionals or Advanced/PHP Conditionals. E.g.:

Code: Select all
[s2If current_user_can(access_s2member_level1)]
    Some content for Members who are logged in with an s2Member Level >= 1.
[/s2If]
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