Jump to content

Country Flag in Recent Pilots List


freshJet

Recommended Posts

Hey all,

I was adding the Recent Pilots code to my site today and it works fine, but I want the pilot's nationality flag next to their name. I tried editing it myself using the flag code from the profile_public_main.tpl, but it just leaves a space. For those who don't know what I mean, here is an example:

[FLAG IMAGE] VMS001 John Smith

[FLAG IMAGE] VMS002 Michael Jackson

[FLAG IMAGE] VMS003 Bob Marley

[FLAG IMAGE] VMS004 Paul McCartney

[FLAG IMAGE] VMS005 Elvis Presley

:P

Link to comment
Share on other sites

Hey all,

I was adding the Recent Pilots code to my site today and it works fine, but I want the pilot's nationality flag next to their name. I tried editing it myself using the flag code from the profile_public_main.tpl, but it just leaves a space. For those who don't know what I mean, here is an example:

[FLAG IMAGE] VMS001 John Smith

[FLAG IMAGE] VMS002 Michael Jackson

[FLAG IMAGE] VMS003 Bob Marley

[FLAG IMAGE] VMS004 Paul McCartney

[FLAG IMAGE] VMS005 Elvis Presley

:P

Don't know if this will work but you can try this:

 <img src="'.Countries::getCountryImage($pilot->location).'" alt="'.Countries::getCountryName($pilot->location).'" />  

Link to comment
Share on other sites

In frontpage_recentpilots.tpl:

<?php
foreach($pilots as $pilot)
{
?>
<img src="<?php echo Countries::getCountryImage($pilot->location);?>" alt="<?php echo Countries::getCountryName($pilot->location);?>" width="16" height="11" /> <a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>"><?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid). ' ' .$pilot->firstname . ' ' . $pilot->lastname; ?></a><br />
<?php
}
?>

(Loving the example names by the way :lol:)

Link to comment
Share on other sites

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...