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™

content dripping & timestamp function ? help!

s2Member Plugin. A Membership plugin for WordPress®.

content dripping & timestamp function ? help!

Postby candy » May 31st, 2011, 2:32 pm

Hi,

was trying to add this to an "if statement", but it seems that the function / code is wrong.

if((s2member_current_user_registration_time("level0") <= 1312174800) && (S2MEMBER_CURRENT_USER_REGISTRATION_DAYS <= 365)

basically, I want to use the content dripping to allow level0 users who registered before a limit date (in this case 01.08.2011) to see content otherwise only visible to level2 users. And have access to that content for not more than 365 days

But as I said, I think the code - the way I wrote it above - is wrong, could you please help?

Thank you!
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: content dripping & timestamp function ? help!

Postby candy » May 31st, 2011, 8:12 pm

please don't forget me with this one ... ;)

Thanks !
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: content dripping & timestamp function ? help!

Postby Cristián Lávaque » May 31st, 2011, 10:14 pm

You're missing a parenthesis at the end.

Code: Select all
if ((s2member_current_user_registration_time("level0") <= 1312174800) && (S2MEMBER_CURRENT_USER_REGISTRATION_DAYS <= 365))
 


I hope that fixes it. :)
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: content dripping & timestamp function ? help!

Postby candy » June 1st, 2011, 12:52 pm

thank you for the tip :-)

I tried, but it appears that there is a problem with this function/code:

s2member_current_user_registration_time("level0") <= 1312174800

If I take that away at least I have the page displayed properly, once I try to add the above part alone or combined with the other function, the page gets broken (white content)

Could you please tell what's wrong with it?
Something is just not right ...

Thank you!
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: content dripping & timestamp function ? help!

Postby Cristián Lávaque » June 1st, 2011, 3:23 pm

Ah, correct, the function name is incorrect, that's one of the constants, the right name is s2member_paid_registration_time. Here are some examples from the documentation of the function:

Code: Select all
$time = s2member_registration_time (); // ... first registration time ( free or otherwise ).
$time = s2member_paid_registration_time (); // ... first "paid" registration and/or upgrade time.
$time = s2member_paid_registration_time ("level1"); // ... first "paid" registration or upgrade time at Level#1.
$time = s2member_paid_registration_time ("level2"); // ... first "paid" registration or upgrade time at Level#2.
$time = s2member_paid_registration_time ("level3"); // ... first "paid" registration or upgrade time at Level#3.
$time = s2member_paid_registration_time ("level4"); // ... first "paid" registration or upgrade time at Level#4.
 


You can see the documentation at WP Admin -> s2Member -> API / Documentation -> s2Member Content Dripping -> Very Advanced Content Dripping.
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: Yahoo [Bot] and 2 guests

cron