MBrown Posted August 29, 2011 Report Share Posted August 29, 2011 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 Quote Link to comment Share on other sites More sharing options...
Guest lorathon Posted August 29, 2011 Report Share Posted August 29, 2011 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; Quote Link to comment Share on other sites More sharing options...
MBrown Posted August 29, 2011 Author Report Share Posted August 29, 2011 thanks Lorathon. Any help is much appreciated. Although unfortunately it hasn't worked to well 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 Quote Link to comment Share on other sites More sharing options...
Guest lorathon Posted August 29, 2011 Report Share Posted August 29, 2011 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); Quote Link to comment Share on other sites More sharing options...
MBrown Posted August 29, 2011 Author Report Share Posted August 29, 2011 Top man Lorathon! It was the first one that worked in your last post, So I sincerely thank you for that! Really appreciated since I strangely enough just couldn't fathom it out. Cheers, Matthew. 1 Quote Link to comment Share on other sites More sharing options...
Guest lorathon Posted August 29, 2011 Report Share Posted August 29, 2011 Not a problem 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.