Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
edited body
Source Link
niaziblog
  • 111
  • 1
  • 7

This code snippet below shows the list of all Joomla user groups(registered,editor.superuser and ...) at component

enter image description here

    // load in joomla user groups
    $qry = "SELECT * FROM #__usergroups ORDER BY lft";
    $db->setQuery($qry);
    
    $this->groups = $db->loadObjectList();
    
    $group_index = array();
    
    foreach ($this->groups as &$group)
    {
        $group_index[$group->id] = &$group;
        
        if ($group->parent_id == 0)
        {
            $group->level = 0;  
        } else {
            $group->level = $group_index[$group->parent_id]->level + 1;
        }
        
        $group->display = str_repeat("- ", $group->level) . $group->title;
    }
    
    array_unshift($this->groups, JHTML::_('select.option', '', JText::_("JOOMLA_USERGROUP"), 'id', 'display'));
    $this->jgroup_select = JHTML::_('select.genericlist',  $this->groups, 'usergroup', 'class="inputbox" size="1" onchange="document.fssForm.submit( );"', 'id', 'display', $this->usergroup);

now I want to show justonly registered user and manager user list or justonly registered user

This code snippet below shows the list of all Joomla user groups(registered,editor.superuser and ...) at component

enter image description here

    // load in joomla user groups
    $qry = "SELECT * FROM #__usergroups ORDER BY lft";
    $db->setQuery($qry);
    
    $this->groups = $db->loadObjectList();
    
    $group_index = array();
    
    foreach ($this->groups as &$group)
    {
        $group_index[$group->id] = &$group;
        
        if ($group->parent_id == 0)
        {
            $group->level = 0;  
        } else {
            $group->level = $group_index[$group->parent_id]->level + 1;
        }
        
        $group->display = str_repeat("- ", $group->level) . $group->title;
    }
    
    array_unshift($this->groups, JHTML::_('select.option', '', JText::_("JOOMLA_USERGROUP"), 'id', 'display'));
    $this->jgroup_select = JHTML::_('select.genericlist',  $this->groups, 'usergroup', 'class="inputbox" size="1" onchange="document.fssForm.submit( );"', 'id', 'display', $this->usergroup);

now I want to show just registered user and manager user list or just registered user

This code snippet below shows the list of all Joomla user groups(registered,editor.superuser and ...) at component

enter image description here

    // load in joomla user groups
    $qry = "SELECT * FROM #__usergroups ORDER BY lft";
    $db->setQuery($qry);
    
    $this->groups = $db->loadObjectList();
    
    $group_index = array();
    
    foreach ($this->groups as &$group)
    {
        $group_index[$group->id] = &$group;
        
        if ($group->parent_id == 0)
        {
            $group->level = 0;  
        } else {
            $group->level = $group_index[$group->parent_id]->level + 1;
        }
        
        $group->display = str_repeat("- ", $group->level) . $group->title;
    }
    
    array_unshift($this->groups, JHTML::_('select.option', '', JText::_("JOOMLA_USERGROUP"), 'id', 'display'));
    $this->jgroup_select = JHTML::_('select.genericlist',  $this->groups, 'usergroup', 'class="inputbox" size="1" onchange="document.fssForm.submit( );"', 'id', 'display', $this->usergroup);

now I want to show only registered user and manager user list or only registered user

Source Link
niaziblog
  • 111
  • 1
  • 7

Display specific Joomla user groups

This code snippet below shows the list of all Joomla user groups(registered,editor.superuser and ...) at component

enter image description here

    // load in joomla user groups
    $qry = "SELECT * FROM #__usergroups ORDER BY lft";
    $db->setQuery($qry);
    
    $this->groups = $db->loadObjectList();
    
    $group_index = array();
    
    foreach ($this->groups as &$group)
    {
        $group_index[$group->id] = &$group;
        
        if ($group->parent_id == 0)
        {
            $group->level = 0;  
        } else {
            $group->level = $group_index[$group->parent_id]->level + 1;
        }
        
        $group->display = str_repeat("- ", $group->level) . $group->title;
    }
    
    array_unshift($this->groups, JHTML::_('select.option', '', JText::_("JOOMLA_USERGROUP"), 'id', 'display'));
    $this->jgroup_select = JHTML::_('select.genericlist',  $this->groups, 'usergroup', 'class="inputbox" size="1" onchange="document.fssForm.submit( );"', 'id', 'display', $this->usergroup);

now I want to show just registered user and manager user list or just registered user