Jump to content

Badge question.


CrashGordon

Recommended Posts

  • Administrators

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Administrators

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Administrators

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 years later...

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.

Link to comment
Share on other sites

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