31
Quote:
haryadoon wrote:
How to get the group ID from the group name (without going straight to the database) ?
Harayoon - would this work?
$crit = new Criteria('id', 1, '<>'); // Should get all groups except for admin
$hGroups =& xoops_gethandler('group'); // Make groups handler
$groups =& $hGroups->getObjects($crit); // Retrieve groups matching criteria
echo "<select name='groups'>"; // In your registration form
foreach($groups as $group){ // Loop through each group
echo "<option value='".$group->getVar('id')."'>".$group->getVar('name')."</option>";
}