Hello, if anyone would be able to help me create separate Pilot Lists for each airline it would be much appreciated! I am not very experienced with PHP but thanks to the help of Parkho in a I setup a pilot list that lists all pilots by hours here: http://www.msflights.net/pilots/phpvms/index.php/pilotlist
We have two airlines, one Commercial and one for General Aviation aircraft, I would like to create separate lists that show pilots by hours for each airline on separate pages. I’m not quite sure if it’s possible to show flights/hours for each airline separately especially since we allow pilots to submit pireps for BOTH airlines even though they are signed up for only one.
Thanks for the help, unfortunately I’m embarrassed to admit I’m not sure exactly where to paste in the airlines code/name. I tried a few different spots without success…I’m sure its really simple and I have been starring right at it…but PHP is still like a foreign language to me
I don’t have lib/skins/YOURSKINNAME/pilots_list.php, so I tried replacing my files \core\template\pl\ pilot_list.tpl and \core\modules\PilotList\ PilotList.php and got these errors:
Parse error: syntax error, unexpected '[', expecting ')' in /home1/msflight/public\_html/pilots/phpvms/core/templates/pl/pilots\_list.tpl on line 8
Parse error: syntax error, unexpected '[', expecting ')' in /home1/msflight/public\_html/pilots/phpvms/core/modules/PilotList/PilotList.php on line 8
Ah, you’re using the older version, do you have a skin on your website, if so, try lib/skins/YOURSKINNAME/pilots_list.tpl and replace all the content in there. If that file is not there, then try the one in core/templates/pl/pilot_list.tpl which I think is the one Parkho gave you. No need to be embarrassed, it’s just like learning another language, you’ll get it eventually
And for the error, try replacing this line (on line 8)
(I am using the latest official phpvms release, but I am only on php5.3 since it does not work on later versions (I coudln’t get the phpvms forks to work with 5.5+))
thanks, mine is only located in /core/templates/pl. I replaced that file completely and got the error, then tried your fix on line 8 which made the page load properly but broke the previous functionality I had setup (showing top 100 pilots from most to least hours)(it would now load all 800 pilots by pilot ID).
It did show both airlines on the page but for the second airline it only showed pilots that were registered with that second airline. I was hoping it would be possible to list a pilot in both airline lists since they can submit pireps to each airline even though they can only register for one airline at a time(sorry that sounds confusing). Basically I wanted to know if its possible to show Pilot X who registered with Airline A to appear in BOTH pilot lists for Airline A and B even though he is only registered to Airline A (because he submitted pireps to both Airlines).
I am trying to set this up because we will have a commercial airline and a general aviation airline, but I want to keep the pilot list of hours separate since as you can imagine commercial pilots rack up way more hours then general aviation pilots. We are pretty casual so I wanted a pilot who is registered in the commercial airline to also be able to submit pireps for the general aviation airline, and show up in both pilot lists for each airline.
Thanks for all the help, I have to call it a night, so I will check back in tomorrow.
Basically I wanted to know if its possible to show Pilot X who registered with Airline A to appear in BOTH pilot lists for Airline A and B even though he is only registered to Airline A (because he submitted pireps to both Airlines).
I don’t think that’s doable since the given variable has to be the airline code and since the pilot is registered only with one airline. Another approach would be to loop through the PIREPS and pull out the pilots who submitted the PIREP. In that case you won’t be able to show all your pilots cause some of them are registered but never submitted any reports.
Another approach would be to loop through the PIREPS and pull out the pilots who submitted the PIREP. In that case you won’t be able to show all your pilots cause some of them are registered but never submitted any reports.
Would this only work for specific PIREPS you list or could you pull all PIREPS from that airline?