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 and custom packages.

s2Member Plugin. A Membership plugin for WordPress®.

content dripping and custom packages.

Postby twaycaster » August 20th, 2011, 1:02 pm

I need some help on a basic level. I finally got the advanced conditionals and packages figured out, but with content dripping, I just look at the code and do not understand where I put in which pages to drip with the time is right. I need to SEE a example first that shows something like

add action template redirect my custom capabilities
function my custom capabilites

if tags music !current user can ccap music
else if s2member current user paid registration days = 7
drop pages 7, 8, 9

else if s2 member current paid registration days = 14
drip pages 10 11 12

else if s2 member current paid regsitration days 21
drip pages 13 14 15

else if s2 member curretn paid reg 28 days
drip pages 16


header location s2members options page url
exit

I hope this makes sense and someone can help me with getting this base figured out .
User avatar
twaycaster
Registered User
Registered User
 
Posts: 24
Joined: August 17, 2011

Re: content dripping and custom packages.

Postby Cristián Lávaque » August 20th, 2011, 10:03 pm

Could you post the code with brackets, please? :)
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 and custom packages.

Postby twaycaster » August 21st, 2011, 3:06 pm

Code: Select all
/**
 * My Custom Routines.
 */

add_action ("template_redirect""my_custom_capabilites");

function 
my_custom_capabilities ()
     {

    if(
has_tag("client group a") && !current_user_can ("access_s2member_ccap_client group a"))
        {
            
header ("Location: "S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
                         (
access_s2member_ccap_client group a_registration_days >= 7)
                         
drip pages 1,2,3
                         
(access_s2member_ccap_client group a_registration_days >= 14)
                         
drip pages 4,5,6
                         
(access_s2member_ccap_client group a_registration_days >= 21)
            
drip pages 7,8,9
                         
(access_s2member_ccap_client group a_registration_days >= 28)
                         
drip pages 10 
                         
exit ();
        }

    
     } 


is this correct?
Last edited by Cristián Lávaque on August 22nd, 2011, 10:21 pm, edited 1 time in total.
Reason: Improve code readability. http://www.primothemes.com/forums/viewtopic.php?f=36&t=2780
User avatar
twaycaster
Registered User
Registered User
 
Posts: 24
Joined: August 17, 2011

Re: content dripping and custom packages.

Postby Cristián Lávaque » August 22nd, 2011, 10:24 pm

Thanks for posting the code. I'm not sure yet where you're using it and what you're trying to achieve. Is it for the navigation?

By the way, I suggest you don't use spaces in the custom capability's name, use underscores instead: access_s2member_ccap_client_group_a.
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