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™

Making restricted pages send users to registration page

s2Member Plugin. A Membership plugin for WordPress®.

Making restricted pages send users to registration page

Postby seacoast » June 25th, 2010, 9:59 am

I want to block a section of my site I do not control (feed generated). I am able to block the section after blocking a specific http://www.example.com/example2/ url.

My question, is there away to make it direct to the login page?

Second question, is there away to make it direct to the login page after so many seconds have gone by?


Thanks!
User avatar
seacoast
Registered User
Registered User
 
Posts: 2
Joined: June 25, 2010

Re: Making restricted pages send users to registration page

Postby Jason Caldwell » June 26th, 2010, 1:59 am

Yes, you can add this to the functions.php file for your theme.

Code: Select all
add_action("template_redirect", "redirect_membership_options_to_login");

function redirect_membership_options_to_login(){
    $mop = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"];
    if($mop && is_page($mop) && isset($_GET["s2member_level_req"])){
        header("Location: " . wp_login_url()); exit;
    }
}
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Making restricted pages send users to registration page

Postby Jason Caldwell » June 26th, 2010, 2:00 am

Second question, is there away to make it direct to the login page after so many seconds have gone by?

Sure. Please explain exactly what you're trying to accomplish though.
There are few different things, but it depends on what you're trying to do exactly.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Making restricted pages send users to registration page

Postby seacoast » June 26th, 2010, 12:00 pm

Your awesome.

I have a real estate website that uses an idx feed. My goal is to allow readers to view the first couple pages first, but after that be required to login. This means that I do not turn away first visitors, but that I can still capture leads... higher quality than if I made everyone sign up.

Also... do you have a place I can donate? I don't think I have a need for the "premium" s2member plugin, but would still like to contribute.

Thanks!
User avatar
seacoast
Registered User
Registered User
 
Posts: 2
Joined: June 25, 2010

Re: Making restricted pages send users to registration page

Postby Jason Caldwell » June 27th, 2010, 7:29 am

Thank you very much the kudos!

I have a real estate website that uses an idx feed. My goal is to allow readers to view the first couple pages first, but after that be required to login. This means that I do not turn away first visitors, but that I can still capture leads... higher quality than if I made everyone sign up.

OK, I see what you're trying to accomplish. Let me soak on that one for a bit. I'll get back to you.

@TODO - Delayed access control hack/code snippet/feature.. : soaking.

Also... do you have a place I can donate? I don't think I have a need for the "premium" s2member plugin, but would still like to contribute.

Yes, that is very nice of you to ask.
http://www.primothemes.com/donate/
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 1 guest

cron