Statistics: Posted by Cristián Lávaque — November 12th, 2011, 2:13 am
Statistics: Posted by peeld — November 8th, 2011, 12:02 pm
/**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 */
Statistics: Posted by peeld — November 6th, 2011, 9:02 pm
Statistics: Posted by peeld — November 6th, 2011, 10:07 am
Statistics: Posted by Cristián Lávaque — November 5th, 2011, 9:59 pm
Statistics: Posted by peeld — November 4th, 2011, 6:38 pm
Statistics: Posted by peeld — November 4th, 2011, 6:17 pm
/** 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 Cristián Lávaque — November 4th, 2011, 12:52 am
Statistics: Posted by peeld — November 3rd, 2011, 12:58 pm
Statistics: Posted by peeld — November 3rd, 2011, 12:54 pm
Statistics: Posted by peeld — November 3rd, 2011, 12:29 pm
/** 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 */
Statistics: Posted by peeld — November 3rd, 2011, 12:01 pm
/** 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 */
Statistics: Posted by peeld — November 3rd, 2011, 11:50 am
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; ?>
Statistics: Posted by Cristián Lávaque — October 29th, 2011, 11:18 pm
Statistics: Posted by peeld — October 27th, 2011, 9:13 pm
Statistics: Posted by Cristián Lávaque — October 27th, 2011, 5:31 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 */
Statistics: Posted by peeld — October 22nd, 2011, 5:24 pm
Statistics: Posted by Cristián Lávaque — September 8th, 2011, 4:27 am
Statistics: Posted by peeld — September 7th, 2011, 12:04 pm
Statistics: Posted by Cristián Lávaque — September 7th, 2011, 4:03 am
Statistics: Posted by peeld — September 5th, 2011, 11:38 pm
Statistics: Posted by Cristián Lávaque — August 31st, 2011, 2:28 am
Statistics: Posted by peeld — August 30th, 2011, 3:56 pm
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 ();
}
Statistics: Posted by peeld — August 29th, 2011, 2:34 am