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™

What triggers content dripping?

s2Member Plugin. A Membership plugin for WordPress®.

What triggers content dripping?

Postby ricarod » June 14th, 2011, 3:50 pm

I've searched this site with no luck while looking for a step by step guy for dripping content? Is it possible to drip content to free (level 0) members? How should content dripping be tested if not having any paid member for testing? What exactly triggers the dripping?
User avatar
ricarod
Registered User
Registered User
 
Posts: 25
Joined: May 17, 2011

Re: What triggers content dripping?

Postby Cristián Lávaque » June 14th, 2011, 7:06 pm

Content dripping with s2Member is explained here WP Admin -> s2Member -> API / Scripting -> s2Member Content Dripping.

I hope that helps. :)
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: What triggers content dripping?

Postby ricarod » June 14th, 2011, 8:03 pm

Hi Christian and thank you for your prompted reply. Yes I see that, as a matter of fact I tried that and I was expecting something to happen after 'REGISTRATION_DAYS >= 1' but nothing happened so I'm not really sure if I was supposed to be notified (which didn't happened) or just try accessing the page where I have added some dummy content for testing and still wasn't available.

Instructions said that is for paid members so I'm not really sure if that'll work for a dummy user I manually make it member of level1? therefore my question what would triggered the content availability?

Thanks.
User avatar
ricarod
Registered User
Registered User
 
Posts: 25
Joined: May 17, 2011

Re: What triggers content dripping?

Postby Cristián Lávaque » June 14th, 2011, 9:22 pm

I guess the constant you're looking for may be S2MEMBER_CURRENT_USER_REGISTRATION_DAYS.

Code: Select all
<?php if(S2MEMBER_CURRENT_USER_REGISTRATION_DAYS >= 1) { ?>
    Content...
<?php } ?>
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: What triggers content dripping?

Postby ricarod » June 14th, 2011, 9:31 pm

Thank you again Cristian, that's exactly what I did. 'Content...' should be whatever I want to show in the page, right? Didn't work! :(

I guess I won't be notified via email or anything I just need to login there after 1 day (in this specific example) and I should see whatever content is there, right? Didn't happened but I guess I'll just try again.

Just to make it shorter for testing can I set it up to hours instead of days? Will this also work for free members?
User avatar
ricarod
Registered User
Registered User
 
Posts: 25
Joined: May 17, 2011

Re: What triggers content dripping?

Postby Cristián Lávaque » June 14th, 2011, 10:06 pm

You'll need to use S2MEMBER_CURRENT_USER_REGISTRATION_TIME and maybe the PHP date/time functions to do it in hours.

I'm sure you can with free members too, but you may need to check what those constants values are to make sure what you're comparing with in the conditions.

Code: Select all
<?php echo S2MEMBER_CURRENT_USER_REGISTRATION_DATE?>


By the way, have you installed the plugin that allows you to use PHP in your post/page and added the code to the HTML editor instead of the Visual one?
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: What triggers content dripping?

Postby ricarod » June 14th, 2011, 10:16 pm

Yes to 'php plugin' and yes to 'html editor'.

Let me do some more testing and get back here with comments.

Thank you very much.
User avatar
ricarod
Registered User
Registered User
 
Posts: 25
Joined: May 17, 2011

Re: What triggers content dripping?

Postby ricarod » June 14th, 2011, 10:39 pm

Cristian not sure what happened before but all seem to be good now. Maybe I just tried to early? Not sure but all seem to be in good shape so I guess I'll just keep testing in the next few days and let you know :)
User avatar
ricarod
Registered User
Registered User
 
Posts: 25
Joined: May 17, 2011

Re: What triggers content dripping?

Postby Cristián Lávaque » June 14th, 2011, 10:48 pm

Great! :)
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: What triggers content dripping?

Postby ricarod » June 15th, 2011, 1:41 pm

Hey Cristian just asking I guess trying to know your product better. What is the exact time/moment taken into consideration when evaluating constants like 'CURRENT_USER_REGISTRATION_DAYS' ?

I mean, if it is '>=1' when exactly does '1' happen? makes sense? Let me put it this way:

Is 1 day 24hrs after subscribing?
Is 1 day next calendar day? Let's say I subscribed on Monday will 'CONTENT...' be available on Tuesday? If so then that will be next day according to who? GMT? Server time?

I think my confusion started because I was doing a testing and I was hopping 'CONTENT...' to become available 24 hours after I subscribed but that didn't happen so I guess I'm just asking for my own knowledge while at the same time I'm currently waiting for my next released on my testing scenario which will allow me new content when 'CURRENT_USER_REGISTRATION_DAYS >=2' :ugeek:
User avatar
ricarod
Registered User
Registered User
 
Posts: 25
Joined: May 17, 2011

Re: What triggers content dripping?

Postby Cristián Lávaque » June 15th, 2011, 8:40 pm

Well, I understand it as the first day, I don't think the constant counts the first one as Day 0. You can do a simple test, though, create a new account, log in with it and see what the constant's value is: 0 or 1?
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: What triggers content dripping?

Postby ricarod » June 15th, 2011, 9:21 pm

Well that's exactly my question: Let me first just mentioned that it does count first day as '0' and day one does not start exactly 24hrs after becoming a member which is the motive of my question: what exactly counts it?

Yes I did set up a test user before and that is how I know day 1 was not next day and was not 24 hours later unless there's something really funny with my server's time. As a matter of fact now that I checked my test user I do have access to my 2nd day content and my user/membership is about 52 hours old but just not sure if that was available exactly when my user had 48hrs, I get the feeling this could be considering GMT/UTC=0 but not sure.

Again, at this point my question is not inquiring on functionality (which I'm very happy with btw) but is just more of a curiosity thing :)

Thanks again for your great support and you can definitely count me in for sure under your developer's license program in the very near future ;)
User avatar
ricarod
Registered User
Registered User
 
Posts: 25
Joined: May 17, 2011

Re: What triggers content dripping?

Postby ricarod » June 15th, 2011, 9:25 pm

OK just for additional reference, my previous email says:

"...not sure if that was available exactly when my user had 48hrs, I get the feeling this could be considering GMT/UTC=0..."

Change day @ GMT was about 2 hours ago
User avatar
ricarod
Registered User
Registered User
 
Posts: 25
Joined: May 17, 2011

Re: What triggers content dripping?

Postby Cristián Lávaque » June 15th, 2011, 9:30 pm

Hmm... ok. Try the constant for the time instead of days, and let me know if that's more precise for what you need. I'll ask Jason about the days one.
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: What triggers content dripping?

Postby Cristián Lávaque » June 15th, 2011, 9:37 pm

By the way, this is the documentation for the constant viewtopic.php?f=40&t=9011&src_doc_v=110605#src_doc_S2MEMBER_CURRENT_USER_REGISTRATION_DAYS

And this is the line that defines it:

Code: Select all
define ("S2MEMBER_CURRENT_USER_REGISTRATION_DAYS", ($c[] = (($user && $user->user_registered) ? (int)floor ((strtotime ("now") - strtotime ($user->user_registered)) / 86400) : 0)));
 
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: Google [Bot] and 0 guests

cron