<!--#include file="Inc.asp"-->
<!--#include file="ydzq1.asp"-->

<%call head()
Call saycardd(""&zonene&"")



'检查有几条新留言
dim newguest
newguest = 0
IF myid > 0 THEN
  newguest = ForNewGuest(myid)
END IF
if myid<>0 then
if newguest > 0 then
Response.write "<img src='/bbs/xi.gif' alt='.' /><a href='bbs/msgview.asp?url=" & Replace(Replace(R_url(), "sid=", "o="), "sid=", "o=") & "&amp;saytk="&saytk&"&amp;sid="&sid&"'>您有" & newguest & "条新消息</a><br/>" & Chr(13)
end if
response.write"欢迎您：<a href='show.asp?saytk="&saytk&"&amp;sid="&sid&"'>"&myni&"</a><br/>"&chr(13)
else
Response.write "欢迎您:<a href='login.asp?url=/bbs/index.asp'>登陆/注册</a><br/>"& chr(13)
end if
dim zonejb,newzonenum,zoneyuejb
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select zonejb,zonenum,zoneyuejb from twapp where id=1",conn,1,1
if rs.eof then
  Call Error("系统没有配置！")
  end if
zonejb=rs("zonejb")
zoneyuejb=rs("zoneyuejb")
newzonenum=rs("zonenum")
rs.close
set rs=nothing
   response.write"<a href=""zoneadd.asp?saytk="&saytk&"&amp;sid="&sid&""">创建"&zonene&"</a><br/>"&chr(13)
    
   'response.write"<a href=""searchbbs.asp?Act=zone&amp;saytk="&saytk&"&amp;sid="&sid&""">搜索创建家族</a><br/>"&chr(13)
   'response.write "-----------<br/>"
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from ydbbs where prentID=0 and city=2  order by zonejb desc",conn,1,1
If Not rs.eof	Then
	Dim PageSize,i
	PageSize=8			
	Dim Count,page,pagecount,gopage			
	gopage="zone.asp?saytk="&saytk&"&amp;sid="&sid&"&amp;"
	Count=rs.recordcount	
	page=int(request.QueryString ("page"))
	if page<=0 or page="" then page=1		
	pagecount=(count+pagesize-1)\pagesize
        if page>pagecount then page=pagecount
	rs.move(pagesize*(page-1))					
	For i=1 To PageSize     						
	If rs.eof Then Exit For	
    response.write i+(page-1)*PageSize&"."
    dim username
 set rs1=Server.CreateObject("ADODB.Recordset")
rs1.open"select name from users  where id="&rs("adminusid"),conn,1,1
If rs1.eof Then
username=""
else
username=rs1("name")
end if
rs1.close
set rs1=nothing

 if rs("yc")=0 then
    
dim charDays
charDays = DateDiff("d", rs("zonedate"), now())
if charDays >1 then

if rs("zonejb")<abs(zoneyuejb) then
    conn.execute("update ydbbs  Set yc = 1 where ID = "&rs("id"))
    else
	if datesql="1" THEN
conn.execute("update ydbbs Set zonejb = zonejb-"&zoneyuejb&",zonedate=now() where ID="&rs("id"))
else
conn.execute("update ydbbs Set zonejb = zonejb-"&zoneyuejb&",zonedate=getdate() where ID="&rs("id"))
end if
end if
end if

    response.write "<a href=""board.asp?bbsid="&rs("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&""">"&rs("name")&"</a>"
  
    'response.write"<a href='uinfo.asp?id="&rs("adminusid")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&username&"</a><br/>"
    
    dim zonenum
    zonenum=conn.execute("Select count(ID) from [users] where zoneid="&rs("id"))(0)
    'response.write "成员:"
    'response.write"<a href=""zoneman.asp?id="&rs("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&""">"&zonenum&"人</a>/"&chr(13)
   
    'response.write "<br/>简介:"&left(rs("grouptxt"),30)
    if len(rs("grouptxt")) > 30 then
    'response.write "..."
    end if
'response.write "<br/>金库:<a href=""zonetax.asp?bbsid="&rs("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&""">"&rs("zonejb")&"</a>"
    if zonenum >= newzonenum then
    conn.execute("update ydbbs  Set yc = 0 where ID = "&rs("id"))
    end if
    
   
     else
'response.write "<a href=""board.asp?bbsid="&rs("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&"""> "&rs("name")&"</a> "
    'response.write "<br/>状态:关闭!"
    end if
    response.write"|<a href=""zonefav.asp?action=in&amp;id="&rs("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&""">加入</a><br/>"&chr(13)
    'response.write"<a href=""zonefav.asp?action=out&amp;id="&rs("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&""">退出</a><br/>"



	rs.moveNext
 	Next
	if page-pagecount<0 then response.write "<a href="""&gopage&"page="&page+1&""">下页</a>"
	if page>1 then response.write "<a href="""&gopage&"page="&page-1&""">上页</a>"
	if pagecount>1 then response.write "<br/>"&page&"/"&pagecount&"页,共"&Count&"条<br/><input name=""page"" format=""*N"" value="""&page&""" type=""text"" maxlength=""5"" emptyok=""true"" size=""3""/><a href="""&gopage&"page=$(page)"">跳到该页</a><br/>"
Else
Response.write "暂时没有"&zonene&"！<br/>"
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write"----------<br/>"
Response.write "<a href=""show.asp?saytk="&saytk&"&amp;sid="&sid&""">空间</a>>>"
Response.write "<a href=""index.asp?saytk="&saytk&"&amp;sid="&sid&""">社区</a>>>"
Response.write "<a href=""../index.asp?saytk="&saytk&"&amp;sid="&sid&""">首页</a><br/>"&Request.ServerVariables("SERVER_NAME")&"["&String(2-Len(hour(now)),"0") & hour(now) &":"&String(2-len(minute(now)),"0") & minute(now)&"]"

%>
<%
call headsay()
%>