James142 Posted August 18, 2011 Report Posted August 18, 2011 Just a quick question. I am trying to display the pilots group in the public profile by using: <?php echo $userinfo->group; ?> but it shows up blank. (e.x: http://www.flyaerova...ile/view/FAV001 ) Is there something I am missing? I have searched but found nothing. Kindest Regards, James Quote
Moderators Kyle Posted August 18, 2011 Moderators Report Posted August 18, 2011 I tried it before, but I'll give it a run again and I'll let you know what I can get. 1 Quote
James142 Posted August 18, 2011 Author Report Posted August 18, 2011 Thanks Vansers I tried myself earlier but I didn't know what to do.. 1 Quote
Moderators Kyle Posted August 18, 2011 Moderators Report Posted August 18, 2011 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. 1 Quote
James142 Posted August 18, 2011 Author Report Posted August 18, 2011 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! +1 1 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.