<?php
add_action ('template_redirect', 'my_s2_custom_capabilities');
function my_s2_custom_capabilities()
{
$drips = array(
7 => array(3, 4, 5),
14 => array(6, 7, 8),
21 => array(9, 10, 11),
28 => array(12),
);
foreach ($drips as $drip_day => $drip_pages)
{
if (S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS < $drip_day && is_page($drip_pages))
{
wp_redirect('http://example.com/not-yet-available-to-you/');
exit;
}
}
}
?>
Statistics: Posted by Cristián Lávaque — September 5th, 2011, 12:37 am
Statistics: Posted by twaycaster — September 4th, 2011, 12:56 pm
Statistics: Posted by twaycaster — September 3rd, 2011, 9:19 pm
Statistics: Posted by Cristián Lávaque — September 3rd, 2011, 11:50 am
Statistics: Posted by twaycaster — September 3rd, 2011, 11:27 am
Statistics: Posted by Jason Caldwell — September 1st, 2011, 8:40 pm
http://example.com/not-yet-available-to-you/
http://example.com/signup-for-group-a/
Statistics: Posted by Jason Caldwell — September 1st, 2011, 5:08 pm
Statistics: Posted by twaycaster — September 1st, 2011, 3:36 pm
Statistics: Posted by Jason Caldwell — September 1st, 2011, 1:12 pm
Statistics: Posted by twaycaster — September 1st, 2011, 12:40 pm
<?php
add_action ('template_redirect', 'my_s2_custom_capabilities');
function my_s2_custom_capabilities()
{
$drips = array(
7 => array(3, 4, 5),
14 => array(6, 7, 8),
21 => array(9, 10, 11),
28 => array(12),
);
if (current_user_can('access_s2member_ccap_a'))
{
foreach ($drips as $drip_day => $drip_pages)
{
if (S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS < $drip_day && is_page($drip_pages))
{
wp_redirect('http://example.com/not-yet-available-to-you/');
exit;
}
}
}
else
{
wp_redirect('http://example.com/signup-for-group-a/');
exit;
}
}
?>
Statistics: Posted by Cristián Lávaque — September 1st, 2011, 1:49 am
Statistics: Posted by twaycaster — August 31st, 2011, 8:18 pm
<?php
add_action ('template_redirect', 'my_s2_custom_capabilities');
function my_s2_custom_capabilities() {
$drips = array(
7 => array(3, 4, 5),
14 => array(6, 7, 8),
21 => array(9, 10, 11),
28 => array(12),
);
if (current_user_can('access_s2member_ccap_a')) {
foreach ($drips as $drip_day => $drip_pages) {
if (S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS < $drip_day && is_page($drip_pages)) {
wp_redirect('http://example.com/not-yet-available-to-you/');
exit;
}
}
} else {
wp_redirect('http://example.com/signup-for-group-a/');
exit;
}
}
?>
Statistics: Posted by Cristián Lávaque — August 30th, 2011, 11:04 pm
Statistics: Posted by twaycaster — August 30th, 2011, 3:55 pm
You might do something like this inside the functions.php file for your WordPress theme.twaycaster wrote:
ccap: group A
at registration Group A gets access to pages 1 2 and 3
at 7 days, they are dripped access to pages 3 4 and 5
at 14 days they are dripped access to pages 6 7 and 8
at 21 days they are dripped access to pages 9 10 and 11
at 28 days they are dripped access to page 12
<?php
add_action ("template_redirect", "my_s2_custom_capabilities");
function my_s2_custom_capabilities ()
{
if (current_user_can ("access_s2member_ccap_a"))
{
if (is_page (array (1, 2, 3)))
{
// Do nothing. They DO have access to these Pages.
}
else if (is_page (array (3, 4, 5)) && S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS < 7)
{
// These Pages are NOT yet available.
wp_redirect ("http://example.com/not-yet-available-to-you/") . exit ();
}
else if (is_page (array (6, 7, 8)) && S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS < 14)
{
// These Pages are NOT yet available.
wp_redirect ("http://example.com/not-yet-available-to-you/") . exit ();
}
else if (is_page (array (9, 10, 11)) && S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS < 21)
{
// These Pages are NOT yet available.
wp_redirect ("http://example.com/not-yet-available-to-you/") . exit ();
}
else if (is_page (12) && S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS < 28)
{
// These Pages are NOT yet available.
wp_redirect ("http://example.com/not-yet-available-to-you/") . exit ();
}
}
else /* Else they do NOT have access to this Custom Capability at all. */
{
// You have no access to group A.
wp_redirect ("http://example.com/signup-for-group-a/") . exit ();
}
}
?>
Statistics: Posted by Jason Caldwell — August 30th, 2011, 1:53 pm
Statistics: Posted by Cristián Lávaque — August 29th, 2011, 5:35 pm
Statistics: Posted by twaycaster — August 29th, 2011, 11:41 am
twaycaster wrote:
and in dripping, I do not see where I put in which pages to drip when.
Statistics: Posted by Cristián Lávaque — August 29th, 2011, 11:31 am
Statistics: Posted by twaycaster — August 25th, 2011, 8:39 am