Moderators Kyle Posted January 31, 2011 Moderators Report Posted January 31, 2011 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! Quote
Strider Posted January 31, 2011 Report Posted January 31, 2011 <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> 1 Quote
Guest lorathon Posted January 31, 2011 Report Posted January 31, 2011 Use this to get groups $usergroups = PilotData::getPilotGroups($pilotid); Quote
Moderators Kyle Posted January 31, 2011 Author Moderators Report Posted January 31, 2011 ok nightfox, That's the one. Thanks!! 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!! Quote
Moderators Kyle Posted January 31, 2011 Author Moderators Report Posted January 31, 2011 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? Quote
Guest lorathon Posted January 31, 2011 Report Posted January 31, 2011 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. Quote
Moderators Kyle Posted January 31, 2011 Author Moderators Report Posted January 31, 2011 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. Quote
Guest lorathon Posted January 31, 2011 Report Posted January 31, 2011 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"; ?> Quote
Moderators Kyle Posted January 31, 2011 Author Moderators Report Posted January 31, 2011 Ahh ok, Now I got it. I forgot for the foreach thing. Thanks for your help there lorathon!!! Cheers!!! Quote
James142 Posted April 7, 2011 Report Posted April 7, 2011 Hey, how would I show the pilots Group in their signature? Would it be something like: $output[] = 'Postition: ' . $pilot->group; Thanks James Quote
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.