Jump to content

Recommended Posts

  • Moderators
Posted

Hey guys, I'm not sure how it is coded to tell what groups is the pilot in.

So if anyone could tell me the php codes to display what groups is the pilot in please and I'll would give you 1+ rep. Thanks!

Posted

<li><strong>Group: </strong><?php echo $userinfo->group; ?></li>

You will need to add two rows to the pilots table: groupid and group. You will have to manually insert the group names and id's in for it to work, but the code does work. That was in the pilot_public_profile. The pilots_list code is:

<td><?php echo $pilot->group;?></td>

  • Like 1
Guest lorathon
Posted

Use this to get groups

$usergroups = PilotData::getPilotGroups($pilotid);

  • Moderators
Posted

ok nightfox, That's the one. Thanks!! :D

and lorathon, I see why it isn't working becasue It's not getting the pilot's group info, so with the code you pasted in, where do I put it in? In the commons or the modules?

Thanks alot guys for helping!! :D

  • Moderators
Posted

Ummm, I still don't see the groups, I'm not sure what am I supposed to do with that code that lorathan gave me?

Guest lorathon
Posted

What exactly are you trying to do. Using the code I gave will fill $usergroups with the usergroups that are attached to the pilotid that is feed into the function.

To see what is inside

$usergroups = PilotData::getPilotGroups($pilotid);
print_r($usergroups);

To Get your own

$mygroups = PilotData::getPilotGroups(AUTH::$userinfo->pilotid);
print_r($mygroups);

Once filled you can use the $usergroups array to see what groups a pilot is a member of.

  • Moderators
Posted

Ok, sorry, I'm still a noob for getting data, I'm trying to learn.

What I am excatily I'm doing is that i am trying to get the info from the Admin in the groups to show what groups is the pilot in, are they in Admin?, Are they in Executive VP, Fleet or Active Pilots?

I hope that clears up, and I'll tell you what I did,

I went into the profile.php and added a line of a code for profile public function

and here's how i added.....

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

So on, for the profile_main.tpl, I added the php echo like this.....

<?php echo $group; ?>

I can tell I'm doing something wrong between the profile.php and the profile_main.tpl.

Guest lorathon
Posted

In the profile put this

<?php
if($group)
{
   foreach($group as $row)
   {
       echo $row->name.'<br/>';
   }
}
else echo "pilot is not a member of any groups";
?>

  • Moderators
Posted

Ahh ok, Now I got it. I forgot for the foreach thing. Thanks for your help there lorathon!!!

Cheers!!!

  • 2 months later...

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