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™
1) Can you use the technique you described to assign more than one tag to the same page? For example, I might want a general "Music" tag that I would use to assign the page to a deluxe membership, and another specialized tag for "Jazz" that I would assign to a less all-inclusive membership. (I realize there are other ways to accomplish this with single page tags, but this would be the most convenient for the application I have in mind).
2) Does this use the same "tagging" technique as some of the other Page tagging applications, like "Page Tagger"? The reason I ask is because it would be convenient for me to see the tags on the Page List screen at a glance, rather than to have to open up every individual page to see the tag (I have many pages on my site).
//==================================================================================
//Start out assuming the user does NOT have permissions...
$Permissions_Flag = "N";
//First, check for a simple tag of "R" which I will add to ALL pages I want to restrict, in addition to one
//or more specific tags. If the "R" tag does not exist, by my definition I do not want to restrict this
//page, so no need to check further...
if !has_tag("R")
$Permissions_Flag = "Y";
//Specific permissions tests based on specific tags follow...
else if ((has_tag("music") && current_user_can("access_s2member_ccap_music"))
$Permissions_Flag = "Y";
else if ((has_tag("jazz") && current_user_can("access_s2member_ccap_jazz"))
$Permissions_Flag = "Y";
endif;
//If the permission checks failed to remove the restriction, user will be sent to the
// membership options page...
if $Permissions_Flag == "N" {
header ("Location: ". S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit (); }
endif;
//===============================================================================
if ((has_tag('music') && !current_user_can('access_s2member_ccap_music')) || (has_tag('jazz') && !current_user_can('access_s2member_ccap_jazz'))) {
header('Location: ' . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit;
}
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 ();
}
if (bp_is_groups_component() && bp_current_item() == 'goal-setting-and-mental-management' && !current_user_can('access_s2member_ccap_goalsettingworking') && !current_user_can('access_s2member_ccap_goalsettingauditing')) {
header('Location: ' . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
exit;
}
Users browsing this forum: Google [Bot], Yahoo [Bot] and 1 guest