28 $xoops->simpleHeader(
false);
32 if (!empty($_REQUEST[
'token'])) {
33 if (
$xoops->security()->validateToken($_REQUEST[
'token'],
false)) {
46 $token = isset($_REQUEST[
'token']) ? $_REQUEST[
'token'] :
'';
48 $name_userid =
'uid' . (!empty($_REQUEST[
'multiple']) ?
'[]' :
'');
70 define(
'FINDUSERS_MODE_SIMPLE', 0);
71 define(
'FINDUSERS_MODE_ADVANCED', 1);
78 if (empty($_POST[
"user_submit"])) {
80 $mode = intval(@$_REQUEST[
"mode"]);
86 $match_tray->addElement($match);
87 $match_tray->addElement(
$text);
88 $form->addElement($match_tray);
89 unset(
$text, $match, $match_tray);
97 $more =
new Xoops\Form\Text(
"",
"{$var}_more", 10, 5, @$_POST[
"{$var}_more"]);
98 $less =
new Xoops\Form\Text(
"",
"{$var}_less", 10, 5, @$_POST[
"{$var}_less"]);
100 $range_tray->addElement($less);
101 $range_tray->addElement($more);
102 $form->addElement($range_tray);
103 unset($more, $less, $range_tray);
107 $mailok_radio->addOptionArray(array(
113 $avatar_radio->addOptionArray(array(
126 $level_radio->addOptionArray($levels);
132 $group_select->addOptionArray(
$groups);
137 $rank_select->addOptionArray($ranks);
138 $form->addElement($url_text);
139 $form->addElement($location_text);
140 $form->addElement($occupation_text);
141 $form->addElement($interest_text);
142 $form->addElement($mailok_radio);
143 $form->addElement($avatar_radio);
144 $form->addElement($level_radio);
145 $form->addElement($group_select);
146 $form->addElement($rank_select);
156 $match_tray->addElement($match);
157 $match_tray->addElement(
$text);
158 $form->addElement($match_tray);
159 unset(
$text, $match, $match_tray);
164 $sort_select->addOptionArray(array(
171 $order_select->addOptionArray(array(
176 $form->addElement($sort_select);
177 $form->addElement($order_select);
180 $form->addElement(
new Xoops\Form\Hidden(
"mode", $mode));
181 $form->addElement(
new Xoops\Form\Hidden(
"target", @$_REQUEST[
"target"]));
182 $form->addElement(
new Xoops\Form\Hidden(
"multiple", @$_REQUEST[
"multiple"]));
183 $form->addElement(
new Xoops\Form\Hidden(
"token", $token));
188 echo
"</html><body>";
190 $modes_switch = array();
191 foreach (
$modes as $_mode => $title) {
192 if ($mode == $_mode) {
195 $modes_switch[] =
"<a href='findusers.php?target=" . htmlspecialchars(@$_REQUEST[
"target"], ENT_QUOTES) .
"&multiple=" . htmlspecialchars(@$_REQUEST[
"multiple"], ENT_QUOTES) .
"&token=" . htmlspecialchars($token, ENT_QUOTES) .
"&mode={$_mode}'>{$title}</a>";
197 echo
"<h4>" . implode(
" | ", $modes_switch) .
"</h4>";
202 $limit = empty($_POST[
'limit']) ? 50 : intval($_POST[
'limit']);
204 if (!isset($_POST[
"query"])) {
207 if (!empty($_POST[$var])) {
208 $match = (!empty($_POST[
"{$var}_match"])) ? intval($_POST[
"{$var}_match"]) :
XOOPS_MATCH_START;
209 $value = str_replace(
"_",
"\\\_",
$myts->addSlashes(trim($_POST[$var])));
226 if (!empty($_POST[
'url'])) {
227 $url =
$xoops->formatURL(trim($_POST[
'url']));
230 if (!empty($_POST[
'user_from'])) {
231 $criteria->add(
new Criteria(
'user_from',
'%' .
$myts->addSlashes(trim($_POST[
'user_from'])) .
'%',
'LIKE'));
233 if (!empty($_POST[
'user_intrest'])) {
234 $criteria->add(
new Criteria(
'user_intrest',
'%' .
$myts->addSlashes(trim($_POST[
'user_intrest'])) .
'%',
'LIKE'));
236 if (!empty($_POST[
'user_occ'])) {
237 $criteria->add(
new Criteria(
'user_occ',
'%' .
$myts->addSlashes(trim($_POST[
'user_occ'])) .
'%',
'LIKE'));
243 if (!empty($_POST[
"{$var}_more"]) && is_numeric($_POST[
"{$var}_more"])) {
244 $time = time() - (60 * 60 * 24 * intval(trim($_POST[
"{$var}_more"])));
249 if (!empty($_POST[
"{$var}_less"]) && is_numeric($_POST[
"{$var}_less"])) {
250 $time = time() - (60 * 60 * 24 * intval(trim($_POST[
"{$var}_less"])));
256 if (!empty($_POST[
'posts_more']) && is_numeric($_POST[
'posts_more'])) {
259 if (!empty($_POST[
'posts_less']) && is_numeric($_POST[
'posts_less'])) {
262 if (!empty($_POST[
'user_mailok'])) {
263 if ($_POST[
'user_mailok'] ==
"mailng") {
266 if ($_POST[
'user_mailok'] ==
"mailok") {
271 if (!empty($_POST[
'user_avatar'])) {
272 if ($_POST[
'user_avatar'] ==
"y") {
275 if ($_POST[
'user_avatar'] ==
"n") {
280 if (!empty($_POST[
'level'])) {
281 $level_value = array(
286 $level = isset($level_value[intval($_POST[
"level"])]) ? $level_value[intval($_POST[
"level"])] : 1;
289 if (!empty($_POST[
'rank'])) {
291 if ($rank_obj->getVar(
"rank_special")) {
294 if ($rank_obj->getVar(
"rank_min")) {
297 if ($rank_obj->getVar(
"rank_max")) {
312 $sort = (!in_array($_POST[
'user_sort'], $validsort)) ?
"uname" : $_POST[
'user_sort'];
314 if (isset($_POST[
'user_order']) && $_POST[
'user_order'] ==
"DESC") {
327 <script type="text/javascript">
328 var multiple=' . intval($_REQUEST[
'multiple']) .
';
333 var mForm = document.forms["' .
$name_form .
'"];
334 for (var i=0;i!=mForm.elements.length;i++) {
335 var id=mForm.elements[i];
336 if ( ( (multiple > 0 && id.type == "checkbox") || (multiple == 0 && id.type == "radio") ) && (id.checked == true) && ( id.name == "' .
$name_userid .
'" ) ) {
337 var name = mForm.elements[++i];
338 var len = id.value.length + name.value.length;
339 sel_str += len + ":" + id.value + ":" + name.value;
347 sel_str = num + ":" + sel_str;
348 window.opener.addusers(sel_str);
352 window.opener.focus();
359 echo
"</html><body>";
360 echo
"<a href='findusers.php?target=" . htmlspecialchars(@$_POST[
"target"], ENT_QUOTES) .
"&multiple=" . intval(@$_POST[
"multiple"]) .
"&token=" . htmlspecialchars($token, ENT_QUOTES) .
"'>" .
XoopsLocale::FIND_USERS .
"</a> <span style='font-weight:bold;'>»»</span> " .
XoopsLocale::SEARCH_RESULTS .
"<br /><br />";
361 if (empty(
$start) && empty($foundusers)) {
363 $hiddenform =
"<form name='findnext' action='findusers.php' method='post'>";
364 foreach ($_POST as $k => $v) {
365 if ($k ==
'XOOPS_TOKEN_REQUEST') {
367 $hiddenform .=
$xoops->security()->getTokenHTML() .
"\n";
369 $hiddenform .=
"<input type='hidden' name='" . htmlSpecialChars($k, ENT_QUOTES) .
"' value='" . htmlSpecialChars(
$myts->stripSlashesGPC($v), ENT_QUOTES) .
"' />\n";
372 if (!isset($_POST[
'limit'])) {
373 $hiddenform .=
"<input type='hidden' name='limit' value='{$limit}' />\n";
375 if (!isset($_POST[
'start'])) {
376 $hiddenform .=
"<input type='hidden' name='start' value='{$start}' />\n";
378 $hiddenform .=
"<input type='hidden' name='token' value='" . htmlspecialchars($token, ENT_QUOTES) .
"' />\n";
379 $hiddenform .=
"</form>";
381 echo
"<div>" . $hiddenform;
382 echo
"<a href='#' onclick='javascript:document.findnext.start.value=0;document.findnext.user_submit.value=0;document.findnext.submit();'>" .
XoopsLocale::SEARCH_AGAIN .
"</a>\n";
386 if (!empty($total)) {
389 if (!empty($foundusers)) {
390 echo
"<form action='findusers.php' method='post' name='{$name_form}' id='{$name_form}'>
391 <table width='100%' border='0' cellspacing='1' cellpadding='4' class='outer'>
393 <th align='center' width='5px'>";
394 if (!empty($_POST[
"multiple"])) {
395 echo
"<input type='checkbox' name='memberslist_checkall' id='memberslist_checkall' onclick='xoopsCheckAll(\"{$name_form}\", \"memberslist_checkall\");' />";
405 foreach (array_keys($foundusers) as
$j) {
406 if ($ucount % 2 == 0) {
412 $fuser_name = $foundusers[
$j]->getVar(
"name") ? $foundusers[
$j]->getVar(
"name") :
" ";
413 echo
"<tr class='$class'>
414 <td align='center'>";
415 if (!empty($_POST[
"multiple"])) {
416 echo
"<input type='checkbox' name='{$name_userid}' id='{$name_userid}' value='" . $foundusers[
$j]->getVar(
"uid") .
"' />";
417 echo
"<input type='hidden' name='{$name_username}' id='{$name_username}' value='" . $foundusers[
$j]->getVar(
"uname") .
"' />";
419 echo
"<input type='radio' name='{$name_userid}' id='{$name_userid}' value='" . $foundusers[
$j]->getVar(
"uid") .
"' />";
420 echo
"<input type='hidden' name='{$name_username}' id='{$name_username}' value='" . $foundusers[
$j]->getVar(
"uname") .
"' />";
423 <td><a href='" .
\XoopsBaseConfig::get(
'url') .
"/userinfo.php?uid=" . $foundusers[
$j]->getVar(
"uid") .
"' target='_blank'>" . $foundusers[
$j]->getVar(
"uname") .
"</a></td>
424 <td>" . $fuser_name .
"</td>
425 <td align='center'>" . ($foundusers[
$j]->getVar(
"user_regdate") ? date(
"Y-m-d", $foundusers[$j]->getVar(
"user_regdate")) :
"") .
"</td>
426 <td align='center'>" . ($foundusers[$j]->getVar(
"last_login") ? date(
"Y-m-d H:i", $foundusers[$j]->getVar(
"last_login")) :
"") .
"</td>
427 <td align='center'>" . $foundusers[$j]->getVar(
"posts") .
"</td>";
430 echo
"<tr class='foot'><td colspan='6'>";
433 if (empty($_POST[
"target"])) {
435 echo
"</select> ";
441 echo
"<input type='hidden' name='token' value='" . htmlspecialchars($token, ENT_QUOTES) .
"' />\n";
442 echo
"</td></tr></table></form>\n";
445 $hiddenform =
"<form name='findnext' action='findusers.php' method='post'>";
446 foreach ($_POST as $k => $v) {
447 if ($k ==
'XOOPS_TOKEN_REQUEST') {
449 $hiddenform .=
$xoops->security()->getTokenHTML() .
"\n";
451 $hiddenform .=
"<input type='hidden' name='" . htmlSpecialChars($k, ENT_QUOTES) .
"' value='" . htmlSpecialChars(
$myts->stripSlashesGPC($v), ENT_QUOTES) .
"' />\n";
454 if (!isset($_POST[
'limit'])) {
455 $hiddenform .=
"<input type='hidden' name='limit' value='" .
$limit .
"' />\n";
457 if (!isset($_POST[
'start'])) {
458 $hiddenform .=
"<input type='hidden' name='start' value='" .
$start .
"' />\n";
460 $hiddenform .=
"<input type='hidden' name='token' value='" . htmlspecialchars($token, ENT_QUOTES) .
"' />\n";
461 if (!isset($total) || ($totalpages = ceil($total /
$limit)) > 1) {
463 if (
$start - $limit >= 0) {
464 $hiddenform .=
"<a href='#0' onclick='javascript:document.findnext.start.value=" . $prev .
";document.findnext.submit();'>" .
XoopsLocale::PREVIOUS .
"</a> \n";
468 if (!isset($total)) {
469 while ($counter <= $currentpage) {
470 if ($counter == $currentpage) {
471 $hiddenform .=
"<strong>" . $counter .
"</strong> ";
473 if (($counter > $currentpage - 4 && $counter < $currentpage + 4) || $counter == 1) {
474 $hiddenform .=
"<a href='#" . $counter .
"' onclick='javascript:document.findnext.start.value=" . ($counter - 1) * $limit .
";document.findnext.submit();'>" . $counter .
"</a> ";
475 if ($counter == 1 && $currentpage > 5) {
476 $hiddenform .=
"... ";
483 while ($counter <= $totalpages) {
484 if ($counter == $currentpage) {
485 $hiddenform .=
"<strong>" . $counter .
"</strong> ";
487 if (($counter > $currentpage - 4 && $counter < $currentpage + 4) || $counter == 1 || $counter == $totalpages) {
488 if ($counter == $totalpages && $currentpage < $totalpages - 4) {
489 $hiddenform .=
"... ";
491 $hiddenform .=
"<a href='#" . $counter .
"' onclick='javascript:document.findnext.start.value=" . ($counter - 1) * $limit .
";document.findnext.submit();'>" . $counter .
"</a> ";
492 if ($counter == 1 && $currentpage > 5) {
493 $hiddenform .=
"... ";
502 if ((isset($total) && $total > $next) || (!isset($total) && count($foundusers) >=
$limit)) {
503 $hiddenform .=
" <a href='#" . $total .
"' onclick='javascript:document.findnext.start.value=" . $next .
";document.findnext.submit();'>" .
XoopsLocale::NEXT .
"</a>\n";
506 $hiddenform .=
"</form>";
508 echo
"<div>" . $hiddenform;
512 echo
"<a href='#' onclick='javascript:document.findnext.start.value=0;document.findnext.user_submit.value=0;document.findnext.submit();'>" .
XoopsLocale::SEARCH_AGAIN .
"</a>\n";
const LOGGED_IN_PAST_X_DAYS
const ONLY_USERS_THAT_DO_NOT_ACCEPT_EMAIL
const TYPE_OF_USERS_TO_SHOW
const ONLY_USERS_THAT_ACCEPT_EMAIL
if($uname== ''||$pass== '') $member_handler
const REGISTERED_IN_PAST_X_DAYS
defined('DS') or define('DS' DIRECTORY_SEPARATOR
const OCCUPATION_CONTAINS
const FINDUSERS_MODE_ADVANCED
const XOOPS_MATCH_CONTAIN
const FINDUSERS_MODE_SIMPLE
const NUMBER_OF_RESULTS_PER_PAGE
const E_NO_ACCESS_PERMISSION