/[LeafOK_CVS]/fenglin/bbs/search_user.php
ViewVC logotype

Diff of /fenglin/bbs/search_user.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.4 by sysadm, Wed Dec 1 12:52:14 2004 UTC Revision 1.12 by sysadm, Fri Mar 28 05:55:16 2025 UTC
# Line 1  Line 1 
1  <?  <?
2            require_once "../lib/db_open.inc.php";
3          require_once "./session_init.inc.php";          require_once "./session_init.inc.php";
4          require_once "./user_level.inc.php";          require_once "./user_level.inc.php";
5  ?>  ?>
6  <?  <?
 set_user_action("search_user");  
   
7  $page_max_record=20;  $page_max_record=20;
8    
9  if (isset($_GET["page"]))  if (isset($_GET["page"]))
# Line 17  if ($page<1) Line 16  if ($page<1)
16  if (isset($_GET["type"]))  if (isset($_GET["type"]))
17          $type=intval($_GET["type"]);          $type=intval($_GET["type"]);
18  else  else
19          $type=1;          $type=2;
20    
21  if (isset($_GET["online"]))  if (isset($_GET["online"]))
22          $online=($_GET["online"]=="on");          $online=($_GET["online"]=="on");
# Line 35  else Line 34  else
34          $search_text="";          $search_text="";
35  $search_author=addslashes(stripslashes($search_text));  $search_author=addslashes(stripslashes($search_text));
36    
37  $db_conn=include "./db_open.inc.php";  $rs=mysql_query("select user_online.SID from user_online WHERE UID = 0".
38            ($online ? " AND TIMESTAMPDIFF(SECOND, last_tm, NOW()) <= $BBS_user_off_line" : ""))
 $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")  
39          or die("Count guest error!");          or die("Count guest error!");
40  $guest_count=mysql_num_rows($rs);  $guest_count=mysql_num_rows($rs);
41  mysql_free_result($rs);  mysql_free_result($rs);
42    
43  $rs=mysql_query("select user_online.UID from user_online".  $rs=mysql_query("select user_online.SID from user_online WHERE UID <> 0".
44          " where UID<>0 and current_action not in".          ($online ? " AND TIMESTAMPDIFF(SECOND, last_tm, NOW()) <= $BBS_user_off_line" : ""))
         " ('max_user_limit','max_ip_limit','max_session_limit','exit')".  
         " group by SID")  
45          or die("Count user error!");          or die("Count user error!");
46  $user_count=mysql_num_rows($rs);  $user_count=mysql_num_rows($rs);
47  mysql_free_result($rs);  mysql_free_result($rs);
# Line 59  $rs=mysql_query("select count(user_list. Line 52  $rs=mysql_query("select count(user_list.
52          " inner join user_pubinfo on user_list.UID=user_pubinfo.UID where".          " inner join user_pubinfo on user_list.UID=user_pubinfo.UID where".
53          " user_list.enable and ".($type==1?"user_pubinfo.nickname":"user_list.username").          " user_list.enable and ".($type==1?"user_pubinfo.nickname":"user_list.username").
54          " like '%$search_author%'".          " like '%$search_author%'".
55          ($online ? " and current_action not in".          ($online ? " AND TIMESTAMPDIFF(SECOND, last_tm, NOW()) <= $BBS_user_off_line" : "").
         " ('max_user_limit','max_ip_limit','max_session_limit','exit')":"").  
56          ($friend ? " and friend_list.UID=".$_SESSION["BBS_uid"]:"")          ($friend ? " and friend_list.UID=".$_SESSION["BBS_uid"]:"")
57          )          )
58          or die("Query user error!");          or die("Query user error!");
# Line 82  if ($page>$page_total) Line 74  if ($page>$page_total)
74  ?>  ?>
75  <html>  <html>
76          <head>          <head>
77                  <meta http-equiv="Content-Type" content="text/html; charset=gb2312">                  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
78                  <title>用户查找结果</title>                  <title>鐢ㄦ埛鏌ユ壘缁撴灉</title>
79                  <link rel="stylesheet" href="css/default.css" type="text/css">                  <link rel="stylesheet" href="css/default.css" type="text/css">
80    
81  <style type="text/css">  <style type="text/css">
# Line 95  TD.head,TD.level,TD.login_dt,TD.dark,TD. Line 87  TD.head,TD.level,TD.login_dt,TD.dark,TD.
87  }  }
88  TD.head  TD.head
89  {  {
90          font-family: 楷体_GB2312;          font-family: 妤蜂綋;
91          color:#909090;          color:#909090;
92  }  }
93  TD.login_dt,TD.level,TD.dark,TD.username  TD.login_dt,TD.level,TD.dark,TD.username
# Line 124  TD.level Line 116  TD.level
116                          <table cols="2" border="0" cellpadding="0" cellspacing="0" width="770">                          <table cols="2" border="0" cellpadding="0" cellspacing="0" width="770">
117                                  <tr>                                  <tr>
118                                          <td colspan="2" style="color:green;">                                          <td colspan="2" style="color:green;">
119                                                  <a class="s2" href="main.php">枫林在线论坛</a>&gt;&gt;查找<? echo ($online?"在线":""); ?><? echo ($friend?"好友":"用户"); ?>                                                  <a class="s2" href="main.php"><? echo $BBS_name; ?></a>&gt;&gt;鏌ユ壘<? echo ($online?"鍦ㄧ嚎":""); ?><? echo ($friend?"濂藉弸":"鐢ㄦ埛"); ?>
120                                          </td>                                          </td>
121                                  </tr>                                  </tr>
122                                  <tr bgcolor="#d0d3F0" height="2">                                  <tr bgcolor="#d0d3F0" height="2">
# Line 135  TD.level Line 127  TD.level
127                                                  <? if ($u_count==0)                                                  <? if ($u_count==0)
128  {  {
129  ?>  ?>
130                                                  未找到指定用户<? }                                                  鏈壘鍒版寚瀹氱敤鎴<? }
131          else          else
132  {  {
133  ?>用户查找结果(共<? echo $u_count; ?>位)<? } ?>  ?>鐢ㄦ埛鏌ユ壘缁撴灉锛堝叡<? echo $u_count; ?>浣嶏級<? } ?>
134                                                  (当前在线注册用户<? echo $user_count; ?>位,游客<? echo $guest_count; ?>位)                                                  锛堝綋鍓嶅湪绾挎敞鍐岀敤鎴<? echo $user_count; ?>浣嶏紝娓稿<? echo $guest_count; ?>浣嶏級
135                                          </td>                                          </td>
136                                  </tr>                                  </tr>
137                          </table>                          </table>
# Line 152  TD.level Line 144  TD.level
144                          <table bgcolor="#f0F3Fa" border="0" cellpadding="0" cellspacing="0" width="770">                          <table bgcolor="#f0F3Fa" border="0" cellpadding="0" cellspacing="0" width="770">
145                                  <tr bgcolor="#d0d3F0" height="20">                                  <tr bgcolor="#d0d3F0" height="20">
146                                          <td class="title" width="4%"></td>                                          <td class="title" width="4%"></td>
147                                          <td class="title" width="15%">用户ID</td>                                          <td class="title" width="15%">鐢ㄦ埛ID</td>
148                                          <td class="title" width="20%">昵称</td>                                          <td class="title" width="20%">鏄电О</td>
149                                          <td class="title" width="12%">等级</td>                                          <td class="title" width="12%">绛夌骇</td>
150                                          <td class="title" width="18%">最后登陆时间</td>                                          <td class="title" width="18%">鏈鍚庣櫥闄嗘椂闂</td>
151                                          <td class="title" width="27%"></td>                                          <td class="title" width="27%"></td>
152                                          <td class="title" width="4%"></td>                                          <td class="title" width="4%"></td>
153                                  </tr>                                  </tr>
# Line 172  $rs=mysql_query("select user_list.UID,us Line 164  $rs=mysql_query("select user_list.UID,us
164          " inner join user_pubinfo on user_list.UID=user_pubinfo.UID where".          " inner join user_pubinfo on user_list.UID=user_pubinfo.UID where".
165          " user_list.enable and ".($type==1?"user_pubinfo.nickname":"user_list.username").          " user_list.enable and ".($type==1?"user_pubinfo.nickname":"user_list.username").
166          " like '%$search_author%'".          " like '%$search_author%'".
167          ($online ? " and current_action not in".          ($online ? " AND TIMESTAMPDIFF(SECOND, last_tm, NOW()) <= $BBS_user_off_line":"").
         " ('max_user_limit','max_ip_limit','max_session_limit','exit')":"").  
168          ($friend ? " and friend_list.UID=".$_SESSION["BBS_uid"]:"").          ($friend ? " and friend_list.UID=".$_SESSION["BBS_uid"]:"").
169          " order by ".($type==1?"nickname":"username").          " order by ".($type==1?"nickname":"username").
170          " limit ".($page-1)*$page_max_record.",$page_max_record")          " limit ".($page-1)*$page_max_record.",$page_max_record")
# Line 189  while($row=mysql_fetch_array($rs)) Line 180  while($row=mysql_fetch_array($rs))
180          if ($row["gender_pub"])          if ($row["gender_pub"])
181          {          {
182                  if ($row["gender"] == 'M')                  if ($row["gender"] == 'M')
183                          echo ("<font color=blue>♂</font>");                          echo ("<font color=blue>鈾</font>");
184                  else                  else
185                          echo ("<font color=red>♀</font>");                          echo ("<font color=red>鈾</font>");
186          }          }
187          else          else
188          {          {
# Line 212  while($row=mysql_fetch_array($rs)) Line 203  while($row=mysql_fetch_array($rs))
203                                                  <? echo $row["last_login_dt"]; ?>                                                  <? echo $row["last_login_dt"]; ?>
204                                          </td>                                          </td>
205                                          <td class="level">                                          <td class="level">
206                                                  <a class="s2" href="javascript:NW_open('send_msg.php?user_id=<? echo $row["UID"]; ?>','send_msg',500,300)">发送消息</a>                                                  <a class="s2" href="javascript:NW_open('send_msg.php?user_id=<? echo $row["UID"]; ?>','send_msg',500,300)">鍙戦佹秷鎭</a>
                                                 <a class="s2" href="javascript:NW_open('bbs_email.php?user_id=<? echo $row["UID"]; ?>','send_msg',500,300)">发送邮件</a>  
207                                          </td>                                          </td>
208                                          <td align="center">                                          <td align="center">
209                                          </td>                                          </td>
# Line 241  mysql_close($db_conn); Line 231  mysql_close($db_conn);
231        <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;?>">
232        <input type="hidden" id="online" name="online" value="<? echo ($online?"on":"off"); ?>">        <input type="hidden" id="online" name="online" value="<? echo ($online?"on":"off"); ?>">
233        <input type="hidden" id="friend" name="friend" value="<? echo ($friend?"on":"off"); ?>">        <input type="hidden" id="friend" name="friend" value="<? echo ($friend?"on":"off"); ?>">
234        分页: <? echo $page; ?>/<? echo $page_total; ?>页        鍒嗛〉: <? echo $page; ?>/<? echo $page_total; ?>椤
235  <? if ($page>1)  <? if ($page>1)
236  {  {
237  ?><a class="s8" title="首页" href="search_user.php?page=1&amp;type=<? echo $type; ?>&amp;online=<? echo ($online?"on":"off"); ?>&amp;friend=<? echo ($friend?"on":"off"); ?><? if ($search_text!="") echo "&amp;search_text=".$search_text;?>"><font face=webdings>9</font></a><a class="s8" title="上一页" href="search_user.php?page=<? echo $page-1; ?>&amp;type=<? echo $type; ?>&amp;online=<? echo ($online?"on":"off"); ?>&amp;friend=<? echo ($friend?"on":"off"); ?><? if ($search_text!="") echo "&amp;search_text=".$search_text;?>"><font face=webdings>7</font></a><? }  ?><a class="s8" title="棣栭〉" href="search_user.php?page=1&amp;type=<? echo $type; ?>&amp;online=<? echo ($online?"on":"off"); ?>&amp;friend=<? echo ($friend?"on":"off"); ?><? if ($search_text!="") echo "&amp;search_text=".$search_text;?>"><font face=webdings>9</font></a><a class="s8" title="涓婁竴椤" href="search_user.php?page=<? echo $page-1; ?>&amp;type=<? echo $type; ?>&amp;online=<? echo ($online?"on":"off"); ?>&amp;friend=<? echo ($friend?"on":"off"); ?><? if ($search_text!="") echo "&amp;search_text=".$search_text;?>"><font face=webdings>7</font></a><? }
238    else    else
239  {  {
240  ?><font face=webdings>97</font><? } ?>  ?><font face=webdings>97</font><? } ?>
241        <input id="page_id" name="page" value="<? echo ($page) ; ?>" size="2">        <input id="page_id" name="page" value="<? echo ($page) ; ?>" size="2">
242  <? if ($page<$page_total)  <? if ($page<$page_total)
243  {  {
244  ?><a class="s8" title="下一页" href="search_user.php?page=<? echo $page+1; ?>&amp;type=<? echo $type; ?>&amp;online=<? echo ($online?"on":"off"); ?>&amp;friend=<? echo ($friend?"on":"off"); ?><? if ($search_text!="") echo "&amp;search_text=".$search_text;?>"><font face=webdings>8</font></a><a class="s8" title="尾页" href="search_user.php?page=<? echo $page_total; ?>&amp;type=<? echo $type; ?>&amp;online=<? echo ($online?"on":"off"); ?>&amp;friend=<? echo ($friend?"on":"off"); ?><? if ($search_text!="") echo "&amp;search_text=".$search_text;?>"><font face=webdings>:</font></a><? }  ?><a class="s8" title="涓嬩竴椤" href="search_user.php?page=<? echo $page+1; ?>&amp;type=<? echo $type; ?>&amp;online=<? echo ($online?"on":"off"); ?>&amp;friend=<? echo ($friend?"on":"off"); ?><? if ($search_text!="") echo "&amp;search_text=".$search_text;?>"><font face=webdings>8</font></a><a class="s8" title="灏鹃〉" href="search_user.php?page=<? echo $page_total; ?>&amp;type=<? echo $type; ?>&amp;online=<? echo ($online?"on":"off"); ?>&amp;friend=<? echo ($friend?"on":"off"); ?><? if ($search_text!="") echo "&amp;search_text=".$search_text;?>"><font face=webdings>:</font></a><? }
245    else    else
246  {  {
247  ?><font face=webdings>8:</font><? } ?>  ?><font face=webdings>8:</font><? } ?>
# Line 259  mysql_close($db_conn); Line 249  mysql_close($db_conn);
249      </td>      </td>
250                                          <td width="50" align="center">                                          <td width="50" align="center">
251                                                  <form action="search_user.php" method="get" id="search">                                                  <form action="search_user.php" method="get" id="search">
252                                                          <font color=#909090>查找用户</font>                                                          <font color=#909090>鏌ユ壘鐢ㄦ埛</font>
253                                                          <select name="type">                                                          <select name="type">
254                                                                  <option value="2" <? if ($type==2) echo "selected"; ?> >按用户名</option>                                                                  <option value="2" <? if ($type==2) echo "selected"; ?> >鎸夌敤鎴峰悕</option>
255                                                                  <option value="1" <? if ($type==1) echo "selected"; ?> >按昵称</option>                                                                  <option value="1" <? if ($type==1) echo "selected"; ?> >鎸夋樀绉</option>
256                                                          </select>                                                          </select>
257                                                          <input type="text" id="search_text" name="search_text" size="15">                                                          <input type="text" id="search_text" name="search_text" size="15">
258                                                          <input type="checkbox" id="online" name="online" <? echo ($online?"checked":"");?> ><font color=#909090>在线</font>                                                          <input type="checkbox" id="online" name="online" <? echo ($online?"checked":"");?> ><font color=#909090>鍦ㄧ嚎</font>
259                                                          <input type="checkbox" id="friend" name="friend" <? echo ($friend?"checked":"");?> ><font color=#909090>好友</font>                                                          <input type="checkbox" id="friend" name="friend" <? echo ($friend?"checked":"");?> ><font color=#909090>濂藉弸</font>
260                                                          <input type=image src="images/search.gif" alt="查找用户" border="0" name="image"></a>                                                          <input type=image src="images/search.gif" alt="鏌ユ壘鐢ㄦ埛" border="0" name="image"></a>
261                                                  </form>                                                  </form>
262                                          </td>                                          </td>
263                                          <td width="25">                                          <td width="25">
# Line 280  mysql_close($db_conn); Line 270  mysql_close($db_conn);
270  ?>  ?>
271          </body>          </body>
272  </html>  </html>
   


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1