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™
add_action ("template_redirect", "my_custom_capabilities", 1);
function my_custom_capabilities ()
{
if ( bp_is_groups_component() && 'name-of-group' == bp_current_item() && !current_user_can ("access_s2member_ccap_customname"))
{
header ("Location: " . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit ();
}
}
add_action ("template_redirect", "my_custom_capabilities", 1);
function my_custom_capabilities ()
{
if ( bp_is_groups_component() && 'groupA' == bp_current_item() && !current_user_can ("access_s2member_ccap_groupA"))
{
header ("Location: " . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit ();
}
}
add_action ("template_redirect", "my_custom_capabilities", 1);
function my_custom_capabilities ()
{
if ( bp_is_groups_component() && 'groupA' == bp_current_item() && !current_user_can ("access_s2member_ccap_groupAauditing"))
{
header ("Location: " . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit ();
}
}
add_action ("template_redirect", "my_custom_capabilities", 2);
function my_custom_capabilities ()
{
if ( bp_is_groups_component() && 'groupA' == bp_current_item() && !current_user_can ("access_s2member_ccap_groupAauditing"))
{
header ("Location: " . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit ();
}
}
else if (bp_is_groups_component() &&
'goal-setting-and-mental-management' == bp_current_item() &&
(!current_user_can ("access_s2member_ccap_goalsettingworking") || !current_user_can ("access_s2member_ccap_goalsettingauditing")))
{header ("Location: " . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit ();
}
else if ((bp_is_groups_component() &&
'goal-setting-and-mental-management' == bp_current_item() &&
(!current_user_can ("access_s2member_ccap_goalsettingworking")) ||(bp_is_groups_component() &&
'goal-setting-and-mental-management' == bp_current_item() &&
(!current_user_can ("access_s2member_ccap_goalsettingauditing")))
{header ("Location: " . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit ();
}
/** 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 */
Or if you wanted to show something on every single group page, regardless if it was the home page or not:
<?php if ( bp_is_groups_component() && bp_is_single_item() ) : ?> Show this on all single group pages <?php endif; ?>
/** s2member code */
add_action ("template_redirect", "my_custom_capabilities", 1);
function my_custom_capabilities ()
{
if (bp_is_groups_component() && bp_current_item() && bp_is_single_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() && bp_is_single_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() && bp_is_single_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() && bp_is_single_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() == '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() == '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() == '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() == 'hooligans' &&
!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 2 guests