Jump to content

Recommended Posts

Posted

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.

  • Administrators
Posted

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.

Posted

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.rolleyes.gif

  • Administrators
Posted

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.

Posted

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.rolleyes.gif

  • Administrators
Posted

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.rolleyes.gif

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..

Posted

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.

Posted

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.unsure.gif

In the alternative, I didn't understand what you said, Nabeel. Sorry.

  • Administrators
Posted

You can get and display custom fields using -

if you added a field called "RANK":

<?php echo PilotData::GetFieldValue($pilotid, 'RANK'); ?>

  • Like 1
Posted

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.unsure.gif

  • Administrators
Posted

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

  • Administrators
Posted

Thank you. I suspected I'd have to define it, but wasn't quite sure how. Obviously php is a foreign language to me.biggrin.gif

This will be very helpful.

No prob! Let us know if you need more help!

Posted

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;
 }

Posted

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.

Posted

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.

Posted

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. rolleyes.gif

So here's a question. Would a non-standard thing such as what I was doing, ever update the sig?

  • 2 years later...
Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...