1
rom669
A simple and easy question...
  • 2005/4/15 12:47

  • rom669

  • Just popping in

  • Posts: 3

  • Since: 2005/4/15


Hi!
How can i make a select form like xoopsSelectFormUser that do not contains all registered users but users from another groups ?
thanks

2
ackbarr
Re: A simple and easy question...

the OOP way of solving this problem is creating a new class that extends XoopsFormSelectUser, but who's constructor uses
$member_handler->getUsersByGroup($group);

instead of
$member_handler->getUserList($criteria);


$member_handler->getUsersByGroup() returns an array of UIDs
so you would need to use this array to get the XoopsUser list for those UIDs. Something like this should do the trick
$group 1;
$uids =& $member_handler->getUsersByGroup($group);
$criteria = new Criteria('uid'"(".implode(','$members).")""IN");
$criteria->setSort('uname');
$this->addOptionArray($member_handler->getUserList($criteria));

3
rom669
Re: A simple and easy question...
  • 2005/4/16 17:28

  • rom669

  • Just popping in

  • Posts: 3

  • Since: 2005/4/15


Thanks a lot for your precious help! But you've made a little mistake...
I give the right code that may help others ...

$group 1;
$uids =& $member_handler->getUsersByGroup($group);
$criteria = new Criteria('uid'"(".implode(','$uids).")""IN");
$criteria->setSort('uname');
$this->addOptionArray($member_handler->getUserList($criteria));
[/quote]

I'd really like to thanks those who take the time for helping beginners and for supporting their (silly) questions like mine !

Login

Who's Online

185 user(s) are online (128 user(s) are browsing Support Forums)


Members: 0


Guests: 185


more...

Donat-O-Meter

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

Latest GitHub Commits