JackPlumb Posted December 11, 2009 Report Share Posted December 11, 2009 Is there a code where it shows a list of people who are in a group? Thanks, Jack. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted December 11, 2009 Administrators Report Share Posted December 11, 2009 $users = UserGroups::GetUsersInGroup ([group id); Replace [group id] with the ID of the group, and it will return an array of all the users in it Quote Link to comment Share on other sites More sharing options...
JackPlumb Posted December 11, 2009 Author Report Share Posted December 11, 2009 This hasn't called anything back. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted December 12, 2009 Administrators Report Share Posted December 12, 2009 What do you mean? Quote Link to comment Share on other sites More sharing options...
JackPlumb Posted December 12, 2009 Author Report Share Posted December 12, 2009 I have placed this onto the page: <?php $users=UserGroups::GetUsersInGroup (16); ?> and people are in the group, when I view the page it's just blank. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted December 12, 2009 Administrators Report Share Posted December 12, 2009 Well, you have to do something with it: // After that foreach($users as $pilot) { echo "The pilot is {$pilot->firstname} {$pilot->lastname}<br />"; } Quote Link to comment Share on other sites More sharing options...
JackPlumb Posted December 12, 2009 Author Report Share Posted December 12, 2009 <table width="940" border="0" align="center" cellpadding="1" cellspacing="0" style="background-color:white;border:1px dashed black;"> <tr> <td><div align="center">On completion of this Operation, all crew members stated below will be able to place the "<strong>Operation Herrick 11</strong>" medal on there Forum Signatures.</div></td> </tr> </table> <table width="940" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="470"><h2>Alpha Crew</h2> <?php $users = UserGroups::GetUsersInGroup (16);?> <?php foreach($users as $pilot) { echo "The pilot is {$pilot->firstname} {$pilot->lastname}"; } ?></td><td><h2>Bravo Crew</h2></td> </tr> </table> This is the coding on the page and it is bringing back Warning: Invalid argument supplied for foreach() in /####/####/public_html/core/pages/operation######.htm on line 10 . If anyone can help Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted December 13, 2009 Administrators Report Share Posted December 13, 2009 Then either the group ID is wrong or there's no users in the group You can do: if(!$users) { echo 'There are no pilots in this group'; $users=array(); } // Before this line foreach($users as $pilot) Quote Link to comment Share on other sites More sharing options...
JackPlumb Posted December 13, 2009 Author Report Share Posted December 13, 2009 Ok cheers, for some reason it is just saying nobody is in the group. But there is. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted December 13, 2009 Administrators Report Share Posted December 13, 2009 This is odd. The API docs say the function is there, but I don't see it in the code. Let me check this out, sorry about that! Quote Link to comment Share on other sites More sharing options...
JackPlumb Posted December 13, 2009 Author Report Share Posted December 13, 2009 Not a problem, once we find the problem the better ;D Quote Link to comment Share on other sites More sharing options...
JackPlumb Posted December 15, 2009 Author Report Share Posted December 15, 2009 Is anybody able to get this to work? Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted December 16, 2009 Administrators Report Share Posted December 16, 2009 Hey, track it here, I'll get to it soon, sorry: http://bugs.phpvms.net/ticket/101 Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted December 17, 2009 Administrators Report Share Posted December 17, 2009 This will work from the next beta, $list_of_pilots = PilotGroups::getUsersInGroup($group_name_or_id); Quote Link to comment Share on other sites More sharing options...
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.