--- fenglin/bbs/search_user.php 2025/03/12 08:03:53 1.9 +++ fenglin/bbs/search_user.php 2025/03/27 12:29:03 1.11 @@ -35,18 +35,14 @@ $search_author=addslashes(stripslashes($ $db_conn=include "./db_open.inc.php"; -$rs=mysql_query("select user_online.SID from user_online". - " where UID=0 and current_action not in". - " ('max_user_limit','max_ip_limit','max_session_limit','exit')". - " group by SID") +$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 and current_action not in". - " ('max_user_limit','max_ip_limit','max_session_limit','exit')". - " group by SID") +$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); @@ -57,8 +53,7 @@ $rs=mysql_query("select count(user_list. " 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%'". - ($online ? " and current_action not in". - " ('max_user_limit','max_ip_limit','max_session_limit','exit')":""). + ($online ? " AND TIMESTAMPDIFF(SECOND, last_tm, NOW()) <= $BBS_user_off_line" : ""). ($friend ? " and friend_list.UID=".$_SESSION["BBS_uid"]:"") ) or die("Query user error!"); @@ -170,8 +165,7 @@ $rs=mysql_query("select user_list.UID,us " 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%'". - ($online ? " and current_action not in". - " ('max_user_limit','max_ip_limit','max_session_limit','exit')":""). + ($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") @@ -211,7 +205,6 @@ while($row=mysql_fetch_array($rs))