md82 Posted June 3, 2015 Report Share Posted June 3, 2015 Hi everyone! I have the Great Circle Maps currently on my pilot profiles. I would like to use google maps to show the last 15 flights instead. Thanks Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted June 5, 2015 Members Report Share Posted June 5, 2015 To be honest i do not quite understand your request as mine setup shows last flight already on google maps do yo have a link of the page or a screenshot of your browser ? Quote Link to comment Share on other sites More sharing options...
flynryan692 Posted June 6, 2015 Report Share Posted June 6, 2015 To be honest i do not quite understand your request as mine setup shows last flight already on google maps do yo have a link of the page or a screenshot of your browser ? He is saying he has this, and would like it to be in google maps rather than gcmap. Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted June 6, 2015 Members Report Share Posted June 6, 2015 Now i understand thx flynryan692 Hi everyone! I have the Great Circle Maps currently on my pilot profiles. I would like to use google maps to show the last 15 flights instead. Thanks At the moment there is no easy way you can do it except if you write a function to do it Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted June 6, 2015 Members Report Share Posted June 6, 2015 Ignore my latest post it was quite fast to do it Open PIREPS.php in core/modules/PIREPS paste this code in it public function publicroutesmap($pilotID) { $this->title = 'Flight Map of'.$pilotID; $pireps = PIREPData::findPIREPS(array('p.pilotid' => $pilotID)); if(!$pireps) { $this->set('message', 'There are no PIREPs for this pilot!!'); $this->render('core_error.tpl'); return; } $this->set('allschedules', $pireps); $this->show('flown_routes_map.tpl'); } now in pilot_public_profile.tpl and in profile_main.tpl paste this where ever you want the map to be shown <?php PIREPS::publicroutesmap($userinfo->pilotid) ?> And you should have this result like on my test page www.http://www.baggelis.com/phpvms/index.php/profile/view/2 1 Quote Link to comment Share on other sites More sharing options...
flynryan692 Posted June 7, 2015 Report Share Posted June 7, 2015 I tested it and it works great, but I am curious, is there anyway to limit how many flights are shown? For example, only map the last 10 flights. Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted June 7, 2015 Members Report Share Posted June 7, 2015 With that code you can Open PIREPS.php in core/modules/PIREPS paste this code in it public function publicroutesmap($pilotID,$limit='') { $this->title = 'Flight Map of'.$pilotID; $pireps = PIREPData::findPIREPS(array('p.pilotid' => $pilotID),$limit); if(!$pireps) { $this->set('message', 'There are no PIREPs for this pilot!!'); $this->render('core_error.tpl'); return; } $this->set('allschedules', $pireps); $this->show('flown_routes_map.tpl'); } now in pilot_public_profile.tpl and in profile_main.tpl paste this where ever you want the map to be shown <?php PIREPS::publicroutesmap($userinfo->pilotid,NumberOfFlightsyouwant)?> Quote Link to comment Share on other sites More sharing options...
flynryan692 Posted June 7, 2015 Report Share Posted June 7, 2015 It would be like this right? <?php PIREPS::publicroutesmap($userinfo->pilotid,10)?> With that, and updating the function it still returns all of the flights flown and not the limit. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.