Jump to content

Recommended Posts

Posted

Quick question.

I had a staff member ask me if there was a way to only show their last name initial instead of their full last name? They didn't like the fact that where ever their name showed up it is their full name. Is this possible?

I personally don't care one way or the other but I figured I'd ask.:D

Thanks,

Keith

  • 2 months later...
Posted

I never got this to work and I kind of forgot about it until now.

Here is what the code is in two of the templates I would need to edit.

In Pilot_List.tpl I have

<?php echo $pilot->firstname.'  '.$pilot->lastname?>

In Pilot_Public_Porfile.tpl I have

<?php echo  $userinfo->firstname . ' ' . $userinfo->lastname?>

How would I change that to not show the last name since it is not using the format above?

Thanks...

  • Administrators
Posted

Just add a [0] to the lastname, so:

$userinfo->lastname[0]

Basically a string is an array of characters, so by doing [0], you're telling it to only take the first element of the array

Posted

Just add a [0] to the lastname, so:

$userinfo->lastname[0]

Basically a string is an array of characters, so by doing [0], you're telling it to only take the first element of the array

That worked!

Thank you for your help!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...