Jump to content

Error displaying aircraft in Signature? [SOLVED]


MBrown

Recommended Posts

Hi guys n gals,

Another quickie, I've been playing around with va signatures and adding and removing bits to it.

I have however one small problem, I was sure I had it right but it's just coming out blank!

I have this bit uptop to make it work:

$ac = OperationsData::getAircraftByName($pirepdata->aircraft);

Then in the sig bit below I have:

$output[] = 'On plane:' . $ac->aircraft;

in the PilotData.class.php

Any help is appreciated, to display the plane type (i.e. B737-200)

On a side note if I configure like so:

$ac = PIREPData::getLastReports($pilotid, 1, PIREP_ACCEPTED);

Then in the sig bit below I have:

$output[] = 'On plane:' . $ac->aircraft;

I actually get something come out in the sig, but just the number 2 :blink:

Link to comment
Share on other sites

Guest lorathon

Try this. The aircraft field in the PIREP table is the id of the aircraft.

$ac = OperationsData::getAircraftInfo($pirepdata->aircraft);
$output[] = 'On Plane:'.$ac->name;

Link to comment
Share on other sites

thanks Lorathon. Any help is much appreciated.

Although unfortunately it hasn't worked to well :blink:

It's now blank again!

Maybe this might help in any way? It's the latest flights board from my homepage. Which displays the aircraft type. I was thinking it might trigger an idea to incorporate that into the signature somehow. :)

code removed by user

Link to comment
Share on other sites

Guest lorathon

How are you filling the $pirepdata? Maybe you should post the entire code or at least the code around the signature. I assumed you were already filling the $pirepdata. If not then you will need to do the following. This should work if put into the PilotData::generateSignature() function

This one should allow you to use any of the data from the aircraft row (name, icao, fullname, etc.....)

$pirepdata = PIREPData::getLastReports($pilotid, 1, PIREP_ACCEPTED);
$ac = OperationsData::getAircraftInfo($pirepdata->aircraft);
$output[] = 'On Plane:'.$ac->name;

or

This one uses the join from the PIREPData. The join queries the name field and returns as aircraft. You could also use the registration from this one.

$pirepdata = PIREPData::getLastReports($pilotid, 1, PIREP_ACCEPTED);
$output[] = 'On Plane:'.$pirepdata->aircraft;

Both will return only the last pirep that has been accepted. If you just want the last pirep then change to the following

$pirepdata = PIREPData::getLastReports($pilotid, 1);

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