1
webguygary
how do I edit registration form so users can place themselves in a group?
  • 2004/11/10 14:13

  • webguygary

  • Just popping in

  • Posts: 25

  • Since: 2004/11/8


How do I edit registration sign-up so a new user can select from a group list? I want them to be able to sort themselves into a particular group on sign-up so later I can do custom mailings for each different user group. I have created the various groups in the admin, I just need to know how to get them to appear as a drop-down/select menu on sign-up.

Thanks.

2
ejuden01
Re:how do I edit registration form so users can place themselves in a group?
  • 2004/11/10 15:32

  • ejuden01

  • Not too shy to talk

  • Posts: 121

  • Since: 2004/4/5 1


It should look something like this:
$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>";
}

3
webguygary
Re:how do I edit registration form so users can place themselves in a group?
  • 2004/11/10 18:53

  • webguygary

  • Just popping in

  • Posts: 25

  • Since: 2004/11/8


Thanks...what file should I insert this code into?

4
ejuden01
Re:how do I edit registration form so users can place themselves in a group?
  • 2004/11/10 18:55

  • ejuden01

  • Not too shy to talk

  • Posts: 121

  • Since: 2004/4/5 1


Sorry, I misread your first post. If you were creating your own custom register form, this is the way I would do it. But the XOOPS register page uses the XoopsForm Object, which I am not familiar with. Can anyone else give him a hand on how to achieve this?

5
webguygary
Re:how do I edit registration form so users can place themselves in a group?
  • 2004/11/10 23:47

  • webguygary

  • Just popping in

  • Posts: 25

  • Since: 2004/11/8


Yeah, I know it can be done, but I've yet to see a post in the forums saying how to do it...I've got 90% of the portal configged for this client, but they're screaming at me about the new client registration process. This one has me stumped.

6
ackbarr
Re:how do I edit registration form so users can place themselves in a group?

you should use the XoopsFormSelectGroup class for this. Add an instance of this class to the register form, then modify register.php to look for this new select box. In register.php there is existing code to add user to group, copy / modify this code to add your newly registered user to the group selected.

7
Stewdio
Re:how do I edit registration form so users can place themselves in a group?
  • 2004/11/11 5:01

  • Stewdio

  • Community Support Member

  • Posts: 1560

  • Since: 2003/5/7 1


If you get this to work, please release your hack to the community as I am sure many would like to have this feature until it is possibly built into future code releases.

8
webguygary
Re:how do I edit registration form so users can place themselves in a group?
  • 2004/11/11 17:21

  • webguygary

  • Just popping in

  • Posts: 25

  • Since: 2004/11/8


The post from Ackbar seems a step in the right direction, but I'm still not clear what it is I am messing with here...the info posted here:

https://xoops.org/misc/api/kernel/form/XoopsFormSelectGroup.html

This seems like the solution, but I'm clueless about how to implement it.

9
webguygary
Re:how do I edit registration form so users can place themselves in a group?
  • 2004/11/12 23:40

  • webguygary

  • Just popping in

  • Posts: 25

  • Since: 2004/11/8


Has anyone tried this module?

https://xoops.org/modules/newbb/viewtopic.php?topic_id=23504&forum=14&post_id=118046

It seems to work like regkeys, so I was wndering if maybe hacking one of these modules might be a solution?

10
webguygary
Re:how do I edit registration form so users can place themselves in a group?
  • 2004/11/16 17:25

  • webguygary

  • Just popping in

  • Posts: 25

  • Since: 2004/11/8


this one has me stumped!

Login

Who's Online

252 user(s) are online (168 user(s) are browsing Support Forums)


Members: 0


Guests: 252


more...

Donat-O-Meter

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

Latest GitHub Commits