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™

how do I put name in welcome page?

s2Member Plugin. A Membership plugin for WordPress®.

how do I put name in welcome page?

Postby ilana-av » October 25th, 2011, 7:34 am

Hi
I would like to know where and how I could take the name of my subscriber ,
in order to put it on the welcome page?
thank you
ilana
User avatar
ilana-av
Registered User
Registered User
 
Posts: 7
Joined: October 25, 2011

Re: how do I put name in welcome page?

Postby Eduan » October 25th, 2011, 8:43 am

! Before you read any further, you should install this handy plugin: PHP Execution.
You'll need to have this plugin installed to use PHP code in Posts/Pages.

You can use one of these three:
Code: Select all
S2MEMBER_CURRENT_USER_FIRST_NAME
This will always be a (string) containing the current User's First Name. Empty if not logged in.

<?php echo S2MEMBER_CURRENT_USER_FIRST_NAME; ?>
This may output something like: John
( or whatever their first name is )

---- s2member Shortcode Equivalent ----

[s2Get constant="S2MEMBER_CURRENT_USER_FIRST_NAME" /]



S2MEMBER_CURRENT_USER_LAST_NAME
This will always be a (string) containing the current User's Last Name. Empty if not logged in.

<?php echo S2MEMBER_CURRENT_USER_LAST_NAME; ?>
This may output something like: Smith
( or whatever their last name is )

---- s2member Shortcode Equivalent ----

[s2Get constant="S2MEMBER_CURRENT_USER_LAST_NAME" /]



S2MEMBER_CURRENT_USER_LOGIN
This will always be a (string) containing the current User's Username. Empty if not logged in.

<?php echo S2MEMBER_CURRENT_USER_LOGIN; ?>
This may output something like: johnsmith22
( or whatever their login/username is )

---- s2member Shortcode Equivalent ----

[s2Get constant="S2MEMBER_CURRENT_USER_LOGIN" /]

Also remember to put them in the HTML editor
Now officially accepting Professional s2Member installations along with Bruce C (a.k.a. Ace).

If you're interested in a Professional s2Member Installation, or a Custom Coding Job, you can send your request here.
User avatar
Eduan
Experienced User
Experienced User
 
Posts: 1154
Joined: August 27, 2011
Location: Taxco de Alarcón, Guerrero, México.

Re: how do I put name in welcome page?

Postby ilana-av » October 25th, 2011, 8:50 am

thanks allot
did you mean that I should actually write -Hello S2MEMBER_CURRENT_USER_FIRST_NAME
and the S2MEMBER will put in my welcome page the name of my sbscriber?
like this- Hello Jhon ?
if so why do I need PHP ?
THANKS
ILANA
User avatar
ilana-av
Registered User
Registered User
 
Posts: 7
Joined: October 25, 2011

Re: how do I put name in welcome page?

Postby Eduan » October 25th, 2011, 8:58 am

Yes, but you gotta have PHP Execution and you gotta put
Code: Select all
[s2Get constant="S2MEMBER_CURRENT_USER_FIRST_NAME" /]

Exactly like that.
Now officially accepting Professional s2Member installations along with Bruce C (a.k.a. Ace).

If you're interested in a Professional s2Member Installation, or a Custom Coding Job, you can send your request here.
User avatar
Eduan
Experienced User
Experienced User
 
Posts: 1154
Joined: August 27, 2011
Location: Taxco de Alarcón, Guerrero, México.

Re: how do I put name in welcome page?

Postby ilana-av » October 25th, 2011, 9:15 am

Hi Eduan
Do you mean that I should also write " code:select all"?
or only the green text?
ilana
User avatar
ilana-av
Registered User
Registered User
 
Posts: 7
Joined: October 25, 2011

Re: how do I put name in welcome page?

Postby Eduan » October 25th, 2011, 9:24 am

Only the green text, "CODE: SELECT ALL" is what you click on to select all the code.
Now officially accepting Professional s2Member installations along with Bruce C (a.k.a. Ace).

If you're interested in a Professional s2Member Installation, or a Custom Coding Job, you can send your request here.
User avatar
Eduan
Experienced User
Experienced User
 
Posts: 1154
Joined: August 27, 2011
Location: Taxco de Alarcón, Guerrero, México.

Re: how do I put name in welcome page?

Postby Cristián Lávaque » October 26th, 2011, 12:07 am

You only need the PHP execution plugin if you use PHP code in your post, not if you use the WordPress shortcode. So you can just do:

Code: Select all
Welcome [s2Get constant="S2MEMBER_CURRENT_USER_FIRST_NAME" /]!


WP Admin -> s2Member -> API / Scripting -> s2Member PHP/API Constants

I hope this helps. :)
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


Return to s2Member Plugin

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests

cron