Hi guys, for privacy reasons, I have to display only the name of the pilot and the first character of the last name, how can I edit this code?
<?php echo $pilot->firstname.β '.$pilot->lastname?>
Grace for a possible response
Hi guys, for privacy reasons, I have to display only the name of the pilot and the first character of the last name, how can I edit this code?
<?php echo $pilot->firstname.β '.$pilot->lastname?>
Grace for a possible response
Try this
<?php echo $pilot->firstname .β '. substr ($pilot->lastname, 0, 1)?>
https://www.w3schools.com/php7/func_string_substr.asp
Iβve done the same everywhere on the user/public side of my site. On the admin side, I still show complete last name.
10 hours ago, ProAvia said:
Try this
<?php echo $pilot->firstname .β '. substr ($pilot->lastname, 0, 1)?>
https://www.w3schools.com/php7/func_string_substr.asp
Iβve done the same everywhere on the user/public side of my site. On the admin side, I still show complete last name.
Thank you. Very kind
<?php
$usersonline = StatsData::UsersOnline();
$guestsonline = StatsData::GuestsOnline();
?>
<h5><?php
$shown = array();
foreach($usersonline as $pilot)
{
if(in_array($pilot->pilotid, $shown))
continue;
else
$shown = $pilot->pilotid;
echo β<p>β;
echo β<img src=β/en/lib/skins/crewcenter/images/pilot.pngβ class=βimg-circleβ alt=βUser Imageβ height=β20β> <img src="β.Countries::getCountryImage($pilot->location).β" alt="β.Countries::getCountryName($pilot->location).β " width=β17β height=β17β />';
echo β <Strong>β.$pilot->firstname.β</strong> β.$pilot->lastname.β<br />';
echo β<small></small>β;
echo β</p>β;
}
?>
On the highlighted line I have problems
\<h5\> \<?php $usersonline = StatsData::UsersOnline(); $guestsonline = StatsData::GuestsOnline(); $shown = array(); foreach($usersonline as $pilot) { if(in\_array($pilot-\>pilotid, $shown)) continue; else $shown[] = $pilot-\>pilotid; echo "\<p\>"; echo '\<img src="/en/lib/skins/crewcenter/images/pilot.png" class="img-circle" alt="User Image" height="20"\> \<img src="'.Countries::getCountryImage($pilot-\>location).'" alt="'.Countries::getCountryName($pilot-\>location).' " width="17" height="17" /\>'; echo ' \<strong\>'.$pilot-\>firstname.'\</strong\> '.substr($pilot-\>lastname, 0, 1).'\<br /\>'; echo '\<small\>\</small\>'; echo "\</p\>"; } ?\>
5 minutes ago, PaintSplasher said:
<h5> <?php $usersonline = StatsData::UsersOnline(); $guestsonline = StatsData::GuestsOnline(); $shown = array(); foreach($usersonline as $pilot) { if(in_array($pilot->pilotid, $shown)) continue; else $shown = $pilot->pilotid; echo β<p>β; echo β<img src=β/en/lib/skins/crewcenter/images/pilot.pngβ class=βimg-circleβ alt=βUser Imageβ height=β20β> <img src="β.Countries::getCountryImage($pilot->location).β" alt="β.Countries::getCountryName($pilot->location).β " width=β17β height=β17β />β; echo β <strong>β.$pilot->firstname.β</strong> β.substr($pilot->lastname, 0, 1).β<br />β; echo β<small></small>β; echo β</p>β; } ?>
Thank you.