1
KubaZ
search user by name
  • 2004/4/28 10:49

  • KubaZ

  • Just popping in

  • Posts: 37

  • Since: 2002/10/9


Hi,

I know it is possible ('cos in XOOPS most things are possible to do )

So I want a handler to a specific user. I must search him by name (not by ID, as is usually in XOOPS codes).. and then I would be able to show his avatar, or more more

so how I can get it ? (a handler)

2
Mithrandir
Re: search user by name

The memberhandler has a getUsers() function, which takes a criteria element - which you can make as uname = [name]

3
KubaZ
Re: search user by name
  • 2004/4/28 11:23

  • KubaZ

  • Just popping in

  • Posts: 37

  • Since: 2002/10/9


thanks

now I understand criteria variable , I suppose

4
Mithrandir
Re: search user by name

I am not at home, so this will possibly have to do:
$usercriteria = new Criteria('uname'$thisusername'='); //3rd parameter unnecessary, since it is '=' by default

$member_handler =& xoops_gethandler('member');
$thisuserobject $member_handler->getUsers($usercriteria);


5
KubaZ
Re: search user by name
  • 2004/4/28 12:30

  • KubaZ

  • Just popping in

  • Posts: 37

  • Since: 2002/10/9


Yes, I had a little problem with it.

but I've looked into finduser.php (in system module)

Quote:

$member_handler =& xoops_gethandler('member');

$criteria = new CriteriaCompo();

$criteria->add(new Criteria('uname',$komputer, '='));

$total = $member_handler->getUserCount($criteria);

$foundusers =& $member_handler->getUsers($criteria, true);


so it is as you wrote thanks thanks

(and 3rd parameter is a part MySQL language like ('LIKE', >=) function uses it in SQL query in connection with WHERE )

Login

Who's Online

177 user(s) are online (58 user(s) are browsing Support Forums)


Members: 0


Guests: 177


more...

Donat-O-Meter

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

Latest GitHub Commits