31
webguygary
Re: Registration/Membership Management Question
  • 2004/12/17 14:17

  • webguygary

  • Just popping in

  • Posts: 25

  • Since: 2004/11/8


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>";
}

32
webguygary
Re: Registration/Membership Management Question
  • 2004/12/17 14:21

  • webguygary

  • Just popping in

  • Posts: 25

  • Since: 2004/11/8


I guess I should add a comment to my previous post - that snippet I posted would create a drop down list of all possible groups to choose from, as opposed to the radio selects you're using here. Useful if you have more than one group to choose from upon registration. This is theoretical, someone posted it in response to one of my earlier questions on this topic, but I've yet to try it out myself.

33
fbb803
Re: Registration/Membership Management Question
  • 2005/11/5 10:05

  • fbb803

  • Just popping in

  • Posts: 14

  • Since: 2005/3/11


the hack turns out an error message, something like "usericq should not be more than 15 characters long" even after changing value of field via phpmyadmin.

what should be done?

Login

Who's Online

144 user(s) are online (103 user(s) are browsing Support Forums)


Members: 0


Guests: 144


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits