Page 1 of 1

Excludes on full locked site

PostPosted: November 23rd, 2011, 7:53 am
by kaesarius
hi all,

I have decided to take the membership to a subdomain of my main domain. So the domain is only the page that offers the service and the subdomain is the membership with all the content.

Reading some threads here I have managed to block the site entirely. Only by putting "/" on restrictions "URI" I have it. :P

But, I need to grant access to 4 pages, page options, subscription forms for each option.

How can I exclude these 4 pages of the restriction uri?

Ones again, thanks.

Re: Excludes on full locked site

PostPosted: November 24th, 2011, 8:04 am
by kaesarius
Finally i get a solution:
if anyone needs, create a file called s2-hacks.php on /wp-content/mu-plugins forlder to save it with this content:

Code: Select all
<?php

add_filter ("ws_plugin__s2member_check_post_level_access_excluded", "my_s2_exclusions");
add_filter ("ws_plugin__s2member_check_page_level_access_excluded", "my_s2_exclusions");

/* Now build the function. */ function my_s2_exclusions ($s2_says = FALSE)
    {
        global $page; /* Global ```$post`` object reference. */
        /**/
        if (is_page(array(304,492,496,639,1001,940,267))){
            return /* Exclude it, because it's allowed by Specific Post/Page Restrictions. */
         ($my_s2_says = true);}
        /**/
        return /* Otherwise return whatever s2Member says. */ $s2_says;
    }
?>


i hope it help.

Re: Excludes on full locked site

PostPosted: November 24th, 2011, 8:06 am
by Eduan
Thanks kaesarius!
I'm sure it will come in handy!