<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="inc/function.asp"-->
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/Conn_User.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=SiteName%> >>> 空间</title>
<link href="img0415/css.CSS" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE1 {
	color: #FF6600;
	font-weight: bold;
}
-->
</style>
<script language="JavaScript" type="text/javascript">
	function chkfrm(){
		
		if (document.Myform.Keywords.value==""){
			alert('请输入要检索的关键字！');
			document.Myform.Keywords.focus();
			return false;
		}
		
		
			var Obj = document.getElementsByName("mysort");
			for(i=0;i<Obj.length;i++){
				if(Obj[i].selected){
					if (Obj[i].value=="zone"){
						document.Myform.action="user_search.asp";
					}else if (Obj[i].value=="blog"){
						document.Myform.action="blog_search.asp";
					}else if (Obj[i].value=="photo"){
						document.Myform.action="photo_search.asp";
					}else{
						document.Myform.action="user_search.asp";
					}
				}
			}

		
		return true;
	}
</script>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--#include file="top.asp"-->
<table width="900" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="5" bgcolor="f2f2f2"></td>
    <td width="1" bgcolor="cccccc"></td>
    <td width="888" align="center" bgcolor="#FFFFFF"><table width="870" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td valign="top">
<table width="100%" height="8" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td height="9"><img src="img0415/space.gif"></td>
              </tr>
            </table>
            <table width="100%" height="40" border="0" cellpadding="0" cellspacing="0">
              <tr> 
                <td width="1" height="1"><img src="img0415/space.gif" width="1" height="1"></td>
                <td bgcolor="#CCCCCC"></td>
                <td width="1"></td>
              </tr>
              <tr> 
                <td width="1" bgcolor="#CCCCCC"><img src="img0415/space.gif" width="1" height="1"></td>
                <td height="30" bgcolor="f2f2f2"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <form id="Myform" name="Myform" onSubmit="return chkfrm();" action="" method=post>
                      <td width="28" align="center"><img src="img0415/search.gif" width="15" height="16"></td>
                      <td width="88"><select name="mysort" id="mysort" size="1" class="input2">
                          <option selected value="zone" name="mysort" id="mysort">注册用户</option>
                          <option value="photo" name="mysort" id="mysort">用户相册</option>
                          <option value="blog" name="mysort" id="mysort">用户日志</option>
                        </select>
                      </td>
                      <td width="210"><input name="Keywords" type="text" class="input2" size="35"></td>
                      <td width="70"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td height="1"><img src="img0415/space.gif" width="1" height="1"></td>
                          </tr>
                        </table>
                          <input name="imageField2" type="image" src="img0415/search2.gif" width="56" height="19" border="0">
                      </td>
                      <td>&nbsp;</td>
                    </form>
                  </tr>
                </table></td>
                <td width="1" bgcolor="#CCCCCC"><img src="img0415/space.gif" width="1" height="1"></td>
              </tr>
			   <tr> 
                <td width="1" height="1"><img src="img0415/space.gif" width="1" height="1"></td>
                <td bgcolor="#CCCCCC"></td>
                <td width="1"></td>
              </tr>
            </table>
            
            <table width="100%" height="8" border="0" cellpadding="0" cellspacing="0">
              <tr> 
                <td height="9"><img src="img0415/space.gif"></td>
              </tr>
            </table>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="1" height="1"><img src="img0415/space.gif" width="1" height="1"></td>
                <td colspan="2" bgcolor="#CCCCCC"></td>
                <td width="1"></td>
              </tr>
              <tr>
                <td width="1" bgcolor="#CCCCCC"><img src="img0415/space.gif" width="1" height="1"></td>
                <td height="25" bgcolor="#f2f2f2">&nbsp;&nbsp; <font color="#FF6600" class="no"><strong>空间列表</strong></font></td>
                <td align="right" bgcolor="#f2f2f2"><strong><font color="#FF6600">排序:</font></strong>&nbsp;&nbsp;<a href="zone.asp?action=adddate"><font class="no">注册时间</font></a> | <a href="zone.asp?action=hits"><font class="no">点击次数</font></a> | <a href="zone.asp?action=logins"><font class="no">登录次数</font></a>&nbsp;&nbsp;</td>
                <td width="1" bgcolor="#CCCCCC"><img src="img0415/space.gif" width="1" height="1"></td>
              </tr>
              <tr>
                <td width="1" height="1" bgcolor="#CCCCCC"><img src="img0415/space.gif" width="1" height="1"></td>
                <td colspan="2" bgcolor="#CCCCCC"></td>
                <td width="1" bgcolor="#CCCCCC"></td>
              </tr>
            </table>
            <table width="100%" height="40" border="0" cellpadding="0" cellspacing="0">
             
              <tr> 
                <td width="1" bgcolor="#CCCCCC"><img src="img0415/space.gif" width="1" height="1"></td>
                <td height="30" align="center" bgcolor="#FFFFFF"><table width="98%" border="0" align="center" cellpadding="3" cellspacing="0">
                    <tr> 
                      <%
if request("action")<>"" then
actions=request("action")
else
actions="userid"
end if
if request("city")<>"" then
city=request("city")
myPagesize=10

set rs=server.createobject("adodb.recordset")

rs.open "select * from [user] where city='"&city&"' order by "&actions&" desc",conn_user,1,1 
call myPages(rs,myPagesize)
else
myPagesize=10

set rs=server.createobject("adodb.recordset")

rs.open "select * from [user] order by "&actions&" desc",conn_user,1,1 
call myPages(rs,myPagesize)
end if



%>
                      <%if  rs.eof then
response.Write "<td><center><br><br><br><font color='#FF6600' style='font-size:16'><strong>暂无会员&nbsp;&nbsp;</strong></font><br><br><br></center></td>"
end if%>
                      <%line=myPagesize
								i=1
do while not rs.eof and line>0
%>
                      <td width="50%"><table  width=97%  border="0" align="center" cellpadding="0" cellspacing="0">
                          <tr> 
                            <td width="85" bgcolor="#FFFFFF"> <table border="0" cellspacing="0" cellpadding="0">
                                <tr> 
                                  <td height="10"></td>
                                </tr>
                                <tr> 
                                  <td align="center" style="{background-image: URL(<%if rs("UserPhoto")<>"" then%><%=rs("UserPhoto")%><%else 
						  response.Write "images/nopic2.jpg"end if%>);
background-position: center; 
background-repeat: no-repeat; 
background-attachment: fixed;}"><a href="user.asp?userid=<%=rs("userid")%>&mdid=indexd" target="_blank"><img src="img0415/sp.gif" width="77" height="77" border="0"></a></td>
                                </tr>
                                <tr> 
                                  <td height="10"></td>
                                </tr>
                              </table></td>
                            <td align="left" valign="top" bgcolor="#FFFFFF"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr> 
                                  <td height="6"></td>
                                </tr>
                                <tr> 
                                  <td height="28"><a href="user.asp?userid=<%=rs("userid")%>&mdid=indexd" target="_blank"><font color="#FF6600" style="font-size:12" class="no"><strong>
                                    <%if rs("title")<>"" then
							   response.Write rs("title")
							   else
							   response.Write rs("username")&"&nbsp;的个人空间"
							   end if%></strong>
                                    </font></a> 
                                    <%
			if rs("Sex")=1 then
				response.write " <a href=zone2.asp?sex=1><img src=isky/boy.gif border=0 alt=男></a> "
			else
				response.write " <a href=zone2.asp?sex=0><img src=isky/girl.gif border=0 alt=女></a> "
			end if
		  %>
                                  </td>
                                </tr>
                                <tr> 
                                  <td height="18" valign="top"><font style="font-size:11"> 
                                    <%if rs("intor")<>"" then
							   response.write left(rs("intor"),30)
							   if len(rs("intor"))>30 then
							   response.Write "..."
							   end if
							   else
							   response.write "暂无个人介绍"
							   end if%>
                                    </font></td>
                                </tr>
                                <tr> 
                                  <td height="18">注册日期: <font style='FONT-SIZE: 11px'><%=FormatDateTime(rs("addDate"),2)%></font></td>
                                </tr>
                                
                              </table></td>
                          </tr>
                          <tr> 
                            <td height="1" colspan="4" bgcolor="#CCCCCC"></td>
                          </tr>
                          <tr> 
                            <td height="5" colspan="4"></td>
                          </tr>
                        </table></td>
                      <%if i mod 2=0 then%>
                    </tr>
                    <tr> 
                      <%else%>
                      <%end if%>
                      <%rs.movenext
line=line-1
i=i+1
loop
rs.close
set rs=nothing%>
                    </tr>
                  </table>
                  <center>
                    <%call listpages(mycondition)%>
                    <table width="100%" height="8" border="0" cellpadding="0" cellspacing="0">
                      <tr> 
                        <td height="9"><img src="img0415/space.gif"></td>
                      </tr>
                    </table>
                  </center></td>
                <td width="1" bgcolor="#CCCCCC"><img src="img0415/space.gif" width="1" height="1"></td>
              </tr>
              <tr> 
                <td width="1" height="1"><img src="img0415/space.gif" width="1" height="1"></td>
                <td bgcolor="#CCCCCC"></td>
                <td width="1"></td>
              </tr>
            </table>
            <table width="100%" height="8" border="0" cellpadding="0" cellspacing="0">
              <tr> 
                <td height="9"><img src="img0415/space.gif"></td>
              </tr>
            </table></td>
          <td width="9"></td>
          <td width="220" valign="top" bgcolor="fafafa" class="line1">
<table width="100%" height="8" border="0" cellpadding="0" cellspacing="0">
              <tr> 
                <td height="9"><img src="img0415/space.gif"></td>
              </tr>
            </table>
            <table border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td><img src="img0415/logintop.gif" width="200" height="7" /></td>
              </tr>
              <tr>
                <td background="img0415/loginbg.gif" bgcolor="#FFFFFF"><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                      <td height="25"><span class="STYLE1">&raquo;&nbsp;城市空间</span>&nbsp;&nbsp;<font color="#999999" style='FONT-SIZE: 9px'>City 
                        Zone </font></td>
                    </tr>
                    <tr>
                      <td height="1" background="img0415/linef.gif"></td>
                    </tr>
                    <tr>
                      <td><table width="100%" height="3" border="0" cellpadding="0" cellspacing="0">
                          <tr> 
                            <td height="3"><img src="img0415/space.gif"></td>
                          </tr>
                        </table>
                        <table width="100%" border="0" cellspacing="0" cellpadding="3">
                          <tr> 
                            <td align="center">&raquo;<a href="zone.asp?city=北京">北京</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=天津">天津</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=河北">河北</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=吉林">吉林</a></td>
                          </tr>
                          <tr bgcolor="#F7F7F7"> 
                            <td align="center">&raquo;<a href="zone.asp?city=山西">山西</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=内蒙古">内蒙古</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=辽宁">辽宁</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=安徽">安徽</a></td>
                          </tr>
                          <tr> 
                            <td align="center">&raquo;<a href="zone.asp?city=山东">山东</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=黑龙江">黑龙江</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=上海">上海</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=浙江">浙江</a></td>
                          </tr>
                          <tr bgcolor="f7f7f7"> 
                            <td align="center">&raquo;<a href="zone.asp?city=江苏">江苏</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=江西">江西</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=湖南">湖南</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=福建">福建</a></td>
                          </tr>
                          <tr> 
                            <td align="center">&raquo;<a href="zone.asp?city=甘肃">甘肃</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=青海">青海</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=宁夏">宁夏</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=贵州">贵州</a></td>
                          </tr>
                          <tr bgcolor="f7f7f7"> 
                            <td align="center">&raquo;<a href="zone.asp?city=河南">河南</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=湖北">湖北</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=陕西">陕西</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=四川">四川</a></td>
                          </tr>
                          <tr> 
                            <td align="center">&raquo;<a href="zone.asp?city=广东">广东</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=广西">广西</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=海南">海南</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=重庆">重庆</a></td>
                          </tr>
                          <tr bgcolor="f7f7f7"> 
                            <td align="center">&raquo;<a href="zone.asp?city=云南">云南</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=西藏">西藏</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=新疆">新疆</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=香港">香港</a></td>
                          </tr>
                          <tr> 
                            <td align="center">&raquo;<a href="zone.asp?city=台湾">台湾</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=澳门">澳门</a></td>
                            <td align="center">&raquo;<a href="zone.asp?city=国外">国外</a></td>
                            <td align="center">&nbsp;</td>
                          </tr>
                        </table></td>
                    </tr>
                  </table>
                  <table width="100%" height="8" border="0" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td height="5"><img src="img0415/space.gif"></td>
                    </tr>
                  </table>
                  <div align="center"><a href="help.asp" target="_blank"><img src="img0415/helps.gif" width="180" height="54" border="0"></a> 
                  </div></td>
              </tr>
              <tr>
                <td><img src="img0415/loginend.gif" width="200" height="8" /></td>
              </tr>
            </table>
            <div align="center"> 
              <table width="100%" height="8" border="0" cellpadding="0" cellspacing="0">
                <tr> 
                  <td height="13"><img src="img0415/space.gif"></td>
                </tr>
              </table>
              <div align="center"></div>
            </div></td>
        </tr>
      </table> </td>
    <td width="1" bgcolor="#CCCCCC"><img src="img0415/space.gif" width="1" height="1"><img src="img0415/space.gif"></td>
    <td width="5" bgcolor="f2f2f2"></td>
  </tr>
</table>
<%sub listpages(mycondition)

	response.write "<table height=22  border=0 cellpadding=0 cellspacing=0><Tr><td><table width='100%' border=0 cellspacing=0 cellpadding=0><tr><td height=3></td></tr></table>"
	if pages<1 then
		exit sub
	end if
	
	
	if p>0 then
		response.write	"<a href="&request.ServerVariables("script_name")&"?action="&request("action")&"&city="&request("city")&"&sex="&request("sex")&"&currentpage=10&p="&p-1&mycondition&"><img src=user/prepre.gif alt=前十页 border=0></a>&nbsp;&nbsp;&nbsp;"
    else
	response.write	"<img src=user/prepre.gif alt=前十页 border=0>&nbsp;&nbsp;&nbsp;"
    end if
	'-------------------下面写出当前十个页码
	response.write "</td><td><img src=user/lined.gif border=0><img src=user/k.gif border=0 width=5>"
	for i=1 to 10
		if (p*10+i)>pages then exit for
		if currentpage=i then
		
			response.write "<b><a style='color:ff6600'"
		else
			response.write "<a"
		end if 
		dates=request("dates")
		response.write " href="&request.ServerVariables("script_name")&"?action="&request("action")&"&city="&request("city")&"&sex="&request("sex")&"&currentpage="&i&"&p="&p&mycondition&"><font class=no >"&(p*10+i)&"</font></a></b>&nbsp;&nbsp;<img src=user/lined.gif border=0><img src=user/k.gif width=5 border=0>"	
     next
	 response.write "</td><td><table width='100%' border=0 cellspacing=0 cellpadding=0><tr><td height=3></td></tr></table>"
	 '--------------------察看下十页的连接
    if (p*10+10)<pages then
		response.write "<img src=user/k.gif border=0><a href="&request.ServerVariables("script_name")&"?action="&request("action")&"&city="&request("city")&"&sex="&request("sex")&"&currentpage=1&p="&p+1&mycondition&"><img src=user/nextnext.gif alt=后十页 border=0></a>" 
		else
		response.write "<img src=user/k.gif border=0><img src=user/nextnext.gif alt=后十页 border=0>"
	end if
	'-----------------------------------------------上下页导航
	response.write "</td>"
	

	  response.write "</tr></table>"
end sub

sub myPages(myRS,mysize)  '------mysize为内部变量（主页面没有定义），myRS为主页面传递过来的RS对象（地址传递）
	if myRS.eof and myRS.bof then str="没有纪录"
	if str="" then
		if mysize="" or NOT IsNumeric(mysize) then
			mysize=15
		end if
		myRS.PageSize=mysize
		pages=myRS.pagecount
		records=myRS.recordcount
		On Error Resume Next '取得数字
		currentPage=request("currentPage")
		if currentPage="" then
			currentPage=1
		end if
		currentPage=CInt(currentPage)
		if Err.Number <> 0 Then
			currentPage=1
			Err.Clear
		end if
		if currentPage<1 then
			currentPage=1
		elseIf currentPage>10 then
			currentPage=10
		end if
		'----------------处理p
		p=request("p")
		if p="" then
			p=0
		end if
		p=CLng(p)
		if Err.Number <> 0 Then
			p=0
			Err.Clear
		end if
		if p<0 then
			p=0
		end if
		'--判断是否出了页数范围
		nowPage=p*10+currentPage
		if nowPage>pages then
			p=(pages-1)\10
			currentPage=((pages-1) mod 10)+1
		end if
		myRS.absolutepage=p*10+currentPage
	else
	   currentPage=1
	   records=0
	   pages=1
	end if
end sub

dim pages,records,currentPage,p '--------定义变量，这些变量在主页面中，进行地址传递%>
<!--#include file="end.asp"-->
</body>
</html>
