Jump to content

Showing a pilots group [SOLVED]


James142

Recommended Posts

  • Moderators

All right James,

The problem you are trying to do, there isn't a function to grab the pilot's group.

So here's how it will work. Excuse for the messy job, lol.

1) Go to Profile.php

Go to line 80 or go to public function view($pilotid='')

And then find the following lines...

	$this->set('pilotcode', PilotData::getPilotCode($pilot->code, $pilot->pilotid));
	$this->set('allawards', AwardsData::getPilotAwards($pilot->pilotid));

Add after the lines...

$this->set('pilotgroups', PilotData::GetPilotGroups($pilotid));

Then, go to the .tpl file that your trying to get the pilot's group. Add that, and then you will get a list of groups.

                <?php
if(!$pilotgroups)
{
echo '<br />This user is not in any groups!<br /><br />';
}
else
{
?>  

<table width="200" border="0">
<?php 
foreach($pilotgroups as $group)
{
?>

 <tr>
   <td><?php echo $group->name;?></td>
 </tr>
</table>
<?php
}
}
?>

I know that it might look messy, but I'm sure you can fix it up to what ever style you want.

  • Like 1
Link to comment
Share on other sites

All right James,

The problem you are trying to do, there isn't a function to grab the pilot's group.

So here's how it will work. Excuse for the messy job, lol.

1) Go to Profile.php

Go to line 80 or go to public function view($pilotid='')

And then find the following lines...

	$this->set('pilotcode', PilotData::getPilotCode($pilot->code, $pilot->pilotid));
	$this->set('allawards', AwardsData::getPilotAwards($pilot->pilotid));

Add after the lines...

$this->set('pilotgroups', PilotData::GetPilotGroups($pilotid));

Then, go to the .tpl file that your trying to get the pilot's group. Add that, and then you will get a list of groups.

            	<?php
if(!$pilotgroups)
{
echo '<br />This user is not in any groups!<br /><br />';
}
else
{
?>  

<table width="200" border="0">
<?php 
foreach($pilotgroups as $group)
{
?>

 <tr>
   <td><?php echo $group->name;?></td>
 </tr>
</table>
<?php
}
}
?>

I know that it might look messy, but I'm sure you can fix it up to what ever style you want.

It works, thanks! laugh.gif +1

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