Search userGroup me...
 
Notifications
Clear all

Search userGroup member

5 Posts
2 Users
0 Reactions
650 Views
(@jhonoryza)
Posts: 7
Active Member
Topic starter
 

how to get list of member from userGroup ?? i have problem when access this function

void OnUserGroupLoaded(CBUserGroup[] group, string error){

       Debug.Log(group[0].users.length);

}

i have created the group but the user show 0, can u help my problem ??

 
Posted : 08/07/2015 9:35 am
(@skaredcreations)
Posts: 806
Prominent Member Admin
 

I suppose you're talking about version 1.x: in the webservice groups you have the function wsList that is getting the records from CB_UserGroup::Load, instead it should be like this:

$groups = CB_UserGroup::Load($id);
foreach ($groups as $group) {
   $list[] = $group->ToArray();
}

I applied this fix also to the incoming 2.0.5 thanks to your report 🙂

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 08/07/2015 11:52 am
(@jhonoryza)
Posts: 7
Active Member
Topic starter
 

then i use version 1.x, so i need to add/put the code above to the file CB_UserGroup.php ??

 
Posted : 08/07/2015 12:49 pm
(@skaredcreations)
Posts: 806
Prominent Member Admin
 

No, I'm talking about the webservice "groups.php" function wsList there's a line where it's setting the returned list from CB_UserGroup::Load, you need to replace that line with the code above (remember to enclose it within {} eventually).

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 08/07/2015 12:53 pm
(@jhonoryza)
Posts: 7
Active Member
Topic starter
 

thanks it solved my problem..:)

i have another problem in this function :

  void OnUserGroupSaved (CBUserGroup grup, string error){

     if(grup != null)

     Debug.Log("Saved: " +grup.name);

}

the grup created successfully, but on that function it didn't show my group.name, can u help me solve this problem??

 
Posted : 09/07/2015 6:21 am
Share: