Statistics: Posted by Jason Caldwell — November 15th, 2011, 10:43 pm
Statistics: Posted by peeld — November 15th, 2011, 9:49 pm
<?php
add_action ("wp", "my_custom_capabilities");
function my_custom_capabilities ()
{
if (bp_is_groups_component () && 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_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_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_current_item () == 'hooligans' && !current_user_can ("access_s2member_ccap_hooligan"))
{
header ("Location: " . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit ();
}
}
?>
Statistics: Posted by Jason Caldwell — November 15th, 2011, 5:22 pm
Statistics: Posted by peeld — November 15th, 2011, 2:12 pm
Statistics: Posted by peeld — November 15th, 2011, 1:35 pm
Statistics: Posted by Cristián Lávaque — November 15th, 2011, 1:58 am
Statistics: Posted by peeld — November 14th, 2011, 1:42 am
Statistics: Posted by Cristián Lávaque — November 12th, 2011, 3:44 am
Statistics: Posted by peeld — November 12th, 2011, 1:08 am
Statistics: Posted by Cristián Lávaque — November 12th, 2011, 12:24 am
Statistics: Posted by peeld — November 10th, 2011, 3:19 pm
/** s2member code */
add_action ("template_redirect", "my_custom_capabilities", 1);
function my_custom_capabilities ()
{
if (bp_is_groups_component() && 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_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_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_current_item() == 'hooligans' &&!current_user_can("access_s2member_ccap_hooligan"))
{
header ("Location: " . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit ();
}
}
/** end s2member code */
/** 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;
}
}
Statistics: Posted by peeld — November 9th, 2011, 8:29 pm