Pilot Country Flags

Ok - I’m Stumped… ???

I have added the pilot country flags to show next to the pilots name in the recent pilots list. It works fine on most of the pages of the site but on some pages the image does not show, just a place holder. Upon further investigation I have found that on the pages it does not show it has extra lines in the url..

example -

on the front page - shows

/newenglandair/lib/images/countries/US.png’>http://www.simpilotgroup.com/newenglandair/lib/images/countries/US.png

on the login page - no show

http://www.simpilotgroup.com/newenglandair/newenglandair/lib/images/countries/US.png

The sidebar is a template so the same code is being used on all the pages… Is it a module issue?

Also, it always produces the image name in caps which will not show the image, I have made a duplicate of the flag using caps and it shows fine but I do not want to have to create a duplicate for all the flags. Is there a way around this?

What’s the code you’re using on the login page?

It should be something like (on all pages:)

<img src="<?php echo SITE_URL;?>/lib/images/countries" />

But how are you getting the images?

This what is being used -

<a href=“<?php echo SITE_URL?>/index.php/profile/view/<?php echo $pilot->pilotid?>”><?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid). ’ ’ .$pilot->firstname . ’ ’ . $pilot->lastname?></a>&nbsp&nbsp<img src=“<?php echo SITE_URL?>/lib/images/countries/<?php echo $pilot->location?>.png”><br />

It is in a template for the left sidebar that is called up the same way in all the pages.

Try this

<img src="<?php echo Countries::getCountryImage($pilot->location);?>"  alt="<?php echo Countries::getCountryName($pilot->location);?>" />

Thanks Nabeel - That got it working  ;D