1
Anonymous
Searching 'Extra Info' in Xoopsmembers Module
  • 2004/2/10 17:35

  • Anonymous

  • Posts: 0

  • Since:


It must be easy, or not?

First: I uncomment the lines with "bio" in index.php (xoopsmembers).

Result: Every user will be found!

Second: I add:
Quote:
if ( !empty($HTTP_POST_VARS['user_bio']) ) {
$criteria->add(new Criteria('user_bio', '%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_bio'])).'%', 'LIKE'));
}

Result: None user will be found!

What am I doing wrong?

Thanks
Skywalk

2
Anonymous
Re: Searching 'Extra Info' in Xoopsmembers Module
  • 2004/2/10 19:21

  • Anonymous

  • Posts: 0

  • Since:


A few minutes later: The solution

Quote:
if ( !empty($HTTP_POST_VARS['user_bio']) ) {
$match = (!empty($HTTP_POST_VARS['user_bio_match'])) ? intval($HTTP_POST_VARS['user_bio_match']) : XOOPS_MATCH_CONTAIN;
switch ($match) {
case XOOPS_MATCH_START:
$criteria->add(new Criteria('bio', $myts->addSlashes(trim($HTTP_POST_VARS['user_bio'])).'%', 'LIKE'));
break;
case XOOPS_MATCH_END:
$criteria->add(new Criteria('bio', '%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_bio'])).'%', 'LIKE'));
break;
case XOOPS_MATCH_EQUAL:
$criteria->add(new Criteria('bio', $myts->addSlashes(trim($HTTP_POST_VARS['user_bio']))));
break;
case XOOPS_MATCH_CONTAIN:
$criteria->add(new Criteria('bio', '%'.$myts->addSlashes(trim($HTTP_POST_VARS['user_bio'])).'%', 'LIKE'));
break;
}
}


to whom it may concern ...
Skywalk

Login

Who's Online

352 user(s) are online (123 user(s) are browsing Support Forums)


Members: 0


Guests: 352


more...

Donat-O-Meter

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

Latest GitHub Commits