Page 1 of 1
Display Expiry Date
Posted:
July 3rd, 2011, 11:28 pm
by mrasmith
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.
Re: Display Expiry Date
Posted:
July 3rd, 2011, 11:33 pm
by Cristián Lávaque
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"); $s2member_access_label = get_user_field ("s2member_access_label");
Re: Display Expiry Date
Posted:
July 4th, 2011, 3:18 am
by camillemm
I was looking for this ! Great.
Re: Display Expiry Date
Posted:
July 4th, 2011, 3:33 am
by camillemm
But how to translate the number in a clear presentation ???
Re: Display Expiry Date
Posted:
July 4th, 2011, 11:00 am
by Cristián Lávaque
Re: Display Expiry Date
Posted:
July 4th, 2011, 11:08 am
by camillemm
I thought it was something like this. I need to study this. Thank you.
Re: Display Expiry Date
Posted:
August 8th, 2011, 10:14 pm
by highfive
Is there a field to display the date they are currently paid up to?
Re: Display Expiry Date
Posted:
August 10th, 2011, 10:12 am
by kgweber
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?
Re: Display Expiry Date
Posted:
August 10th, 2011, 12:44 pm
by Cristián Lávaque
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
Re: Display Expiry Date
Posted:
August 10th, 2011, 2:12 pm
by highfive
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?
Re: Display Expiry Date
Posted:
August 10th, 2011, 4:33 pm
by Cristián Lávaque
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]