get the child of specific usergroup?

For Joomla! 3.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Locked
saman2
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Thu Jan 18, 2018 7:36 pm

get the child of specific usergroup?

Post by saman2 » Mon Feb 05, 2018 5:23 pm

hi
i want get the list of child id of parent joomla usergroup?
for example i have GroupA have GroupB and GroupC as a child, is there any php function to get id of Group B and C via GroupA id?
Last edited by toivo on Sun Apr 22, 2018 7:37 am, edited 1 time in total.
Reason: mod note: moved to 3.x Coding

jgress-
Joomla! Ace
Joomla! Ace
Posts: 1097
Joined: Thu Sep 24, 2009 5:40 pm
Location: Austin, TX, USA

Re: get the child of specific usergroup?

Post by jgress- » Mon Feb 05, 2018 5:31 pm

I suggest you post to the forum at viewforum.php?f=708. This forum is for Registered Joomla! User Groups which are groups of people that meet together in their local areas. https://community.joomla.org/user-groups.html.

Mod: can you please move this to Joomla 3 administrator?

That said, you can find the IDs when you go to Users -> Groups and then the ID is in the far right column.
Co-author Using Joomla, Second Edition (migration/upgrade included) http://www.usingjoomlabook.com
Find a Joomla User Group (JUG) near you http://community.joomla.org/user-groups.html

User avatar
stutteringp0et
Joomla! Ace
Joomla! Ace
Posts: 1389
Joined: Sat Oct 28, 2006 11:16 pm
Location: Texas
Contact:

Re: get the child of specific usergroup?

Post by stutteringp0et » Sun Apr 22, 2018 6:39 am

$parent_group_id = 2;
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('id')->from('#__usergroups')->where('parent_id = '.(int)$parent_group_id);
$db->setQuery($query);
$children = $db->loadColumn();
// returns an array of group ids
My extensions: http://extensions.joomla.org/profile/pr ... ails/18398
Honk if this signature offends you.


Locked

Return to “Joomla! 3.x Coding”