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™

Register/Login

s2Member Plugin. A Membership plugin for WordPress®.

Register/Login

Postby wesleysoccer » August 4th, 2011, 2:05 pm

What is the best way to add some php to my header so it say's "Register/Login" and after login has taken place it will now only show a "Welcome, Name" in replace of the "Register/Login" text?

I know how to add the Welcome, Name to appear after a login but was wondering if there is a way to add the register/login then it will add Welcome note...

Thanks

This is what I'm using to show up in header after someone logs in

<?php if (S2MEMBER_CURRENT_USER_IS_LOGGED_IN){ ?><a href="http://" title="My Homepage">Welcome, <?php echo S2MEMBER_CURRENT_USER_FIRST_NAME; ?></a> | <a href="<?php echo S2MEMBER_LOGOUT_PAGE_URL; ?>"title="Sign Out"> Sign Out</a><?php } ?>
User avatar
wesleysoccer
Registered User
Registered User
 
Posts: 83
Joined: January 31, 2011

Re: Register/Login

Postby Cristián Lávaque » August 5th, 2011, 12:48 am

Something like this?

Code: Select all
<?php if (S2MEMBER_CURRENT_USER_IS_LOGGED_IN){ ?>
    <a href="http://" title="My Homepage">Welcome, <?php echo S2MEMBER_CURRENT_USER_FIRST_NAME; ?></a> | <a href="<?php echo S2MEMBER_LOGOUT_PAGE_URL; ?>">Logout</a>
<?php } else { ?>
    <a href="<?php echo S2MEMBER_LOGIN_PAGE_URL; ?>">Login</a> | <a href="<?php echo S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL; ?>">Signup</a>
<?php } ?>
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: Register/Login

Postby wesleysoccer » August 5th, 2011, 10:50 pm

Thanks...The only issue is I want the Register Now button to disappear and replace with Welcome, | Sign-out...Is this possible...
User avatar
wesleysoccer
Registered User
Registered User
 
Posts: 83
Joined: January 31, 2011

Re: Register/Login

Postby Cristián Lávaque » August 6th, 2011, 12:32 am

Yes, that's what I replied above. If logged in, show welcome|logout, otherwise, login|signup.
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: Register/Login

Postby wesleysoccer » August 6th, 2011, 7:22 am

ok..I will try again.
User avatar
wesleysoccer
Registered User
Registered User
 
Posts: 83
Joined: January 31, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 2 guests

cron