hollinst Posted February 19, 2014 Report Posted February 19, 2014 I know, I know. I should use the search function and try and find my answer. I have been sitting here for an hour trying to find it, and I just can't seem to figure out what words I need to put together to make this thing work... Here is what I am trying to do. Currently, I have a "Latest Pilots" list on my homepage that is limited to show the 5 most recent pilots by their ID. Well, we change our pilot's IDs when they join to fit into the hub, and I would rather the "Latest Pilots" list to be sorted by date instead of by ID. We just changed webhosts so before this worked fine, and now... I don't remember what I did or where to look to make that happen. Any links are appreciated, and if someone is able to type up a quick tutorial, I would be very grateful! Thank you! Quote
Moderators servetas Posted February 25, 2014 Moderators Report Posted February 25, 2014 Go to core/common/PilotData.class.php file and find this (in my file it's in line 219); public static function getLatestPilots($count=10) { $sql = 'SELECT * FROM '.TABLE_PREFIX.'pilots ORDER BY `pilotid` DESC LIMIT '.$count; return DB::get_results($sql); } and replace it with this: public static function getLatestPilots($count=10) { $sql = 'SELECT * FROM '.TABLE_PREFIX.'pilots ORDER BY `joindate` DESC LIMIT '.$count; return DB::get_results($sql); } Quote
hollinst Posted February 25, 2014 Author Report Posted February 25, 2014 Go to core/common/PilotData.class.php file and find this (in my file it's in line 219); public static function getLatestPilots($count=10) { $sql = 'SELECT * FROM '.TABLE_PREFIX.'pilots ORDER BY `pilotid` DESC LIMIT '.$count; return DB::get_results($sql); } and replace it with this: public static function getLatestPilots($count=10) { $sql = 'SELECT * FROM '.TABLE_PREFIX.'pilots ORDER BY `joindate` DESC LIMIT '.$count; return DB::get_results($sql); } Thank you so much!!! 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.