latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

[Account of a paying user still valid ? ]

Home Forums Community Forum [Account of a paying user still valid ? ]

This topic contains 8 replies, has 2 voices. Last updated by  Raam Dev 4 years, 9 months ago.

Topic Author Topic
Posted: Tuesday Mar 20th, 2012 at 6:40 am #8596

Hi,

If a user has created a paying account for 1 month on my website, how can i know if his account is still valid or expired ?

Because I’d like to hide his posts if his account is expired.

Thanks for your help.

List Of Topic Replies

Viewing 8 replies - 1 through 8 (of 8 total)
Author Replies
Author Replies
Posted: Tuesday Mar 20th, 2012 at 12:51 pm #8620
Raam Dev
Username: Raam
Staff Member

Hello,

If the account has expired, it should have an Automatic EOT time. Edit the user’s profile and look for the Automatic EOT Time field. If there’s no date and there’s no note in the Administrative Notes filed indicating a demotion, then the account has not expired.

(Keep in mind if there’s a date in that field, the date may be a date/time in the future, meaning the account has been scheduled for EOT, but still has time remaining for access; see the note at Dashboard -› s2Member® -› PayPal® Options -› Automatic EOT Behavior).

When an account expires, it will follow whatever rules you configured in Dashboard -› s2Member® -› PayPal® Options -› Automatic EOT Behavior. If you have the Automatic EOT Behavior set to delete the account, then the account will be deleted and will no longer exist in s2Member.

However, if you set it to demote the users account to Free Subscriber, then their account will be demoted and a note will be added to their profile (see the Administrative Notes section when editing a user profile).

Posted: Tuesday Mar 20th, 2012 at 2:18 pm #8634

Hi,

How can I know this with php function ?
I guess there is something in you API ti check this ?

Thx.

Posted: Wednesday Mar 21st, 2012 at 10:09 am #8731
Raam Dev
Username: Raam
Staff Member

Hello,

There are several PHP functions provided by s2Member. Please see Dashboard -› s2Member® -› API / Scripting -› Advanced PHP Conditionals

Posted: Wednesday Mar 21st, 2012 at 10:15 am #8732

Thx, I’ll take a look.

Posted: Wednesday Mar 21st, 2012 at 2:54 pm #8786

Hi,

I’ve checked your Dashboard -› s2Member® -› API / Scripting -› Advanced PHP Conditionals

I’ve found something to know if the user is Lvl1 :

user_is($post->post_author, "s2member_level1")

But if this user became a free subscriber, there is no function to know if the user was previously a Lvl1 ?

I really need to know if the user was previously a paying user…even if he became a free user.

Thanks for your help !

Posted: Thursday Mar 22nd, 2012 at 12:09 pm #8833
Raam Dev
Username: Raam
Staff Member

Hello,

It sounds like you’ll want to use S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME:

This will always be an (int); in the form of a Unix timestamp. However, this will be 0 if they’re not logged in; or if they’ve never paid you at all ( i.e. if they’re still a Free Subscriber ). This holds the recorded time at which the Member originally registered their Username (or upgraded for) any type of “paid” access to your site. This value is preserved for the lifetime of their account, even if they upgrade, and even if they’re demoted at some point. Once this value is recorded, it never changes under any circumstance. This is useful if you want to drip content over an extended period of time, based on how long someone has been a “paying” Member (period); regardless of their original or existing Membership Level.

You can see examples of its usage at Dashboard -› s2Member® -› API / Scripting -› PHP/API Constants.

Posted: Thursday Mar 22nd, 2012 at 12:32 pm #8843

Hello,

This constants only works if the current user is logged_in, I think I’ll try this function instead:

s2member_paid_registration_time($level,$userID)

Because I can choose the $userID I want.

Thanks for your help !

Posted: Friday Mar 23rd, 2012 at 12:18 pm #8921
Raam Dev
Username: Raam
Staff Member

You’re most welcome! Thank you for sharing your solution.

Viewing 8 replies - 1 through 8 (of 8 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.