Map of the last flights of the pilot

Can someone pass me the HTML of the statement of the last flights of the pilot?

Example: http://www.easyjetva.com/index.php/profile/view/1001 (Pilots Recent Flights)

Where do you want to display it, Pilots Public profile or pilots profile?

The code is on this forum

Public

Here you go,

<?php
if(!$pireps)
{
  echo '<p>Sorry No recent flights have been found</p></div>';
  return;
}
 $flights = PIREPData::getLastReports($userinfo->pilotid, '20');                                                                     
       $string = "";
       foreach($flights as $flight)
       {       
               $string = $string.$flight->depicao.'+-+'.$flight->arricao.',+';
       }
?>
<p align="center"><strong>Pilots Recent Flights</strong><br /><img src="http://www.gcmap.com/map?P=<?php echo $string ?>&MS=bm&MR=240&MX=685x360&PM=pemr:star10:white%2b%22%25I%22:white&PC=orange" /><br />
             Maps generated by the <a href="http://www.gcmap.com/">Great Circle Mapper</a> - copyright © <a href="http://www.kls2.com/~karl/">Karl L.Swartz</a></p>

You may want to customize how many line 7 plus you may need to remove that div after the end of sorry no flight have been found depending what skin your using.

Plus this bit you can customize as you wish, go over to Karl’s site and you can see the variables,

PM=pemr:star10:white%2b%22%25I%22:white&PC=orange
1 Like

If I want to put on the page of the pilot (http://flydeltava.org/index.php/profile/view/1) Should I put in Profile_main?

If you put it into the profile_main.tpl and take out this part of the code:

if(!$pireps)

{

echo ‘<p>Sorry No recent flights have been found</p></div>’;

return;

}

it works. Just not sure if that is correct, or not…but it seems to work for me.

1 Like

I put, so he stayed in the pilot center, not on the page of the pilot (http://flydeltava.org/index.php/profile/view/1). How do I put on this page?

How do I put the pilot on the page? in> http://flydeltava.org/index.php/profile/view/1

To clarify what I did…

In my pilot_public_profile.tpl I added this code:

<?php

if(!$pireps)

{

echo ‘<p>Sorry No recent flights have been found</p></div>’;

return;

}

$flights = PIREPData::getLastReports($userinfo->pilotid, ‘5’);

$string = “”;

foreach($flights as $flight)

{

$string = $string.$flight->depicao.‘±+’.$flight->arricao.‘,+’;

}

?>

<p align=“center”><strong>Pilots Recent Flights</strong><br /><img src=“http://www.gcmap.com/map?P=<?php echo $string ?>&MS=bm&MR=240&MX=685x360&PM=pemr:star10:red%2b%22%25I%22:white&PC=blue” /><br />

Maps generated by the <a href="http://www.gcmap.com/">Great Circle Mapper</a> - copyright © <a href="http://www.kls2.com/~karl/">Karl L.Swartz</a></p>

and this is my resulting page: http://www.canadianclassicairlines.com/CPC/index.php/profile/view/1’>http://www.canadianclassicairlines.com/CPC/index.php/profile/view/1

In my profile_main.tpl I added this code:

<?php

$flights = PIREPData::getLastReports($userinfo->pilotid, ‘5’);

$string = “”;

foreach($flights as $flight)

{

$string = $string.$flight->depicao.‘±+’.$flight->arricao.‘,+’;

}

?>

<p align=“center”><strong>Pilots Recent Flights</strong><br /><img src=“http://www.gcmap.com/map?P=<?php echo $string ?>&MS=bm&MR=240&MX=685x360&PM=pemr:star10:red%2b%22%25I%22:white&PC=blue” /><br />

Maps generated by the <a href="http://www.gcmap.com/">Great Circle Mapper</a> - copyright © <a href="http://www.kls2.com/~karl/">Karl L.Swartz</a></p>

and this is my resulting page: http://www.canadianclassicairlines.com/CPC/index.php/profile

Is that what you need Rafael?!

1 Like

That code will work in the public_pilot_profile.tpl only, i think you need different variables for the pilots profile main.

Thats why i asked where is it for.

Mark, but it seemingly IS showing the individual pilots flights?! I gave 2 different links and all I did on the second one was take out the code

if(!$pireps)

{

echo ‘<p>Sorry No recent flights have been found</p></div>’;

return;

}

to make it work with profile_main.tpl?!

Or am I just a total moron?! Believe me, that may very well be the case.

(Or are you just talking to Rafael, not me)

1 Like

Was talking to Rafael

What is it you want the pilots last flights or the VA’s last flights?

Pilot_public_profile.tpl not have the folders on my template.

Also if you want a response then dont leave me comments on my profile, your more likely to get something by leaving here in the thread.

The code i posted will show the pilots last flights, if you want the last flights of the VA then that code is different.

What is it exactly that you need?

Sorry lorathon

Pilot_public_profile.tpl not have the folders on my template.

There is a file called pilot_public_profile.tpl, if its not in your skins folder then look in the core templates folder then move it to your skins folder and customise.

1 Like

Look at the picture, do not have “pilot_public_profile.tpl”

Go to your core > templates in there it will be

1 Like

Thanks, I got;) (http://flydeltava.org/index.php/profile/view/1)

you know the code to display the map for flights booked on "View bids my flight?