md82 Posted June 3, 2015 Report 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
Members Vangelis Posted June 5, 2015 Members Report 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
flynryan692 Posted June 6, 2015 Report 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
Members Vangelis Posted June 6, 2015 Members Report 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
Members Vangelis Posted June 6, 2015 Members Report 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
flynryan692 Posted June 7, 2015 Report 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
Members Vangelis Posted June 7, 2015 Members Report 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
flynryan692 Posted June 7, 2015 Report 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
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.