userpicker(); include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_user_select.php"); class user_select { /** * @deprecated use e107::getForm()->userlist() instead. * @param $class * @param $form_name * @return string */ function user_list($class, $form_name) { // e107::getMessage()->addDebug("Deprecated user_list Method used ".debug_backtrace()); global $sql, $tp; if($class === FALSE) { $class = e_UC_MEMBER;} switch ($class) { case e_UC_ADMIN: $where = "user_admin = 1"; break; case e_UC_MEMBER: $where = "user_ban != 1"; break; case e_UC_NOBODY: return ""; break; default: $where = "user_class REGEXP '(^|,)(".$tp -> toDB($class, true).")(,|$)'"; break; } $text = ""; if(ADMIN) { $text .= "user_list method is deprecated. ".print_a(debug_backtrace(),true); } return $text; } /** * Display selection dropdown of all user classes * * @deprecated * @param int $class - if its e_UC_MEMBER, all classes are shown. Otherwise only the class matching the value is shown. * @return string */ function class_list($class, $form_name) //TODO Find all instances of use and replace. { global $sql; $text = " "; } else { $text .= " "; } $text .= "".US_LAN_4."..."; } /* This appears to duplicate other functionality, in an unhelpful way! if ($class !== false) { if (($class < e_UC_NOBODY && USERCLASS) || ADMINPERMS == '0') { $text .= ' '.$this -> class_list($class, 'class'); } } */ return $text; } function real_name($_id) { global $sql; $sql -> db_Select("user", "user_name", "user_id='".intval($_id)."' "); if ($row = $sql -> db_Fetch()) { return $row['user_name']; } } function popup() { global $ns, $tp; list($elementType, $elementID) = explode(".", e_QUERY); if($elementType == 'textarea') { $job = " curval = parent.opener.document.getElementById('{$elementID}').value; lastchr = curval.substring(curval.length-1, curval.length); if(lastchr != '\\n' && curval.length > 0) { curval = curval+'\\n'; } parent.opener.document.getElementById('{$elementID}').value = curval+d+'\\n';"; } else { if($elementID == "") { $elementID = $elementType; } $job = "parent.opener.document.getElementById('{$elementID}').value = d;"; } // send the charset to the browser - overrides spurious server settings with the lan pack settings. header("Content-type: text/html; charset=utf-8", TRUE); //echo (defined("STANDARDS_MODE") ? "" : "\n")."\n"; //echo " echo " ".SITENAME."\n"; echo " "; $text = "

".US_LAN_4."

"; if (isset($_POST['dosrch'])) { $userlist = $this -> findusers($_POST['srch']); if($userlist == FALSE) { $fcount= 0; } else { $fcount = count($userlist); } $text .= "
"; } //$ns -> tablerender(US_LAN_4, $text); echo $text; echo "\n\n"; } function findusers($s,$banned=FALSE) { global $sql, $tp; $inc = ($banned == FALSE) ? " AND user_ban != 1" : ""; if ($sql->db_Select("user", "*", "user_name LIKE '%".$tp -> toDB($s)."%'".$inc)) { while ($row = $sql -> db_Fetch()) { $ret[strtolower($row['user_name'])] = $row['user_name']; } ksort($ret); } else { $ret = FALSE; } return $ret; } }