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™

Attention Cristian

s2Member Plugin. A Membership plugin for WordPress®.

Attention Cristian

Postby roydellray » June 5th, 2011, 5:35 am

Hi again Cristian, you were so helpful last time, I decided to go straight to the main man.

As you might recall the question (viewtopic.php?f=4&t=6311#p14153) last time.

I realised what was causing it.

There is a WP page with a button that logged in users land on, this page then (after clicking button) goes off to my custom php pages which dont have the logout bar. The logged in users subsequently don't log out they just close the window.

1. How do I include the logout bar in my custom code and get it to work
2. Can I put a session into a WP Page and how. This will hopefully control the inadvertant logouts
User avatar
roydellray
Registered User
Registered User
 
Posts: 12
Joined: May 4, 2011

Re: Attention Cristian

Postby Cristián Lávaque » June 5th, 2011, 11:23 am

I see. Well, maybe you'll find something helpful with a search like this http://www.google.com.mx/search?q=wordp ... in+outside

If you don't need to bother checking the status of the person, you could have a logout link that's always there /wp-login.php?action=logout&redirect_to=/
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Attention Cristian

Postby roydellray » June 5th, 2011, 5:15 pm

Thanks again Cristian
I am sorry to have bothered you, but as they say, you want the right answers, ask the right people.
I will try this and keep you posted.
User avatar
roydellray
Registered User
Registered User
 
Posts: 12
Joined: May 4, 2011

Re: Attention Cristian

Postby Jason Caldwell » June 5th, 2011, 5:21 pm

Cristián Lávaque wrote:I see. Well, maybe you'll find something helpful with a search like this http://www.google.com.mx/search?q=wordp ... in+outside

If you don't need to bother checking the status of the person, you could have a logout link that's always there /wp-login.php?action=logout&redirect_to=/

Just a quick note here. Something that's bitten me in the past.
WordPress requires a "logout" request to be accompanied by an "nonce" for verification. So the proper way to create a logout link with a redirection, is with this function call. This does the same thing your manual entry accomplishes, but it does it without a warning notification from WordPress.
Code: Select all
<?php echo wp_logout_url("/"); ?>
See: http://codex.wordpress.org/Function_Ref ... logout_url
~ 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: Attention Cristian

Postby Cristián Lávaque » June 6th, 2011, 12:43 am

Thanks for the heads up, Jason! :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Attention Cristian

Postby roydellray » June 6th, 2011, 12:49 am

That comes from me tooooooo
User avatar
roydellray
Registered User
Registered User
 
Posts: 12
Joined: May 4, 2011

Hi again Cristian and also Jason

Postby roydellray » June 15th, 2011, 11:11 pm

I tried your links but because I'm not WP savvy, none of it made much sense. i am going to try to learn the WP API soon, but at the moment I'm bogged down in raw PHP/MySQL dev.

So if there is a code snippet either of you could share with me on how to call the s2Member logout function from a custom PHP page I would be most greatful. I have the button already to go, just need the code and what to include.

THANKS :mrgreen:

ps. my pages live in wp-content/mypages

where "mypages" is the name of the folder where most of my cust PH lives, the rest live in wp-includes
User avatar
roydellray
Registered User
Registered User
 
Posts: 12
Joined: May 4, 2011

Re: Attention Cristian

Postby Cristián Lávaque » June 15th, 2011, 11:23 pm

Roy, maybe this will help viewtopic.php?p=9683#p9683
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Attention Cristian

Postby roydellray » June 16th, 2011, 12:03 am

Thanks again Cristian,
This was great, and I watched the video too.
This tells me if they are logged in, how do I log them out, or did I miss something
User avatar
roydellray
Registered User
Registered User
 
Posts: 12
Joined: May 4, 2011

Re: Attention Cristian

Postby Cristián Lávaque » June 16th, 2011, 12:19 am

Well, once you include that file, you're in WordPress, you can use all the WP functions, etc. You could copy the login/logout code from a theme or widget that has it, for example, and use it in your script.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Attention Cristian

Postby roydellray » June 16th, 2011, 12:31 am

Ok thanks, your a little bit sneeky on the "giving up code bit", but I get your drift,
I will investigate ..................................

Thanks again.
User avatar
roydellray
Registered User
Registered User
 
Posts: 12
Joined: May 4, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 1 guest

cron