The latest pilots to join thing on the index is nice and dandy if you keep consecutive Pilot IDs. If you change the Pilot IDs on registration (say, for hub purposes) there is an unfortunate problem where it only shows the highest Pilot ID, which may not necessarily be the newest pilot. I whipped up a work-around that should benefit airlines that do this.
This simple change can be condensed even more, but I figured I would create a new Method just to keep things clean (and give me something to fall back on later).
Open core/common/PilotData.class.php
Add this snippet somewhere (perhaps after the getLatestPilots method, Line ~227)
public static function getLatestPilotsByJoinDate($count=10)
{
$sql = 'SELECT * FROM '.TABLE_PREFIX.'pilots
ORDER BY `joindate` DESC
LIMIT '.$count;
return DB::get_results($sql);
}
Save, Now open core/modules/Pilots/Pilots.php
Change:
$this->set('pilots', PilotData::GetLatestPilots($count));
To:
$this->set('pilots', PilotData::GetLatestPilotsByJoinDate($count));
Save, upload, be happy.
Alternatively, you can just change the existing SQL query under getLatestPilots to order by 'joindate' and leave it at that, but I preferred to make my own method just to not break things. Or something.