Page 1 of 1

Login/logout/username status

PostPosted: December 16th, 2011, 5:11 pm
by jlapides2
Hi:

I'm a newbie. Have got a lot setup but can't find how to get a standard login/logout[username] status appearing on the menu.

In other words, the menu shows login when the member has not logged in, and then logout[username] when they are logged in.

Thanks,

Jeff Lapides

Re: Login/logout/username status

PostPosted: December 16th, 2011, 6:45 pm
by Eduan
This post may be if interest for this:
viewtopic.php?f=36&t=2781

If I'm wrong please post a screenshot so that we have a better understanding of what you need.

Hope this helps. :)

Re: Login/logout/username status

PostPosted: December 16th, 2011, 8:16 pm
by jlapides2
This is leading me in the right direction toward some other free plugins but they are not apparently for the menu bar. I want standard login/logout handling in the menu, not the sidebar or somewhere else.

What I want might work in the Pro version, but I'm not spending any money til I am assured the basics work. I consider this a basic. This is my third membership plug-in that I have tried this week. This one is pretty good but I am spending too much time dealing with something that should be simple.

Jeff

Re: Login/logout/username status

PostPosted: December 16th, 2011, 10:44 pm
by Eduan
Could you show me a screenshot with an example of what you want?
Otherwise I'm not sure I understand you.

Re: Login/logout/username status

PostPosted: December 17th, 2011, 12:40 pm
by jlapides2
Eduan:

Here are two sets of examples.

1. The second is from Fine Homebuilding. This is pretty close to what I want. The first screen has both a login and create account option. After you login the screen changes to show you your name so you know you have logged in, a logout option and another link to update your account for email changes, etc.

2. The first is from Primothemes' own site. It is almost what I want but does not have the link to membership info for changes to email address, etc.

Hope this clear things up. Thanks for you help.

Jeff Lapides

Re: Login/logout/username status

PostPosted: December 17th, 2011, 6:54 pm
by Raam Dev
Hi Jeff,

s2Member Pro can certainly accomplish what you're asking for. With s2Member Pro, you can create a free registration form (if that's what you want, otherwise you could create a paid registration form) on a WordPress page called "Register". You'd need to place the link to the Register page in your menu (or wherever else in the theme you want it to show up).

s2Member provides a set of shortcode conditionals that you can use to do things like check if the visitor is logged in, display their name, etc. Using these conditionals, you could show the Register link if they're not logged in and display their name, along with a link to edit their profile, when they are logged in (s2Member provides a shortcode that you can use on a "My Profile" page, which generates a form that allows the logged-in user to edit things like their email address, name, password, etc.).

For example, here's how this might look using the s2Member shortcode conditionals:
[s2If is_user_logged_in()]
Welcome [s2Get constant="S2MEMBER_CURRENT_USER_DISPLAY_NAME" /]! | <a href="/my-account/">Update Account</a> | <a href="/wp-login.php?action=logout">Logout</a>
[/s2If]

[s2If !is_user_logged_in()]
<a href="/register/">Create an Account</a> | <a href="/wp-login.php">Login</a>
[/s2If]


There are also PHP versions of these same examples in WP Admin -> s2Member -> API/Scripting -> Advanced/PHP Conditionals. You can use the PHP versions directly in your theme template files to gain finer control over where things show up.

Please see these two videos for a better idea how Advanced Conditionals and API Scripting in s2Member works:

http://www.s2member.com/advanced-conditionals-video/
http://www.s2member.com/api-scripting-overview-video/

Does that answer your question?

Re: Login/logout/username status

PostPosted: December 17th, 2011, 10:31 pm
by jlapides2
Thanks for your reply. I will check this out tomorrow.

Jeff

Re: Login/logout/username status

PostPosted: December 19th, 2011, 5:31 am
by Cristián Lávaque
Jeff, the login widgets Eduán linked to would do what you request, show change the login/logout link depending on your session.

Raam's conditionals would also do what you want and not just in a text widget, but also in a post/page, and they don't require s2Member Pro to work.

You may also find the loginout function helpful. http://codex.wordpress.org/Function_Ref ... p_loginout