--- fenglin/bbs/search_user.php 2004/06/10 01:56:34 1.2 +++ fenglin/bbs/search_user.php 2004/12/05 09:59:38 1.5 @@ -1,10 +1,11 @@ checklevel(P_ADMIN_M) || - $_SESSION["BBS_priv"]->checklevel(P_ADMIN_S) || - $_SESSION["BBS_priv"]->checklevel(P_MAN_C))) -{ - $type=1; -} + $type=2; + +if (isset($_GET["online"])) + $online=($_GET["online"]=="on"); +else + $online=0; + +if (isset($_GET["friend"])) + $friend=($_GET["friend"]=="on"); +else + $friend=0; if (isset($_GET["search_text"])) $search_text=trim($_GET["search_text"]); @@ -32,17 +37,40 @@ $search_author=addslashes(stripslashes($ $db_conn=include "./db_open.inc.php"; +$rs=mysql_query("select user_online.UID from user_online". + " where UID=0 and current_action not in". + " ('max_user_limit','max_ip_limit','max_session_limit','exit')". + " group by SID") + or die("Count guest error!"); +$guest_count=mysql_num_rows($rs); +mysql_free_result($rs); + +$rs=mysql_query("select user_online.UID from user_online". + " where UID<>0 and current_action not in". + " ('max_user_limit','max_ip_limit','max_session_limit','exit')". + " group by SID") + or die("Count user error!"); +$user_count=mysql_num_rows($rs); +mysql_free_result($rs); + $rs=mysql_query("select count(user_list.UID) as rec_count from user_list". + ($online?" inner join user_online on user_list.UID=user_online.UID":""). + ($friend?" inner join friend_list on user_list.UID=friend_list.fUID":""). " inner join user_pubinfo on user_list.UID=user_pubinfo.UID where". " user_list.enable and ".($type==1?"user_pubinfo.nickname":"user_list.username"). - " like '%$search_author%'") + " like '%$search_author%'". + ($online ? " and current_action not in". + " ('max_user_limit','max_ip_limit','max_session_limit','exit')":""). + ($friend ? " and friend_list.UID=".$_SESSION["BBS_uid"]:"") + ) or die("Query user error!"); $row=mysql_fetch_array($rs); -$toa=$u_count=$row["rec_count"]; +$u_count=$row["rec_count"]; mysql_free_result($rs); +$toa=$u_count; if ($toa==0) $toa=1; @@ -57,90 +85,141 @@ if ($page>$page_total) 用户查找结果 - + + + +
- - -
+ + + + + + + + +
+ 枫林在线论坛>>查找 +
未找到指定用户用户查找结果(共位) +?>用户查找结果(共位) + (当前在线注册用户位,游客位)
- - - - - - - - - -
- - - - - - - + + + +
+ + + + + + + + + + ♂',''),'') as gender". - " from user_list". +$rs=mysql_query("select user_list.UID,username,nickname,exp,". + "gender,gender_pub,last_login_dt from user_list". + ($online?" inner join user_online on user_list.UID=user_online.UID":""). + ($friend?" inner join friend_list on user_list.UID=friend_list.fUID":""). " inner join user_pubinfo on user_list.UID=user_pubinfo.UID where". " user_list.enable and ".($type==1?"user_pubinfo.nickname":"user_list.username"). - " like '%$search_author%' order by ".($type==1?"nickname":"username"). + " like '%$search_author%'". + ($online ? " and current_action not in". + " ('max_user_limit','max_ip_limit','max_session_limit','exit')":""). + ($friend ? " and friend_list.UID=".$_SESSION["BBS_uid"]:""). + " order by ".($type==1?"nickname":"username"). " limit ".($page-1)*$page_max_record.",$page_max_record") or die("Query user error!"); -do +while($row=mysql_fetch_array($rs)) { $color_index=($color_index+1)%$color_count; ?> - - - + - - + + + + -
用户ID昵称等级最后登陆时间
- +♂"); + else + echo (""); + } + else { - if ($row=mysql_fetch_array($rs)) - { + echo ("?"); + } ?> - - )"> + + )"> + + + + + + ','send_msg',500,300)">发送消息 + ','send_msg',500,300)">发送邮件
+ "> + "> 分页: /1) { -?>97&friend=">9&friend=">797 8:&friend=">8&friend=">:8: @@ -180,19 +261,13 @@ mysql_close($db_conn); 查找用户 - + + >在线 + >好友 +