Jump to content

Recommended Posts

  • Administrators
Posted

Doesn't it need a 

foreach $pilots as $pilot

in there somewhere to be able to get $pilot->pilotid from the pilots database table? pilots table being plural and pilot being singular......

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Is the VATSIM ID stored in the pilots database table?

Or did you add the VATSIM ID as a Custom Field? If Custom Field, the data (VATSIM ID) is stored in the fieldvalues table.

Then call it as

<?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?>

If the field is named different than 'VATSIM ID', change that in the code above.

Posted

Dears,

I have the code of custom field on Pilot list page, works perfect, i would like to show the same filed on pending pireps, next to full name check my code.

The problem is in that template forache requests : foreach($pireps as $pirep) i would like to add pilots as pilot here.

To display the custom filed.

Yours,

Posted
11 hours ago, ProAvia said:

Doesn't it need a 


foreach $pilots as $pilot

in there somewhere to be able to get $pilot->pilotid from the pilots database table? pilots table being plural and pilot being singular......

As long as you pass in a pilot id as the first parameter of PilotData::GetFieldValue() it shouldn't matter where you put it or if you use it in a loop.

 

1 hour ago, FlyingMachine said:

I have the code of custom field on Pilot list page, works perfect, i would like to show the same filed on pending pireps, next to full name check my code.

 

1 hour ago, FlyingMachine said:

To display the custom filed.

 

I have checked your code, you have provided this:

<!-- Here i would like to show VATSIM or IVAO ID using the following code -->
     l <?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM CID or IVAO VID'); ?>

As I stated above, if you want it to work inside of your pireps page ($pireps loop as you provided) then you will need to swap that line for this one (as I already provided above):

<?php echo PilotData::GetFieldValue($pirep->pilotid, 'VATSIM CID'); ?>

where VATSIM CID is the name of your custom field. Note the change from $pilot to $pirep. If this isn't what you are after then please give further explanation/code so we can help you out.

  • Thanks 1

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