Page 1 of 1

content dripping & timestamp function ? help!

PostPosted: May 31st, 2011, 2:32 pm
by candy
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!

Re: content dripping & timestamp function ? help!

PostPosted: May 31st, 2011, 8:12 pm
by candy
please don't forget me with this one ... ;)

Thanks !

Re: content dripping & timestamp function ? help!

PostPosted: May 31st, 2011, 10:14 pm
by Cristián Lávaque
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. :)

Re: content dripping & timestamp function ? help!

PostPosted: June 1st, 2011, 12:52 pm
by candy
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!

Re: content dripping & timestamp function ? help!

PostPosted: June 1st, 2011, 3:23 pm
by Cristián Lávaque
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.