Posted on: 05/24/06 08:57am
By: Anonymous (luke)
Posted on: 05/24/06 03:44pm
By: Dirk
Posted on: 05/24/06 07:53pm
By: suprsidr
function phpblock_usernameSearch() { global $_CONF, $_TABLES; if (!empty($_GET['username'])){ $username = COM_applyfilter($_GET['username']); //query db for matches $result = DB_query("SELECT uid, username FROM {$_TABLES['users']} WHERE username LIKE '%$username%'"); if (DB_numRows($result) >= 1){ $list = '<p>Results:</p>'; $list = '<ul>'; while ($A = DB_fetchArray($result)){ $list .= '<li><a href="' . $_CONF['site_url'] . '/users.php?mode=profile&uid=' . $A['uid'] . '">' . COM_stripslashes($A['username']) . '</a></li>'; } $list .= '</ul>'; $list .= '<p>Search Again?</p>'; } } //display form $form = '<div id="username-search">'; $form .= '<form action="' . $_PHPSELF . '" method="GET">'; $form .= '<input type="text" size="12" name="username">'; $form .= '<input type="submit" value="search">'; $form .= '</form></div>'; //return block return $list . LB . $form; }