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™
twaycaster wrote:With ccaps, the code he uses is different then the code under s2member / scripting
twaycaster wrote:and in dripping, I do not see where I put in which pages to drip when.
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 ();
}
}
?>
<?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;
}
}
?>
<?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;
}
}
?>
http://example.com/not-yet-available-to-you/
http://example.com/signup-for-group-a/
Users browsing this forum: Google [Bot] and 2 guests