HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


{$*} Grab

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#107461 (In Topic #20938)
Avatar

Fan in training

Hi, I know that you can grab the username of someone who logs-in using {$USERNAME*} and the Site name using {$SITE_NAME*}, but can someone please tell me how to get someone's First Name and Last Name? I'd like it to show when they Log-in, because we'll be using number codes for the usernames. (Putting in their employee id as the username) Thank you very much! :)
Back to the top
 
Posted
Item has a rating of 5 (Liked by Chris GrahamLiked by RichTLiked by MrsWaffles)  
Rating:
#107469
Avatar

Community saint

You can use custom profile fields (CPF's) with the {$CPF_VALUE,cpf name or id number} tempcode symbol. Assuming you haven't changed the names of those fields in your site configuration you could use this to display the first and last name of the logged in member and display Guest if a member isn't logged in:

Code

{+START,IF_NON_EMPTY,{$CPF_VALUE,First name}}{$CPF_VALUE,First name}{+END} {+START,IF_NON_EMPTY,{$CPF_VALUE,Last name}}{$CPF_VALUE,Last name}{+END}{+START,IF_EMPTY,{$CPF_VALUE,First name}{$CPF_VALUE,Last name}}Guest{+END}


If the page is only available to members and you don't need the Guest name to display for non-members, you could just simply use:

Code

{$CPF_VALUE,First name} {$CPF_VALUE,Last name}


You can see other CPF's available by going to your site AdminZone>Tools>Members>Custom Profile Fields>Edit Custom Profile Field

There, any field that has an Edit link in the Actions column can be used. You can use the name from the Name column as the parameter passed to the {$CPF_VALUE} tempcode symbol, or if you hover over the Edit link you will get a little overlay popup with a number that you can use instead.
Back to the top
 
Posted
Item has a rating of 5 (Liked by Jason Verhagen)  
Rating:
#107470
Avatar

Fan in training

Oh wow, thank you so much! Just what I needed. :)
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: