HOWTO? Acquiring a list of all "editors" or higher? [SOLVED]
Posted: Fri Dec 28, 2007 11:31 am
Hi,
I'm practicing on writing my first Joomla (1.5) component. For this, I'd like to pull in a list of all members that have the level "Editor" (GID 19) or higher...
I notice the Content component actually pulls in a full list of all members... but I can't find the exact spot where this happens when looking into the code.
My first idea would be something like this:
Is this the right way to go? Or is there a better way?
I'm practicing on writing my first Joomla (1.5) component. For this, I'd like to pull in a list of all members that have the level "Editor" (GID 19) or higher...
I notice the Content component actually pulls in a full list of all members... but I can't find the exact spot where this happens when looking into the code.
My first idea would be something like this:
Code: Select all
$db =& JFactory::getDBO();
$sql = "SELECT * FROM #__users WHERE gid>18";
$db->setQuery($query);
$rows = $db->loadObjectList();
Is this the right way to go? Or is there a better way?