CrashGordon Posted April 23, 2010 Report Share Posted April 23, 2010 Is there a way to have the pilot badges display a title other than their pilot rank? In other words, if one is a hub manager, COO or something similar. As it is now, I have to pad the ours to get that on the badge. I don't know what others thingk, but that might be a good feature for a future release. Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted April 23, 2010 Administrators Report Share Posted April 23, 2010 What if you set the auto rank config to false and just set everyone's rank manually. It would take some upkeep to award new ranks as pilot hours grow but you would be able to assign your management ranks to whom you would like and keep their hours true instead of padding. Quote Link to comment Share on other sites More sharing options...
CrashGordon Posted April 24, 2010 Author Report Share Posted April 24, 2010 The ranks are still based on hours, that way. Look at my sig. I've only actually flown a little over 200 hours in phpVMs, but I added 5000 hours previous VA time fo get to the "CEO" level and have more than adequate room to be sure no one got to be CEO, also. What I'd like to do is be able to make someone a hub manager, have it appear on their badge, yet still have the incentive of more ours increasing their pilot rank. I have an idea, but it is a real kludge. Currently, I don't assign pilots to hubs (actually everyone is assigned to a dummy airport which displays only a"." in the badge), but I could create a dummy ICAO that wouldn't be used for flight, but would display something like Hub Manager: EHAM. But that would probably screw up the pilot roster. Oh well, back to the drawing board. Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted April 24, 2010 Administrators Report Share Posted April 24, 2010 Make the rank an award then echo it in the badge creation. You may have to reconfigure your badge text layout a little to make it work but would get the management rank on there as well as an hours awarded rank. Quote Link to comment Share on other sites More sharing options...
CrashGordon Posted April 24, 2010 Author Report Share Posted April 24, 2010 An interesting approach, but I think that would mean only one award could be issued to a pilot. I suspect the only correct way to do this is to add it to the pilot's profile in a way that can only be added by admin, and then echo that variable in the badge. Now, I have to figure out how to do that. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted April 24, 2010 Administrators Report Share Posted April 24, 2010 An interesting approach, but I think that would mean only one award could be issued to a pilot. I suspect the only correct way to do this is to add it to the pilot's profile in a way that can only be added by admin, and then echo that variable in the badge. Now, I have to figure out how to do that. Create a custom field and make it private. Then in the generateSignatures() function in PilotData, you can call getFieldValue() I think to pull that value (look in the profile template for the exact call) and that'll output it in.. Quote Link to comment Share on other sites More sharing options...
CrashGordon Posted April 24, 2010 Author Report Share Posted April 24, 2010 Create a custom field and make it private. Then in the generateSignatures() function in PilotData, you can call getFieldValue() I think to pull that value (look in the profile template for the exact call) and that'll output it in.. I added the field last night and would have gone further if I didn't have this unfortunate need to sleep. Will work on it today. Thanks. Quote Link to comment Share on other sites More sharing options...
CrashGordon Posted April 25, 2010 Author Report Share Posted April 25, 2010 I hit a snag. How do I determine the variable name of the custom field I placed in the pilot profile, so I can display it on the sig. This is obviously not my area of expertease. In the alternative, I didn't understand what you said, Nabeel. Sorry. Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted April 25, 2010 Administrators Report Share Posted April 25, 2010 You can get and display custom fields using - if you added a field called "RANK": <?php echo PilotData::GetFieldValue($pilotid, 'RANK'); ?> 1 Quote Link to comment Share on other sites More sharing options...
CrashGordon Posted April 26, 2010 Author Report Share Posted April 26, 2010 You can get and display custom fields using - if you added a field called "RANK": <?php echo PilotData::GetFieldValue($pilotid, 'RANK'); ?> I don't think that will get me where I want to go. What I am trying to do is get into the same block of code the rest of the badge stuff is, so I can save that block of code to drop into the next update, rather than lose it. Like some variation of this, for the field named position: # Configure what we want to show on each line $output = array(); $output[] = $pilotcode.' '. $pilot->firstname.' '.$pilot->lastname; $output[] = $pilot->position; $output[] = $pilot->rank.', '.$pilot->hub; $output[] = 'Total Flights: ' . $pilot->totalflights; $output[] = 'Total Hours: ' . $totalhours; I suspect I need to define something as this approach doesn't work...or I'm looking at the wrong code. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted April 26, 2010 Administrators Report Share Posted April 26, 2010 You're on the right track. You'd do: $position = PilotData::getFieldValue($pilot->pilotid, 'RANK'); // RANK is the name of the custom field $output = array(); $output[] = $pilotcode.' '. $pilot->firstname.' '.$pilot->lastname; $output[] = $position; $output[] = $pilot->rank.', '.$pilot->hub; $output[] = 'Total Flights: ' . $pilot->totalflights; $output[] = 'Total Hours: ' . $totalhours; Something like that Quote Link to comment Share on other sites More sharing options...
CrashGordon Posted April 26, 2010 Author Report Share Posted April 26, 2010 Thank you. I suspected I'd have to define it, but wasn't quite sure how. Obviously php is a foreign language to me. This will be very helpful. 1 Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted April 26, 2010 Administrators Report Share Posted April 26, 2010 Thank you. I suspected I'd have to define it, but wasn't quite sure how. Obviously php is a foreign language to me. This will be very helpful. No prob! Let us know if you need more help! Quote Link to comment Share on other sites More sharing options...
CrashGordon Posted April 26, 2010 Author Report Share Posted April 26, 2010 Still no joy. I wouldn't pursue this, but someone might want to do the same thing. This is the code as it stands now. public function generateSignature($pilotid) { $pilot = self::getPilotData($pilotid); $pilotcode = self::getPilotCode($pilot->code, $pilot->pilotid); $position = PilotData::getFieldValue($pilot->pilotid, 'Position'); if(Config::Get('TRANSFER_HOURS_IN_RANKS') === true) { $totalhours = $pilot->totalhours + $pilot->transferhours; } else { $totalhours = $pilot->totalhours; } # Configure what we want to show on each line $output = array(); $output[] = $pilotcode.' '. $pilot->firstname.' '.$pilot->lastname; $output[] = $pilot->Position; $output[] = $pilot->rank.', '.$pilot->hub; $output[] = 'Total Flights: ' . $pilot->totalflights; $output[] = 'Total Hours: ' . $totalhours; if(Config::Get('SIGNATURE_SHOW_EARNINGS') == true) { $output[] = 'Total Earnings: ' . $pilot->totalpay; } Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted April 26, 2010 Administrators Report Share Posted April 26, 2010 Replace: $output[] = $pilot->Position; with $output[] = $position; Since above you're doing $position = ... Quote Link to comment Share on other sites More sharing options...
CrashGordon Posted April 26, 2010 Author Report Share Posted April 26, 2010 I tried, without success. But, I discovered something. The badge isn't updating no matter what I do or how many times I try to regenerate it. As an experiment, I changed $output[] = $pilot->rank.', '.$pilot->hub; to $output[] = $pilot->rank; If my limited knowledge of PHP is correct, that should display the rank with nothing else on the line. I'm going to stop now and see if it updates at any point. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted April 27, 2010 Administrators Report Share Posted April 27, 2010 Are the lib/signature folder and files in it all 777? Quote Link to comment Share on other sites More sharing options...
CrashGordon Posted April 27, 2010 Author Report Share Posted April 27, 2010 The code may have been ok, but the sig wouldn't update, so there was no way to tell. Just to be sure it wasn't something I did, I put back the original code and set rank images to true in local.cfg to see if anything happens. I'll also try changing my hub to see if it ever appears. Quote Link to comment Share on other sites More sharing options...
CrashGordon Posted April 27, 2010 Author Report Share Posted April 27, 2010 OK, now I know the hub updates and the flight updates, but no display of rank graphic. So, I don't know if the code didn't work or if the site isn't updating that information in the sig. So here's a question. Would a non-standard thing such as what I was doing, ever update the sig? Quote Link to comment Share on other sites More sharing options...
CrashGordon Posted April 27, 2010 Author Report Share Posted April 27, 2010 Are the lib/signature folder and files in it all 777? Sorry. I didn't see this. Only noticed it when I saw the notification in my email. No, they weren't. Just changed them. Will see how it goes now. Quote Link to comment Share on other sites More sharing options...
CrashGordon Posted October 11, 2012 Author Report Share Posted October 11, 2012 I'm bringing this two year old thread back to life because I'm trying to accomplish something similar now. My VA is only available to the members of my forum and I wanted them to be able the use their forum names as callsigns. I added a custom field via the admin panel called Callsign. I tried Config::Set('SIGNATURE_SHOW_CALLSIGN', true); No good. In PilotData.class I have this: # Configure what we want to show on each line $callsign = PilotData::getFieldValue($pilot->pilotid, 'CALLSIGN'); $output = array(); $output[] = $pilotcode.' '. $pilot->firstname.' '.$pilot->lastname; $output[] = 'Callsign: ' . $pilot->callsign; $output[] = $pilot->rank.', '.$pilot->hub; $output[] = 'Total Flights: ' . $pilot->totalflights; $output[] = 'Total Hours: ' . $totalhours; It's been two years since I dabbled in this, so If anyone can tell me what I might have forgotten, I'd appreciate it. 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.