FlightDeckES Posted August 9, 2019 Report Share Posted August 9, 2019 Hello I am trying to add that the last 10 routes flown are shown, I have not been lucky thanks for the help this is the Module / Pireps code public function routesmap($pilotID,$limit='') { if (!Auth::LoggedIn()) { $this->set('message', '<div class="alert alert-danger alert-dismissable">You must be logged in to access this feature!</div>'); $this->render('core_error.tpl'); return; } $this->title = 'My Flight Map'; $pireps = PIREPData::findPIREPS(array( 'p.pilotid' => Auth::$pilot->pilotid,$limit )); if (!$pireps) { $this->set('message', '<div class="alert alert-danger alert-dismissable"><center>No hay vuelos archivados todavia</center></div>'); $this->render('core_error.tpl'); return; } $this->set('allschedules', $pireps); #deprecated $this->set('pirep_pilots', $pireps); $this->render('flown_routes_map.php'); } with this code all <?php MainController::Run('Pireps', 'routesmap'); ?> thanks. Quote Link to comment Share on other sites More sharing options...
gio1961 Posted August 10, 2019 Report Share Posted August 10, 2019 Hi, try to see if this could interest you Quote Link to comment Share on other sites More sharing options...
FlightDeckES Posted August 11, 2019 Author Report Share Posted August 11, 2019 (edited) Hello thanks for the information, I have edited the flown_routes_map.php but I don't know how to limit the last 10 flight registration. https://ibb.co/5RYwHGc Modules/pireps public function routesmap (){ if (!Auth::LoggedIn()) { $this->set('message', '<div class="alert alert-danger alert-dismissable">You must be logged in to access this feature!</div>'); $this->render('core_error.tpl'); return; } $this->title = 'My Flight Map'; $pireps = PIREPData::findPIREPS(array('p.pilotid' => Auth::$pilot->pilotid )); if (!$pireps) { $this->set('message', '<div class="alert alert-danger alert-dismissable"><center>No hay vuelos archivados todavia</center></div>'); $this->render('core_error.tpl'); return; } $this->set('allschedules', $pireps); #deprecated $this->set('pirep_pilots', $pireps); $this->render('flown_routes_map.php'); } Edited August 11, 2019 by FlightDeckES Quote Link to comment Share on other sites More sharing options...
Yash Posted August 11, 2019 Report Share Posted August 11, 2019 (edited) 4 hours ago, FlightDeckES said: Hello thanks for the information, I have edited the flown_routes_map.php but I don't know how to limit the last 10 flight registration. https://ibb.co/5RYwHGc Modules/pireps public function routesmap (){ if (!Auth::LoggedIn()) { $this->set('message', '<div class="alert alert-danger alert-dismissable">You must be logged in to access this feature!</div>'); $this->render('core_error.tpl'); return; } $this->title = 'My Flight Map'; $pireps = PIREPData::findPIREPS(array('p.pilotid' => Auth::$pilot->pilotid )); if (!$pireps) { $this->set('message', '<div class="alert alert-danger alert-dismissable"><center>No hay vuelos archivados todavia</center></div>'); $this->render('core_error.tpl'); return; } $this->set('allschedules', $pireps); #deprecated $this->set('pirep_pilots', $pireps); $this->render('flown_routes_map.php'); } I hope this works for you - public function routesmap() { if (!Auth::LoggedIn()) { $this->set('message', 'You must be logged in to access this feature!'); $this->render('core_error.tpl'); return; } $this->title = 'My Flight Map'; $pireps = PIREPData::findPIREPS(array( 'p.pilotid' => Auth::$pilot->pilotid ), $count = '10'); if (!$pireps) { $this->set('message', 'There are no PIREPs for this pilot!!'); $this->render('core_error.tpl'); return; } $this->set('allschedules', $pireps); #deprecated $this->set('pirep_list', $pireps); $this->render('flown_routes_map.tpl'); } Edited August 11, 2019 by Yash Quote Link to comment Share on other sites More sharing options...
Administrators ProAvia Posted August 11, 2019 Administrators Report Share Posted August 11, 2019 (edited) In local.config.php # Number of routes to show in the flown routes map Config::Set('ROUTE_MAP_SHOW_NUMBER', 50); // change number to reflect desired number of routes Edited August 11, 2019 by ProAvia Quote Link to comment Share on other sites More sharing options...
FlightDeckES Posted August 11, 2019 Author Report Share Posted August 11, 2019 2 hours ago, Yash said: I hope this works for you - public function routesmap() { if (!Auth::LoggedIn()) { $this->set('message', 'You must be logged in to access this feature!'); $this->render('core_error.tpl'); return; } $this->title = 'My Flight Map'; $pireps = PIREPData::findPIREPS(array( 'p.pilotid' => Auth::$pilot->pilotid ), $count = '10'); if (!$pireps) { $this->set('message', 'There are no PIREPs for this pilot!!'); $this->render('core_error.tpl'); return; } $this->set('allschedules', $pireps); #deprecated $this->set('pirep_list', $pireps); $this->render('flown_routes_map.tpl'); } hello thanks for the help, for some reason is not working Quote Link to comment Share on other sites More sharing options...
FlightDeckES Posted August 11, 2019 Author Report Share Posted August 11, 2019 (edited) 1 hour ago, ProAvia said: In local.config.php # Number of routes to show in the flown routes map Config::Set('ROUTE_MAP_SHOW_NUMBER', 50); // change number to reflect desired number of routes hello thanks for the help, I have it inserted local.config.php for some reason is not working Edited August 11, 2019 by FlightDeckES Quote Link to comment Share on other sites More sharing options...
Administrators ProAvia Posted August 11, 2019 Administrators Report Share Posted August 11, 2019 If you have edited the Routes module or flown_routes_map file, you may need to revert to the originals so you have a baseline to start from. Quote Link to comment Share on other sites More sharing options...
FlightDeckES Posted August 11, 2019 Author Report Share Posted August 11, 2019 (edited) 23 minutes ago, ProAvia said: Si ha editado el módulo Rutas o el archivo flown_routes_map, es posible que deba volver a los originales para tener una línea de base para comenzar. Hi, it was the first thing I checked here, some screenshots https://ibb.co/zFdz33q https://ibb.co/dbpT744 used this code in the pilot_public_profile.php <?php MainController::Run('Pireps', 'routesmap'); ?> Edited August 11, 2019 by FlightDeckES Quote Link to comment Share on other sites More sharing options...
Yash Posted August 11, 2019 Report Share Posted August 11, 2019 2 hours ago, FlightDeckES said: hello thanks for the help, for some reason is not working public function routesmap() { if (!Auth::LoggedIn()) { $this->set('message', 'You must be logged in to access this feature!'); $this->render('core_error.tpl'); return; } $this->title = 'My Flight Map'; $pireps = PIREPData::findPIREPS(array( 'p.pilotid' => Auth::$pilot->pilotid ), 10); if (!$pireps) { $this->set('message', 'There are no PIREPs for this pilot!!'); $this->render('core_error.tpl'); return; } $this->set('allschedules', $pireps); #deprecated $this->set('pirep_list', $pireps); $this->render('flown_routes_map.tpl'); } Try this! Quote Link to comment Share on other sites More sharing options...
FlightDeckES Posted August 11, 2019 Author Report Share Posted August 11, 2019 (edited) 1 hour ago, Yash said: public function routesmap() { if (!Auth::LoggedIn()) { $this->set('message', 'You must be logged in to access this feature!'); $this->render('core_error.tpl'); return; } $this->title = 'My Flight Map'; $pireps = PIREPData::findPIREPS(array( 'p.pilotid' => Auth::$pilot->pilotid ), 10); if (!$pireps) { $this->set('message', 'There are no PIREPs for this pilot!!'); $this->render('core_error.tpl'); return; } $this->set('allschedules', $pireps); #deprecated $this->set('pirep_list', $pireps); $this->render('flown_routes_map.tpl'); } Try this! thanks for your help but it still doesn't work used this code in the pilot_public_profile.php <?php MainController::Run('Pireps', 'routesmap'); ?> Edited August 11, 2019 by FlightDeckES Quote Link to comment Share on other sites More sharing options...
Administrators ProAvia Posted August 11, 2019 Administrators Report Share Posted August 11, 2019 If you are trying to display this in pilot_public_profile.php - the result will be YOUR flown routes, not those of the selected pilot. Not sure there is a way to display a specific pilot's flown routes on a map without writing your own module or adding that function to an existing module. If viewing a specific pilot's profile, there should be a list of the pilot's PIREPS. Clicking on a flight number from there should take you to a page listing the PIREP details - including the flight map for that PIREP. Quote Link to comment Share on other sites More sharing options...
FlightDeckES Posted August 11, 2019 Author Report Share Posted August 11, 2019 (edited) 23 minutes ago, ProAvia said: If you are trying to display this in pilot_public_profile.php - the result will be YOUR flown routes, not those of the selected pilot. Not sure there is a way to display a specific pilot's flown routes on a map without writing your own module or adding that function to an existing module. If viewing a specific pilot's profile, there should be a list of the pilot's PIREPS. Clicking on a flight number from there should take you to a page listing the PIREP details - including the flight map for that PIREP. thanks for your help here's something on this topic,but is outdated for a PHP version https://forum.phpvms.net/topic/22395-pilot-profile-recent-flights-on-google-maps/ Edited August 11, 2019 by FlightDeckES 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.