--- fenglin/bbs/search_user.php 2004/06/07 06:04:16 1.1 +++ fenglin/bbs/search_user.php 2025/03/27 12:29:03 1.11 @@ -1,8 +1,9 @@ -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"]); @@ -30,17 +35,35 @@ $search_author=addslashes(stripslashes($ $db_conn=include "./db_open.inc.php"; +$rs=mysql_query("select user_online.SID from user_online WHERE UID = 0". + ($online ? " AND TIMESTAMPDIFF(SECOND, last_tm, NOW()) <= $BBS_user_off_line" : "")) + or die("Count guest error!"); +$guest_count=mysql_num_rows($rs); +mysql_free_result($rs); + +$rs=mysql_query("select user_online.SID from user_online WHERE UID <> 0". + ($online ? " AND TIMESTAMPDIFF(SECOND, last_tm, NOW()) <= $BBS_user_off_line" : "")) + 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 TIMESTAMPDIFF(SECOND, last_tm, NOW()) <= $BBS_user_off_line" : ""). + ($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; @@ -52,93 +75,142 @@ 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 TIMESTAMPDIFF(SECOND, last_tm, NOW()) <= $BBS_user_off_line":""). + ($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)">鍙戦佹秷鎭
- 分页: /页 + "> + "> + 鍒嗛〉: /1) { -?>97&friend=">9&friend=">797 8:&friend=">8&friend=">:8: @@ -176,21 +250,15 @@ mysql_close($db_conn);
- 查找用户 + 鏌ユ壘鐢ㄦ埛 - + + >鍦ㄧ嚎 + >濂藉弸 +