mseiwald Posted February 1, 2013 Report Share Posted February 1, 2013 Hi guys, can someone please point me in the right direction where all the rank autocalculate functions are. I want to exclude some pilots who got a rank Upgrade from the autocalculate. I have added a if statement there to the PIREP Accept function in the pirep admin module. It is working there but it seems there must be autocalculate functions somewhere else as well cause the pilots keep getting reset to their autocalculated rank. best regards Manuel Quote Link to comment Share on other sites More sharing options...
jefry352 Posted February 1, 2013 Report Share Posted February 1, 2013 Hi mseiwald! That line could be change in the local.config.php file, that file is located at core folder. Change: Config::Set('RANKS_AUTOCALCULATE', true); to. Config::Set('RANKS_AUTOCALCULATE', false); I hope that works for you!. Best regards, Quote Link to comment Share on other sites More sharing options...
Strider Posted February 1, 2013 Report Share Posted February 1, 2013 jefry352 I think he wants some people to have their ranks autocalculated, and some not. Quote Link to comment Share on other sites More sharing options...
mseiwald Posted February 1, 2013 Author Report Share Posted February 1, 2013 Exactly i want to have the Ranks autocalculated by default but have some guys excluded who got a special rank Upgrade. I have added a column in a table for that and also have a working if statement. I just need to find all spots where i need to apply this if statement. So far i have the pirep admin module but it seems that there are also some autocalculate functions somewhere else. Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted February 6, 2013 Moderators Report Share Posted February 6, 2013 This one is in PilotData.class.php: public static function changePilotRank($pilotid, $rankid) { $rank = RanksData::getRankInfo($rankid); if (!($rank_level = RanksData::getRankLevel($rankid))) { return false; } return self::updateProfile($pilotid, array( 'rankid' => $rank->rankid, 'rank' => $rank->rank, 'ranklevel' => $rank_level )); } And this is in RanksData.class.php: public static function calculatePilotRanks() { /* Don't calculate a pilot's rank if this is set */ if (Config::Get('RANKS_AUTOCALCULATE') === false) { return; } $ranks_list = self::getAllRanks(); $pilots = PilotData::getAllPilots(); if (count($pilots) == 0 || !is_array($pilots)) { return; } foreach ($pilots as $pilot) { self::calculateUpdatePilotRank($pilot->pilotid, $ranks_list); } } Hope these help. Quote Link to comment Share on other sites More sharing options...
mseiwald Posted February 6, 2013 Author Report Share Posted February 6, 2013 Aah thanks a lot parkho i'll give this a try Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted February 7, 2013 Moderators Report Share Posted February 7, 2013 yw Quote Link to comment Share on other sites More sharing options...
mseiwald Posted February 10, 2013 Author Report Share Posted February 10, 2013 seems all i needed to change was in the RanksData.class.php ! So far it seems to work thanks again Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted February 11, 2013 Moderators Report Share Posted February 11, 2013 gr8 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.