| 1 |
<? |
<? |
| 2 |
require_once "./session_init.inc.php"; |
require_once "./session_init.inc.php"; |
| 3 |
|
require_once "./user_level.inc.php"; |
| 4 |
?> |
?> |
| 5 |
<? |
<? |
| 6 |
set_user_action("search_user"); |
set_user_action("search_user"); |
| 7 |
|
|
| 8 |
$page_max_record=60; |
$page_max_record=20; |
| 9 |
|
|
| 10 |
if (isset($_GET["page"])) |
if (isset($_GET["page"])) |
| 11 |
$page=intval($_GET["page"]); |
$page=intval($_GET["page"]); |
| 17 |
if (isset($_GET["type"])) |
if (isset($_GET["type"])) |
| 18 |
$type=intval($_GET["type"]); |
$type=intval($_GET["type"]); |
| 19 |
else |
else |
| 20 |
$type=1; |
$type=2; |
| 21 |
if (!($_SESSION["BBS_priv"]->checklevel(P_ADMIN_M) || |
|
| 22 |
$_SESSION["BBS_priv"]->checklevel(P_ADMIN_S) || |
if (isset($_GET["online"])) |
| 23 |
$_SESSION["BBS_priv"]->checklevel(P_MAN_C))) |
$online=($_GET["online"]=="on"); |
| 24 |
{ |
else |
| 25 |
$type=1; |
$online=0; |
| 26 |
} |
|
| 27 |
|
if (isset($_GET["friend"])) |
| 28 |
|
$friend=($_GET["friend"]=="on"); |
| 29 |
|
else |
| 30 |
|
$friend=0; |
| 31 |
|
|
| 32 |
if (isset($_GET["search_text"])) |
if (isset($_GET["search_text"])) |
| 33 |
$search_text=trim($_GET["search_text"]); |
$search_text=trim($_GET["search_text"]); |
| 37 |
|
|
| 38 |
$db_conn=include "./db_open.inc.php"; |
$db_conn=include "./db_open.inc.php"; |
| 39 |
|
|
| 40 |
|
$rs=mysql_query("select user_online.SID from user_online". |
| 41 |
|
" where UID=0 and current_action not in". |
| 42 |
|
" ('max_user_limit','max_ip_limit','max_session_limit','exit')". |
| 43 |
|
" group by SID") |
| 44 |
|
or die("Count guest error!"); |
| 45 |
|
$guest_count=mysql_num_rows($rs); |
| 46 |
|
mysql_free_result($rs); |
| 47 |
|
|
| 48 |
|
$rs=mysql_query("select user_online.SID from user_online". |
| 49 |
|
" where UID<>0 and current_action not in". |
| 50 |
|
" ('max_user_limit','max_ip_limit','max_session_limit','exit')". |
| 51 |
|
" group by SID") |
| 52 |
|
or die("Count user error!"); |
| 53 |
|
$user_count=mysql_num_rows($rs); |
| 54 |
|
mysql_free_result($rs); |
| 55 |
|
|
| 56 |
$rs=mysql_query("select count(user_list.UID) as rec_count from user_list". |
$rs=mysql_query("select count(user_list.UID) as rec_count from user_list". |
| 57 |
|
($online?" inner join user_online on user_list.UID=user_online.UID":""). |
| 58 |
|
($friend?" inner join friend_list on user_list.UID=friend_list.fUID":""). |
| 59 |
" inner join user_pubinfo on user_list.UID=user_pubinfo.UID where". |
" inner join user_pubinfo on user_list.UID=user_pubinfo.UID where". |
| 60 |
" user_list.enable and ".($type==1?"user_pubinfo.nickname":"user_list.username"). |
" user_list.enable and ".($type==1?"user_pubinfo.nickname":"user_list.username"). |
| 61 |
" like '%$search_author%'") |
" like '%$search_author%'". |
| 62 |
|
($online ? " and current_action not in". |
| 63 |
|
" ('max_user_limit','max_ip_limit','max_session_limit','exit')":""). |
| 64 |
|
($friend ? " and friend_list.UID=".$_SESSION["BBS_uid"]:"") |
| 65 |
|
) |
| 66 |
or die("Query user error!"); |
or die("Query user error!"); |
| 67 |
|
|
| 68 |
$row=mysql_fetch_array($rs); |
$row=mysql_fetch_array($rs); |
| 69 |
$toa=$u_count=$row["rec_count"]; |
$u_count=$row["rec_count"]; |
| 70 |
|
|
| 71 |
mysql_free_result($rs); |
mysql_free_result($rs); |
| 72 |
|
|
| 73 |
|
$toa=$u_count; |
| 74 |
if ($toa==0) |
if ($toa==0) |
| 75 |
$toa=1; |
$toa=1; |
| 76 |
|
|
| 82 |
?> |
?> |
| 83 |
<html> |
<html> |
| 84 |
<head> |
<head> |
| 85 |
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| 86 |
<title>用户查找结果</title> |
<title>鐢ㄦ埛鏌ユ壘缁撴灉</title> |
| 87 |
<link rel="stylesheet" href="css/default.css" type="text/css"> |
<link rel="stylesheet" href="css/default.css" type="text/css"> |
| 88 |
<script language="JavaScript" src="/js/nw_open.js"></script> |
|
| 89 |
|
<style type="text/css"> |
| 90 |
|
TD.head,TD.level,TD.login_dt,TD.dark,TD.username |
| 91 |
|
{ |
| 92 |
|
border-right: #d0d3F0 1px solid; |
| 93 |
|
border-left: #d0d3F0 1px solid; |
| 94 |
|
border-bottom: #d0d3F0 1px solid; |
| 95 |
|
} |
| 96 |
|
TD.head |
| 97 |
|
{ |
| 98 |
|
font-family: 妤蜂綋; |
| 99 |
|
color:#909090; |
| 100 |
|
} |
| 101 |
|
TD.login_dt,TD.level,TD.dark,TD.username |
| 102 |
|
{ |
| 103 |
|
text-align:center; |
| 104 |
|
} |
| 105 |
|
TD.login_dt,TD.dark |
| 106 |
|
{ |
| 107 |
|
color:#909090; |
| 108 |
|
background-color:#eaf0Fa; |
| 109 |
|
} |
| 110 |
|
TD.head,TD.level |
| 111 |
|
{ |
| 112 |
|
background-color:#fafbfc; |
| 113 |
|
} |
| 114 |
|
TD.level |
| 115 |
|
{ |
| 116 |
|
color:orange; |
| 117 |
|
} |
| 118 |
|
</style> |
| 119 |
|
|
| 120 |
|
<script language="JavaScript" src="/js/nw_open.js"></script> |
| 121 |
</head> |
</head> |
| 122 |
<body> |
<body> |
| 123 |
<center> |
<center> |
| 124 |
<table border="0" cellpadding="1" cellspacing="0" width="770"> |
<table cols="2" border="0" cellpadding="0" cellspacing="0" width="770"> |
| 125 |
<tr bgcolor="#d0d3F0" height="20"> |
<tr> |
| 126 |
<td align="center" class="title"> |
<td colspan="2" style="color:green;"> |
| 127 |
|
<a class="s2" href="main.php">鏋灄鍦ㄧ嚎璁哄潧</a>>>鏌ユ壘<? echo ($online?"鍦ㄧ嚎":""); ?><? echo ($friend?"濂藉弸":"鐢ㄦ埛"); ?> |
| 128 |
|
</td> |
| 129 |
|
</tr> |
| 130 |
|
<tr bgcolor="#d0d3F0" height="2"> |
| 131 |
|
<td colspan="2"></td></tr> |
| 132 |
|
<tr> |
| 133 |
|
<td class="dark" width="3%"></td> |
| 134 |
|
<td class="head" width="97%"> |
| 135 |
<? if ($u_count==0) |
<? if ($u_count==0) |
| 136 |
{ |
{ |
| 137 |
?> |
?> |
| 138 |
未找到指定用户<? } |
鏈壘鍒版寚瀹氱敤鎴<? } |
| 139 |
else |
else |
| 140 |
{ |
{ |
| 141 |
?>用户查找结果(共<? echo $u_count; ?>位)<? } ?> |
?>鐢ㄦ埛鏌ユ壘缁撴灉锛堝叡<? echo $u_count; ?>浣嶏級<? } ?> |
| 142 |
|
锛堝綋鍓嶅湪绾挎敞鍐岀敤鎴<? echo $user_count; ?>浣嶏紝娓稿<? echo $guest_count; ?>浣嶏級 |
| 143 |
</td> |
</td> |
| 144 |
</tr> |
</tr> |
| 145 |
</table> |
</table> |
| 146 |
<table bgcolor="#f0F3Fa" border="0" cellpadding="5" cellspacing="0" width="770"> |
<table border="0" cellpadding="1" cellspacing="0" width="770"> |
| 147 |
<tr> |
<tr height="10"> |
| 148 |
<td width="5%"> |
<td> |
|
</td> |
|
|
<td width="15%"> |
|
|
</td> |
|
|
<td width="15%"> |
|
|
</td> |
|
|
<td width="15%"> |
|
|
</td> |
|
|
<td width="15%"> |
|
|
</td> |
|
|
<td width="15%"> |
|
|
</td> |
|
|
<td width="15%"> |
|
|
</td> |
|
|
<td width="5%"> |
|
| 149 |
</td> |
</td> |
| 150 |
</tr> |
</tr> |
| 151 |
|
</table> |
| 152 |
|
<table bgcolor="#f0F3Fa" border="0" cellpadding="0" cellspacing="0" width="770"> |
| 153 |
|
<tr bgcolor="#d0d3F0" height="20"> |
| 154 |
|
<td class="title" width="4%"></td> |
| 155 |
|
<td class="title" width="15%">鐢ㄦ埛ID</td> |
| 156 |
|
<td class="title" width="20%">鏄电О</td> |
| 157 |
|
<td class="title" width="12%">绛夌骇</td> |
| 158 |
|
<td class="title" width="18%">鏈鍚庣櫥闄嗘椂闂</td> |
| 159 |
|
<td class="title" width="27%"></td> |
| 160 |
|
<td class="title" width="4%"></td> |
| 161 |
|
</tr> |
| 162 |
<? |
<? |
| 163 |
$color[0]="#f0F3Fa"; |
$color[0]="#f0F3Fa"; |
| 164 |
$color[1]="#FAFBFC"; |
$color[1]="#FAFBFC"; |
| 165 |
$color_index=-1; |
$color_index=-1; |
| 166 |
$color_count=2; |
$color_count=2; |
| 167 |
|
|
| 168 |
$rs=mysql_query("select user_list.UID,username,nickname,". |
$rs=mysql_query("select user_list.UID,username,nickname,exp,". |
| 169 |
"IF(user_pubinfo.gender_pub,IF(user_pubinfo.gender='M',". |
"gender,gender_pub,last_login_dt from user_list". |
| 170 |
"'<font color=blue>♂</font>','<font color=red>♀</font>'),'') as gender". |
($online?" inner join user_online on user_list.UID=user_online.UID":""). |
| 171 |
" from user_list". |
($friend?" inner join friend_list on user_list.UID=friend_list.fUID":""). |
| 172 |
" inner join user_pubinfo on user_list.UID=user_pubinfo.UID where". |
" inner join user_pubinfo on user_list.UID=user_pubinfo.UID where". |
| 173 |
" user_list.enable and ".($type==1?"user_pubinfo.nickname":"user_list.username"). |
" user_list.enable and ".($type==1?"user_pubinfo.nickname":"user_list.username"). |
| 174 |
" like '%$search_author%' order by ".($type==1?"nickname":"username"). |
" like '%$search_author%'". |
| 175 |
|
($online ? " and current_action not in". |
| 176 |
|
" ('max_user_limit','max_ip_limit','max_session_limit','exit')":""). |
| 177 |
|
($friend ? " and friend_list.UID=".$_SESSION["BBS_uid"]:""). |
| 178 |
|
" order by ".($type==1?"nickname":"username"). |
| 179 |
" limit ".($page-1)*$page_max_record.",$page_max_record") |
" limit ".($page-1)*$page_max_record.",$page_max_record") |
| 180 |
or die("Query user error!"); |
or die("Query user error!"); |
| 181 |
|
|
| 182 |
do |
while($row=mysql_fetch_array($rs)) |
| 183 |
{ |
{ |
| 184 |
$color_index=($color_index+1)%$color_count; |
$color_index=($color_index+1)%$color_count; |
| 185 |
?> |
?> |
| 186 |
<tr bgcolor="<? echo $color[$color_index]; ?>"> |
<tr height="25"> |
| 187 |
<td align="center"> |
<td class="dark"> |
| 188 |
</td> |
<? |
| 189 |
<? |
if ($row["gender_pub"]) |
| 190 |
for ($i=1; $i<=6; $i=$i+1) |
{ |
| 191 |
|
if ($row["gender"] == 'M') |
| 192 |
|
echo ("<font color=blue>鈾</font>"); |
| 193 |
|
else |
| 194 |
|
echo ("<font color=red>鈾</font>"); |
| 195 |
|
} |
| 196 |
|
else |
| 197 |
{ |
{ |
| 198 |
if ($row=mysql_fetch_array($rs)) |
echo ("<font color=green>?</font>"); |
| 199 |
{ |
} |
| 200 |
?> |
?> |
|
<td align="center" onmouseover="this.bgColor='#f0FaFf';" onmouseout="this.bgColor='<? echo $color[$color_index]; ?>';"> |
|
|
<? echo $row["gender"]; ?><a class="s2" href="javascript:show_profile(<? echo $row["UID"]; ?>)"><? echo ($type==1?$row["nickname"]:$row["username"]); ?></a> |
|
| 201 |
</td> |
</td> |
| 202 |
<? |
<td class="username" bgcolor="#fafbfc" onmouseover="this.bgColor='#eaf0Fa';" onmouseout="this.bgColor='#fafbfc';"> |
| 203 |
} |
<a class="s2" href="javascript:show_profile(<? echo $row["UID"]; ?>)"><? echo $row["username"]; ?></a> |
| 204 |
else |
</td> |
| 205 |
{ |
<td class="dark"> |
| 206 |
?> |
<? echo $row["nickname"]; ?> |
| 207 |
<td align="center"> |
</td> |
| 208 |
|
<td class="level"> |
| 209 |
|
<? echo user_level($row["exp"]); ?> |
| 210 |
|
</td> |
| 211 |
|
<td class="login_dt"> |
| 212 |
|
<? echo $row["last_login_dt"]; ?> |
| 213 |
|
</td> |
| 214 |
|
<td class="level"> |
| 215 |
|
<a class="s2" href="javascript:NW_open('send_msg.php?user_id=<? echo $row["UID"]; ?>','send_msg',500,300)">鍙戦佹秷鎭</a> |
| 216 |
|
<a class="s2" href="javascript:NW_open('bbs_email.php?user_id=<? echo $row["UID"]; ?>','send_msg',500,300)">鍙戦侀偖浠</a> |
| 217 |
</td> |
</td> |
|
<? |
|
|
} |
|
|
} |
|
|
?> |
|
| 218 |
<td align="center"> |
<td align="center"> |
| 219 |
</td> |
</td> |
| 220 |
</tr> |
</tr> |
| 221 |
<? |
<? |
| 222 |
}while($row); |
} |
| 223 |
?> |
?> |
| 224 |
</table> |
</table> |
| 225 |
<? |
<? |
| 239 |
<td width="25%" align="center" style="color:#909090"> |
<td width="25%" align="center" style="color:#909090"> |
| 240 |
<form action="search_user.php" method="get" id="change_page" name="change_page"> |
<form action="search_user.php" method="get" id="change_page" name="change_page"> |
| 241 |
<input type="hidden" id="search_text" name="search_text" value="<? echo $search_text;?>"> |
<input type="hidden" id="search_text" name="search_text" value="<? echo $search_text;?>"> |
| 242 |
分页: <? echo $page; ?>/<? echo $page_total; ?>页 |
<input type="hidden" id="online" name="online" value="<? echo ($online?"on":"off"); ?>"> |
| 243 |
|
<input type="hidden" id="friend" name="friend" value="<? echo ($friend?"on":"off"); ?>"> |
| 244 |
|
鍒嗛〉: <? echo $page; ?>/<? echo $page_total; ?>椤 |
| 245 |
<? if ($page>1) |
<? if ($page>1) |
| 246 |
{ |
{ |
| 247 |
?><a class="s8" title="首页" href="search_user.php?page=1&type=<? echo $type; ?><? if ($search_text!="") echo "&search_text=".$search_text;?>"><font face=webdings>9</font></a><a class="s8" title="上一页" href="search_user.php?page=<? echo $page-1; ?>&type=<? echo $type; ?><? if ($search_text!="") echo "&search_text=".$search_text;?>"><font face=webdings>7</font></a><? } |
?><a class="s8" title="棣栭〉" href="search_user.php?page=1&type=<? echo $type; ?>&online=<? echo ($online?"on":"off"); ?>&friend=<? echo ($friend?"on":"off"); ?><? if ($search_text!="") echo "&search_text=".$search_text;?>"><font face=webdings>9</font></a><a class="s8" title="涓婁竴椤" href="search_user.php?page=<? echo $page-1; ?>&type=<? echo $type; ?>&online=<? echo ($online?"on":"off"); ?>&friend=<? echo ($friend?"on":"off"); ?><? if ($search_text!="") echo "&search_text=".$search_text;?>"><font face=webdings>7</font></a><? } |
| 248 |
else |
else |
| 249 |
{ |
{ |
| 250 |
?><font face=webdings>97</font><? } ?> |
?><font face=webdings>97</font><? } ?> |
| 251 |
<input id="page_id" name="page" value="<? echo ($page) ; ?>" size="2"> |
<input id="page_id" name="page" value="<? echo ($page) ; ?>" size="2"> |
| 252 |
<? if ($page<$page_total) |
<? if ($page<$page_total) |
| 253 |
{ |
{ |
| 254 |
?><a class="s8" title="下一页" href="search_user.php?page=<? echo $page+1; ?>&type=<? echo $type; ?><? if ($search_text!="") echo "&search_text=".$search_text;?>"><font face=webdings>8</font></a><a class="s8" title="尾页" href="search_user.php?page=<? echo $page_total; ?>&type=<? echo $type; ?><? if ($search_text!="") echo "&search_text=".$search_text;?>"><font face=webdings>:</font></a><? } |
?><a class="s8" title="涓嬩竴椤" href="search_user.php?page=<? echo $page+1; ?>&type=<? echo $type; ?>&online=<? echo ($online?"on":"off"); ?>&friend=<? echo ($friend?"on":"off"); ?><? if ($search_text!="") echo "&search_text=".$search_text;?>"><font face=webdings>8</font></a><a class="s8" title="灏鹃〉" href="search_user.php?page=<? echo $page_total; ?>&type=<? echo $type; ?>&online=<? echo ($online?"on":"off"); ?>&friend=<? echo ($friend?"on":"off"); ?><? if ($search_text!="") echo "&search_text=".$search_text;?>"><font face=webdings>:</font></a><? } |
| 255 |
else |
else |
| 256 |
{ |
{ |
| 257 |
?><font face=webdings>8:</font><? } ?> |
?><font face=webdings>8:</font><? } ?> |
| 259 |
</td> |
</td> |
| 260 |
<td width="50" align="center"> |
<td width="50" align="center"> |
| 261 |
<form action="search_user.php" method="get" id="search"> |
<form action="search_user.php" method="get" id="search"> |
| 262 |
<font color=#909090>查找用户</font> |
<font color=#909090>鏌ユ壘鐢ㄦ埛</font> |
| 263 |
<select name="type"> |
<select name="type"> |
| 264 |
<option value="1" <? if ($type==1) echo "selected"; ?> >按昵称</option> |
<option value="2" <? if ($type==2) echo "selected"; ?> >鎸夌敤鎴峰悕</option> |
| 265 |
<? |
<option value="1" <? if ($type==1) echo "selected"; ?> >鎸夋樀绉</option> |
|
if ($_SESSION["BBS_priv"]->checklevel(P_ADMIN_M) || |
|
|
$_SESSION["BBS_priv"]->checklevel(P_ADMIN_S) || |
|
|
$_SESSION["BBS_priv"]->checklevel(P_MAN_C)) |
|
|
{ |
|
|
?> |
|
|
<option value="2" <? if ($type==2) echo "selected"; ?> >按用户名</option> |
|
|
<? |
|
|
} |
|
|
?> |
|
| 266 |
</select> |
</select> |
| 267 |
<input type="text" id="search_text" name="search_text" size="15"> <input type=image src="images/search.gif" alt="按昵称查找注册用户" border="0" name="image"></a> |
<input type="text" id="search_text" name="search_text" size="15"> |
| 268 |
|
<input type="checkbox" id="online" name="online" <? echo ($online?"checked":"");?> ><font color=#909090>鍦ㄧ嚎</font> |
| 269 |
|
<input type="checkbox" id="friend" name="friend" <? echo ($friend?"checked":"");?> ><font color=#909090>濂藉弸</font> |
| 270 |
|
<input type=image src="images/search.gif" alt="鏌ユ壘鐢ㄦ埛" border="0" name="image"></a> |
| 271 |
</form> |
</form> |
| 272 |
</td> |
</td> |
| 273 |
<td width="25"> |
<td width="25"> |