Jump to content

[SOLVED]Total Awards


kbohme

Recommended Posts

I am trying to get the total number of awards for a pilot.

How can I count the awards of a specific pilot?

I am looking to rank pilots based on the number of awards that they have.

The awards have a separate table for those awarded and I cant figure out how to count them based on the pilot number field.

Any help you can give would be appreciated.

Link to comment
Share on other sites

  • Administrators

You can use the native awards data function for indivdual pilots and add the count command ->

echo count(AwardsData::GetPilotAwards($pilotid));

You will have to set the $pilotid to whatever variable you have available for the pilot id in the template you are working in. For example, in the pilot_public_profile.tpl it would need to be ->

echo count(AwardsData::GetPilotAwards($userinfo->pilotid));

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