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™
/** s2member code */
add_action ("template_redirect", "my_custom_capabilities", 1);
function my_custom_capabilities ()
{
if (bp_is_groups_component() && bp_is_single_item() && bp_current_item() == 'goal-setting-and-mental-management' && !current_user_can('access_s2member_ccap_goalsettingworkingfall2011') && !current_user_can('access_s2member_ccap_goalsettingauditingfall2011')) {
header('Location: ' . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit;
}
else if (bp_is_groups_component() && bp_is_single_item() && bp_current_item() == 'runningcontacts-i' && !current_user_can("access_s2member_ccap_runningcontactsiworkingfall2011") && !current_user_can('access_s2member_ccap_runningcontactsiauditingfall2011'))
{
header ("Location: " . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit ();
}
else if ( bp_is_groups_component() && bp_is_single_item() && bp_current_item() == 'agility-foundation' && !current_user_can("access_s2member_ccap_foundationclassworkingfall2011") && !current_user_can('access_s2member_ccap_foundationclassauditingfall2011'))
{
header ("Location: " . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit ();
}
else if ( bp_is_groups_component() && bp_is_single_item() && bp_current_item() == 'hooligans' &&
!current_user_can("access_s2member_ccap_hooligan"))
{
header ("Location: " . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit ();
}
}
/** end s2member code */
add_action('template_redirect', 'my_custom_capabilities', 1);
function my_custom_capabilities()
{
if ((bp_is_groups_component() && bp_is_single_item()) && (
(bp_current_item() == 'goal-setting-and-mental-management' && !current_user_can('access_s2member_ccap_goalsettingworkingfall2011') && !current_user_can('access_s2member_ccap_goalsettingauditingfall2011')) ||
(bp_current_item() == 'runningcontacts-i' && !current_user_can('access_s2member_ccap_runningcontactsiworkingfall2011') && !current_user_can('access_s2member_ccap_runningcontactsiauditingfall2011')) ||
(bp_current_item() == 'agility-foundation' && !current_user_can('access_s2member_ccap_foundationclassworkingfall2011') && !current_user_can('access_s2member_ccap_foundationclassauditingfall2011')) ||
(bp_current_item() == 'hooligans' && !current_user_can('access_s2member_ccap_hooligan'))
))
{
header('Location: ' . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit;
}
}
/**s2member code */
add_action ("template_redirect", "my_custom_capabilities", 1);
function my_custom_capabilities ()
{
if (fnmatch ("/classes/goal-setting-and-mental-management*", $_SERVER["REQUEST_URI"]) && !current_user_can("access_s2member_ccap_goalsettingworkingfall2011") && !current_user_can("access_s2member_ccap_goalsettingauditingfall2011"))
{
header ("Location: " . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit ();
}
else if (fnmatch ("/classes/runningcontacts-i*", $_SERVER["REQUEST_URI"]) && !current_user_can("access_s2member_ccap_runningcontactsiworkingfall2011") && !current_user_can("access_s2member_ccap_runningcontactsiauditingfall2011"))
{
header ("Location: " . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit ();
}
else if (fnmatch ("/classes/agility-foundation*", $_SERVER["REQUEST_URI"]) && !current_user_can("access_s2member_ccap_foundationclassworkingfall2011") && !current_user_can("access_s2member_ccap_foundationclassauditingfall2011"))
{
header ("Location: " . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit ();
}
else if (fnmatch ("/classes/hooligans*", $_SERVER["REQUEST_URI"]) && !current_user_can("access_s2member_ccap_hooligan"))
{
header ("Location: " . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit ();
}
}
/**end s2member code */
Return to Common Questions/Problems/Tips
Users browsing this forum: No registered users and 1 guest