1、默认为/dede/templets/sys_admin_user.htm,在合适的位置加入代码:
<form action="sys_admin_user.php" name="form1" method="get"> <table border="0" cellspacing="0" cellpadding="3"> <tr> <td>管理员搜索:</td> <td><input name="keyword" type="text" id="keyword" size="12" style="width:120px" value="{dede:global name='keyword'/}" /></td> <td><input name="imageField" class="np" type="image" src="images/button_search.gif" width="60" height="22" border="0" /></td> </tr> </table> </form> |
2、找到/dede/sys_admin_user.php,找到:else $rank = " WHERE CONCAT(dede_admin.usertype)='$rank' "; 在这个的下面加入:
if(!isset($keyword)) $keyword = ''; else $keyword = trim(FilterSearch($keyword)); |
找到:$query = "SELECT dede_admin.*,dede_arctype.typename FROM dede_admin LEFT JOIN dede_arctype ON dede_admin.typeid = dede_arctype.id $rank ";,修改为:
if($keyword<>'') { $query = "SELECT dede_admin.*,dede_arctype.typename FROM dede_admin LEFT JOIN dede_arctype ON dede_admin.typeid = dede_arctype.id $rank where userid LIKE '%$keyword%' OR uname LIKE '%$keyword%'"; } else { $query = "SELECT dede_admin.*,dede_arctype.typename FROM dede_admin LEFT JOIN dede_arctype ON dede_admin.typeid = dede_arctype.id $rank "; } |
到这里就完成了,做好了去试下,是不是很好用。跟版网原创
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!