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.

Content dripping – timesstamp – ccaps

Home Forums Community Forum Content dripping – timesstamp – ccaps

This topic contains 25 replies, has 5 voices. Last updated by  cassel 4 years, 2 months ago.

Topic Author Topic
Posted: Tuesday Sep 25th, 2012 at 2:20 pm #26459
cassel
Username: cassel

I am seeking suggestions from the support staff. Here is my current situation:

– i have several products, all protected by ccaps, and all independant of each other (all Level 1)
– i have two courses, called “basic” and “element”
– the “basic” course is a one time payment, and forever access (so no EOT to worry about and no recurring payment)
– the “element” course is a monthly recurring payment as there is new content every week
– all the content for “element” are protected with the ccap “element”
– currently, a new customer of the “element” course, gets access to ALL the content that was added in over a year, for the same price someone paid last year (obviously, they get much more for the same price)
– members might often be registered as free members weeks or months before they register to the “element” course, and some miight already be at level 1 if they purchase the other course, or any other product on my site.

I would like to offer the “element” course to new customers in a drip content manner, so they can have a set number of lessons upon purchase (ex: 20) and then, see new content dripped weekly. So a new customer would get access to lessons 1-20 at the time of purchase, then 21 next week, 22 the week after and so on, even though, the current members of the “element” course are already at lesson 60.

Could i use a Level 2 for the new members and assign a dripping schedule while making sure they do not access all the content for Level 1 (which has ccaps)?
Or can you think of another angle to look at this? What would you suggest?

  • This topic was modified 4 years, 3 months ago by  cassel.
  • This topic was modified 4 years, 3 months ago by  cassel.

List Of Topic Replies

Viewing 25 replies - 1 through 25 (of 25 total)
Author Replies
Author Replies
Posted: Wednesday Sep 26th, 2012 at 4:23 am #26525
Raam Dev
Username: Raam
Staff Member

Yes, if Level 1 content is already restricted using ccaps, then any Level 2 members who signup without those ccaps will not have access to the Level 1 content.

I’m fairly certain that answers your question, but I suggest just creating a Level 2 user manually and then testing things on your live site to see if they work as you expect.

Posted: Wednesday Sep 26th, 2012 at 6:17 am #26533
cassel
Username: cassel

This answers part of the question and yes, i thought so, since Cristian already tested that part for another question.

But now, if the content is currently restricted with ccaps, how can THAT content be dripped to a Level 2 member? Is it possible? I dont want to have to replicate hundreds of pages just to have a set for Level1 and a set for Level2 (unless there is really no other way around).

And how to get the dripping based on the time of the PURCHASE and not the registration, as they might differ?

Posted: Thursday Sep 27th, 2012 at 4:50 am #26656
Raam Dev
Username: Raam
Staff Member

But now, if the content is currently restricted with ccaps, how can THAT content be dripped to a Level 2 member? Is it possible? I dont want to have to replicate hundreds of pages just to have a set for Level1 and a set for Level2 (unless there is really no other way around).

If the Level 2 members don’t have the Custom Capabilities that you’ve restricted the content to, then it’s not possible to give them access to it or drip it to them. You’d need to first assign them the Custom Capability so they have access.

And how to get the dripping based on the time of the PURCHASE and not the registration, as they might differ?

Please see Dashboard -› s2Member® -› API / Scripting -› PHP/API Constants and S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME.

Posted: Thursday Sep 27th, 2012 at 6:25 am #26662
cassel
Username: cassel

If the Level 2 members don’t have the Custom Capabilities that you’ve restricted the content to, then it’s not possible to give them access to it or drip it to them. You’d need to first assign them the Custom Capability so they have access.

Do you mean that i can give the same ccaps to the Level2 members as Level1 members cirrently have AND drip that content too?

Please see Dashboard -› s2Member® -› API / Scripting -› PHP/API Constants and S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME.

Considering that i would, in this case, have only ONE Level2 kind of product, i think it could work, but i guess if i was to create a different product with a different dripping schedule or for different pages, i would have to use yet another level if the same member MIGHT be purchasing more than one?

Posted: Thursday Sep 27th, 2012 at 7:50 pm #26767
Raam Dev
Username: Raam
Staff Member

Do you mean that i can give the same ccaps to the Level2 members as Level1 members cirrently have AND drip that content too?

Yes. Content Dripping relies on the conditional that you use to drip the content. Once the user passes the conditional, they will need to have access to the content before they can actually see it.

Considering that i would, in this case, have only ONE Level2 kind of product, i think it could work, but i guess if i was to create a different product with a different dripping schedule or for different pages, i would have to use yet another level if the same member MIGHT be purchasing more than one?

I’m not sure I understand what you’re asking, but the main thing to remember is that content dripping is entirely controlled by the conditionals that you create. You can make your conditionals check for any combination of things (Custom Capabilities, Levels, Time Since Registration, Time Since First Payment, etc.).

Posted: Thursday Sep 27th, 2012 at 9:20 pm #26779
cassel
Username: cassel

I’m not sure I understand what you’re asking, but the main thing to remember is that content dripping is entirely controlled by the conditionals that you create. You can make your conditionals check for any combination of things (Custom Capabilities, Levels, Time Since Registration, Time Since First Payment, etc.).

All my content is currently protecte with a conditional called “Element”, and it is for my Level1 members.
Now, i want NEW members to have the content, but dripped instead of getting all the content at once.
If i make a Level2 membership, can i use the same pages as for Level1-with ccaps “element”, but drip that content based on the registration time of the Level2 subscription.
Maybe i should include a ccaps “element” in the Level2 membership so the members CAN access those protected pages, when the dripping “releases” their respective access?

Posted: Friday Sep 28th, 2012 at 7:57 am #26825

Yes, you can add a condition that checks for the level in combination with the first payment time for that level. In the same page you could have the conditionals to drip to level 1 and level 2.

Here you can see an example of the code to get the first time at each level. [hilite path]Dashboard -› s2Member® -› API / Scripting -› Content Dripping -> Very Advanced[/hilite]

Posted: Friday Sep 28th, 2012 at 8:35 am #26837
cassel
Username: cassel

Thanks. Off to study.

Posted: Sunday Sep 30th, 2012 at 7:27 pm #27029
cassel
Username: cassel

I am just a bit unsure now, how to code the php. I want the content to be dripped weekly, so i would use multiple of 7 days (unless there is a way to use weeks?). So far, i figured how to set up the basic of the time but where do i include the ccaps? Or do i have to since all those pages will have the same ccap?

<?php if(s2member_paid_registration_time() > 0){ ?>
 
    <?php /* Timestamp at Level #2, or `0` if they've NOT yet paid for Level #2. */
             $level2_payment_time =  s2member_paid_registration_time("level2"); ?>
    
    <?php if($level2_payment_time && $level2_payment_time <= ($_7_days_ago = strtotime("-7 days"))){ ?>
        Drip content to Members that started paying you at Level#2, at least 7 days ago.

    <?php } else { ?>
        Sorry, this content is not YET available to you. (not sure this will be there though)
    <?php } ?>

<?php } ?> 

I am using Level 2 to drip content as it is currently available for members on level 1 where the content was naturally dripped as i was adding it weekly.
This would be put on the page for access for each page accessible after 7 days, and something similar for content accessible after 14 days, 21 days, etc. S

So the questions are: is that setting things up properly? (it is hard to test) and what do i do with the ccaps as i want only the pages currently protected with a specific ccaps to be dripped?

Posted: Monday Oct 1st, 2012 at 6:24 pm #27141
Raam Dev
Username: Raam
Staff Member

You can include a ccaps check by changing the following:

<?php if(s2member_paid_registration_time() > 0){ ?>

to:

<?php if(s2member_paid_registration_time() > 0 && current_user_can("access_s2member_ccap_free_gift")){ ?>

That will check if the user paid you at any point in the past AND (&&) if they have access to the free_gift ccap. You could move that ccap check in the nested conditional that checks the Level 2 time if you want.

Posted: Monday Oct 1st, 2012 at 7:13 pm #27154
cassel
Username: cassel

Oh thanks for pointing that detail. I knew it had to be added somewhere.

Posted: Tuesday Oct 2nd, 2012 at 6:19 am #27188
Core Love
Username: corelove

Can you put an example using just the ccap for dripping content?

Posted: Tuesday Oct 2nd, 2012 at 3:45 pm #27247

Raam’s second code line in his last post is that:

[hilite pre_code]
0 && current_user_can("access_s2member_ccap_free_gift")){ ?>
[/hilite]

You just change the [hilite mono]0[/hilite] to something higher if you want to delay the access.

If you just use the ccap part of the condition, without the time, then it’s not dripping.

Posted: Saturday Oct 6th, 2012 at 1:40 pm #27668
cassel
Username: cassel

OK i am in the process of updating my page to allow for dripping. I am currently using a test page, and using this code i have the preview visible with the link IF the member meets the time requirement, and the preview without the link IF the member does not meet the requirement. Or at least, that is the plan.

The “problem” right now, is how to i test it? I have a few “test members” but they dont PAY, so if it is based on the start of the PAYING process, my test members will never be as a regular member should be. Can it be coded in minutes or hours, even if just for the testing? Can i just replace the “days” mention to “minutes” or “hours”? But again, how do i test it with a test member that is not paying if the pay process is the trigger for that?

Posted: Monday Oct 8th, 2012 at 3:10 am #27770
Raam Dev
Username: Raam
Staff Member

Yes, you can just change things to minutes/hours to make things faster to test. If you want to really test real-world paying users, to see what actual paying members would see, then I suggest signing up on your own site with PayPal for a small amount (e.g., $0.01) and then using that account to test things. That’s what I do on my personal site.

Posted: Monday Oct 8th, 2012 at 8:36 am #27787
cassel
Username: cassel

Thanks. It will help with the testing.

Do i HAVE to have a paid membership to test those?

Also, if the PAID part is the trigger, how can i have a member who would be given a free membership (either manually or by other mean) and still have the content dripped? Or if anything is not automatically set, how can i manually set it (if it is even possible)?

While at it, i currently have this code (not active yet):

<?php if(s2member_paid_registration_time() > 0 && current_user_can("access_s2member_ccap_element")){ ?>
    <?php /* Timestamp at Level #2, or `0` if they've NOT yet paid for Level #2. */
             $level2_payment_time =  s2member_paid_registration_time("level2"); ?>    
    <?php if($level2_payment_time && $level2_payment_time <= ($_7_days_ago = strtotime("-7 days"))){ ?>
        Drip content to Members that started paying you at Level#2, at least 7 days ago.
    <?php } else { ?>
        Sorry, this content is not YET available to you. (not sure this will be there though)
    <?php } ?>
<?php } ?> 

And this will drip content to Level 2 members with the “element” ccaps. Will this ONLY drip content to the Level 2 and leave anyone with Level 1 alone, or do i have to also add that everyone with Level 1 and “element” (no matter the time they registered or paid) can access all that content (since i am adding stuff every week, it is dripping anyways)? How should the code look like?

  • This reply was modified 4 years, 3 months ago by  cassel.
Posted: Tuesday Oct 9th, 2012 at 3:19 am #27850
Raam Dev
Username: Raam
Staff Member

To check for Level 2, you should use current_user_can(“access_s2member_level2”). Please see Dashboard -› s2Member® -› API / Scripting -› Advanced PHP Conditionals.

If you want to drip content to non-paying members, you’ll need to use the S2MEMBER_CURRENT_USER_REGISTRATION_TIME constant instead of the paid registration time constant, since non-paying members won’t have a paid registration time. Please see Dashboard -› s2Member® -› API / Scripting -› PHP/API Constants.

Posted: Tuesday Oct 9th, 2012 at 6:28 am #27874
cassel
Username: cassel

OK, i’ll try that. Thanks.

Posted: Wednesday Oct 10th, 2012 at 9:58 pm #28061
cassel
Username: cassel

Getting there (i think). My developper is currently not available so i ‘ll try to figure this one out myself. How is this for a code:

<?php if (current_user_can(“access_s2member_level1") && current_user_can("access_s2member_ccap_element") 
    || ((current_user_can(“access_s2member_level2") && current_user_can("access_s2member_ccap_element") && s2member_paid_registration_time("level2")>=7){ ?>
 Display what is supposed to be dripped to the level 2 members, but available to the level 1 members already
<?php } ?> 

I have to get away from the PAID time in case i need to GIVE one membership for free. But since that is the ONLY membership i have at Level 2, i think it would work. What do you think? However in this example, i dont see the unit for the 7; it is days? weeks? hours? I used the examples in the s2Member PHP/API Constants. Can you correct it?

Posted: Wednesday Oct 10th, 2012 at 10:26 pm #28067
Bruce
Username: Bruce
Staff Member

Hello again Cassel,

You’ve got a parse error in your above code. Try this:

<?php
if(current_user_can("access_s2member_level1") && current_user_can("access_s2member_ccap_element")
  || ((current_user_can("access_s2member_level2") && current_user_can("access_s2member_ccap_element") && s2member_paid_registration_time("level2") >= strtotime("-7 days"))))
	{ ?>
		Display what is supposed to be dripped to the level 2 members, but available to the level 1 members already
<?php } ?>

You can use strtotime() to find how many days it is away. s2member_paid_registration_time() returns a timestamp.

  • This reply was modified 4 years, 2 months ago by  Bruce. Reason: Updated code with strtotime() to allow for 7 days
Posted: Wednesday Oct 10th, 2012 at 10:39 pm #28071
cassel
Username: cassel

Cani use the registration time and not the PAID registration time? If i want to give a free membership to someone, the PAID part would not trigger the dripping. 90% of the time it will be paid memberships, but occasionally, it might not be. I had copied the wrong code and had paid_registration…. can i use just registration instead?

  • This reply was modified 4 years, 2 months ago by  cassel.
Posted: Wednesday Oct 10th, 2012 at 10:45 pm #28074
Bruce
Username: Bruce
Staff Member

ow can i use the registration time and not the PAID registration time? If i want to give a free membership to someone, the PAID part would not trigger the dripping. 90% of the time it will be paid memberships, but occasionally, it might not be. How do i configure it then?

You could check first to see if the user is a ‘subscriber’ before starting your if() statement. If so, you can use the constant S2MEMBER_CURRENT_USER_REGISTRATION_TIME, which is not dependant on user level.

Assuming you just want to drip content no matter the level, you can use S2MEMBER_CURRENT_USER_REGISTRATION_TIME for all levels instead of s2member_paid_registration_time().

Posted: Wednesday Oct 10th, 2012 at 10:58 pm #28075
cassel
Username: cassel

Maybe it was not obvious in the code i made but here is the “English translation” for it:
if (the member is a Level 1 with “element” ccap) or (the member is a Level 2 with “element” ccap AND is a level 2 member since X number of days)
Display the content

Is that what the code was saying?

Posted: Thursday Oct 11th, 2012 at 12:43 am #28077
Bruce
Username: Bruce
Staff Member

Hi cassel,

Maybe it was not obvious in the code i made but here is the “English translation” for it:
if (the member is a Level 1 with “element” ccap) or (the member is a Level 2 with “element” ccap AND is a level 2 member since X number of days)
Display the content

Is that what the code was saying?

Yes that’s correct.

Posted: Thursday Oct 11th, 2012 at 6:14 am #28092
cassel
Username: cassel

Do you mean that my code was correct?
Or do i still need to add whether the user is a subscriber?

Viewing 25 replies - 1 through 25 (of 25 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.