| Conditions | 5 |
| Paths | 4 |
| Total Lines | 27 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 3 | function member_search($queryarray, $andor, $limit, $offset, $userid) |
||
|
|
|||
| 4 | { |
||
| 5 | $sql = "SELECT * FROM " . $GLOBALS['xoopsDB']->prefix("users") .""; |
||
| 6 | // because count() returns 1 even if a supplied variable |
||
| 7 | // is not an array, we must check if $querryarray is really an array |
||
| 8 | if ( is_array($queryarray) && $count = count($queryarray) ) { |
||
| 9 | $sql .= " WHERE ((uname LIKE '%{$queryarray[0]}%' OR name LIKE '%{$queryarray[0]}%')"; |
||
| 10 | for ( $i=1; $i<$count; $i++ ) { |
||
| 11 | $sql .= " $andor "; |
||
| 12 | $sql .= "(uname LIKE '%{$queryarray[$i]}%' OR name LIKE '%{$queryarray[$i]}%')"; |
||
| 13 | } |
||
| 14 | $sql .= ") "; |
||
| 15 | } |
||
| 16 | $sql .= " ORDER BY uname,name ASC"; |
||
| 17 | |||
| 18 | $result = $GLOBALS['xoopsDB']->query($sql, intval($limit), intval($offset)); |
||
| 19 | $ret = array(); |
||
| 20 | $i = 0; |
||
| 21 | while($myrow = $GLOBALS['xoopsDB']->fetchArray($result)){ |
||
| 22 | $ret[$i]['link'] = "".XOOPS_URL."\userinfo.php?uid=".$myrow['uid'].""; |
||
| 23 | $ret[$i]['title'] = "".htmlspecialchars($myrow['uname'])." / ".htmlspecialchars($myrow['name']).""; |
||
| 24 | $ret[$i]['time'] = "".$myrow['user_regdate'].""; |
||
| 25 | $ret[$i]['uid'] = "".$myrow['uid'].""; |
||
| 26 | $i++; |
||
| 27 | } |
||
| 28 | return $ret; |
||
| 29 | } |
||
| 30 | |||
| 32 | ?> |
||
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.