- {$user_id} |
- ";
-
- if ($user_perms == "0") {
+ if ($row['user_perms'] == "0") {
$text .= " ".LAN_MAINADMIN." ";
}
- else if($user_admin) {
+ else if($row['user_admin']) {
$text .= "";
}
- else if($user_ban == 1) {
+ else if($row['user_ban'] == 1) {
$text .= "";
}
- else if($user_ban == 2) {
+ else if($row['user_ban'] == 2) {
$text .= "".LAN_NOTVERIFIED." ";
}
- else if($user_ban == 3) {
+ else if($row['user_ban'] == 3) {
$text .= "".LAN_BOUNCED." ";
} else {
$text .= " ";
}
+ return $text;
- $text .= " | ";
+ }
-
-
- // Display Chosen options
-
- $datefields = array("user_lastpost","user_lastvisit","user_join","user_currentvisit");
- $boleanfields = array("user_admin","user_hideemail","user_ban");
-
- foreach($this->fieldpref as $disp)
- {
- $text .= "";
- if($disp == 'user_class')
- {
- if ($user_class)
- {
- $tmp = explode(",", $user_class);
- while (list($key, $class_id) = each($tmp))
- {
- $text .= $e107->user_class->uc_get_classname($class_id)." \n";
- }
- }
- else
- {
- $text .= " ";
- }
- }
- elseif($disp == 'user_ip')
- {
- $text .= $e107->ipDecode($user_ip);
- }
- elseif (in_array($disp,$boleanfields))
- {
- $text .= ($row[$disp]) ? ADMIN_TRUE_ICON : '';
- }
- elseif(in_array($disp,$datefields))
- {
- $text .= ($row[$disp]) ? strftime($pref['shortdate'],$row[$disp]).' ' : ' ';
- }
- elseif($disp == 'user_name')
- {
- $text .= "{$row['user_name']}";
- }
- else
- {
- $text .= $row[$disp].' ';
- }
- if(!in_array($disp,$boleanfields) && isset($prev[$disp]) && $row[$disp] == $prev[$disp] && $prev[$disp] != "")
- { // show matches
- $text .= " *";
- }
-
- $text .= " | ";
- $prev[$disp] = $row[$disp];
- }
- // -------------------------------------------------------------
- $qry = (e_QUERY) ? "?".e_QUERY : "";
- $text .= "
-
-
-
+ function showUserOptions($row)
+ {
+ extract($row);
+ $text .= "
@@ -950,7 +835,153 @@ class users
$text .= "\n";
}
$text .= " ";
- $text .= " |
";
+
+ return $text;
+ }
+
+
+ function show_existing_users($action, $sub_action, $id, $from, $amount)
+ {
+ global $sql, $frm, $ns, $tp, $mySQLdefaultdb,$pref,$unverified, $userMethods;
+ $e107 = e107::getInstance();
+
+ $text = "";
+
+ if (isset($_POST['searchquery']) && $_POST['searchquery'] != "")
+ {
+ $_POST['searchquery'] = $tp->toDB(trim($_POST['searchquery']));
+ $query = 'WHERE '.
+ $query .= (strpos($_POST['searchquery'], "@") !== FALSE) ? "user_email REGEXP('".$_POST['searchquery']."') OR ": "";
+ $query .= (strpos($_POST['searchquery'], ".") !== FALSE) ? "user_ip REGEXP('".$_POST['searchquery']."') OR ": "";
+ foreach($this->fieldpref as $disp)
+ {
+ $query .= $disp." REGEXP('".$_POST['searchquery']."') OR ";
+ }
+ $query .= "user_login REGEXP('".$_POST['searchquery']."') OR ";
+ $query .= "user_name REGEXP('".$_POST['searchquery']."') ";
+ if($action == 'unverified')
+ {
+ $query .= ' AND user_ban = 2 ';
+ }
+ $query .= ' ORDER BY user_id';
+ }
+ else
+ {
+ $query = '';
+ if($action == 'unverified')
+ {
+ $query = 'WHERE user_ban = 2 ';
+ }
+ $query .= 'ORDER BY '.($sub_action ? $sub_action : 'user_id').' '.($id ? $id : 'DESC')." LIMIT $from, $amount";
+ }
+
+ // $user_total = db_Count($table, $fields = '(*)',
+ $qry_insert = 'SELECT u.*, ue.* FROM `#user` AS u LEFT JOIN `#user_extended` AS ue ON ue.user_extended_id = u.user_id ';
+
+ if ($user_total = $sql->db_Select_gen($qry_insert. $query))
+ {
+
+ $text .= "