Jump to content

Recommended Posts

  • Moderators
Posted

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

  • Like 1
Posted

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.

  • Like 1
Posted

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?!

  • Like 1
Posted

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?! :huh: Believe me, that may very well be the case. :D

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

  • Like 1
Guest lorathon
Posted

Rafael? Why are you asking me to comment on this post? What is with people these days and the lack of patience? Please do not PM me to comment on something or to check something out. I comment on items that I think need it. Mark seems to have this one under control.

  • Moderators
Posted

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?

  • 2 months later...
Posted

Hi, i add my code:

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

but for pilots with one flight the result are:

http://bluepanoramava.joomlafree.it/phpVMS/index.php/profile/view/3233

and for pilots without one flight the result are:

http://bluepanoramava.joomlafree.it/phpVMS/index.php/profile/view/9139

Why???

Thanks!

Posted

Hi, i add my code:

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

but for pilots with one flight the result are:

http://bluepanoramav...ofile/view/3233

and for pilots without one flight the result are:

http://bluepanoramav...ofile/view/9139

Why???

Thanks!

Replace

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

to

echo '<p>Sorry No recent flights have been found</p>';

(that removes the extra </div>)

Kindest Regards,

James

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