<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="inc/conn.asa"-->
<!--#include file="inc/zzjyz.asp"-->
<%

PageShowSize = 10            '每页显示多少个页
MyPageSize   = 40        '每页显示多少条
	
If Not IsNumeric(Request("Curpage")) Or IsEmpty(Request("Curpage")) Or Request("Curpage") <=0 Then
MyPage=1
BoardListStr=BoardList(BoardID)
Else
MyPage=Int(Abs(Request("Curpage")))
End if
%>
<%
comurl=Cstr(Request.ServerVariables("HTTP_REFERER"))
If IsAdmin<>9 Then 
response.write backmsg("您不是管理员或者尚未登录","user.asp")
End If 
Page_WebTitle="管理中心-"&TieBa_Name
now_where="管理中心"
currWZ=now_where
navright="免费版仅供学习、参考、交流、研究使用，有部分功能限制，欢迎索取完整版！<a href='http://wpa.qq.com/msgrd?V=1&Uin=970243787&Site=&Menu=yes' target='_blank'><img src=http://wpa.qq.com/pa?p=1:970243787:17 height=17 border=0 align=middle></a>　<a href='http://wpa.qq.com/msgrd?V=1&Uin=1245823535&Site=&Menu=yes' target='_blank'><img src=http://wpa.qq.com/pa?p=1:1245823535:17 width=25 height=17 border=0 align=middle></a> "

'启用模板类
set getTemplate = new Cls_Template
shtml=getTemplate("ddp_head")
'页面全局变量、普通变量替换
shtml=replace(shtml,"$Page_WebTitle$",Page_WebTitle)
shtml=replace(shtml,"$Page_Author$",Page_Author)
shtml=replace(shtml,"$Page_Keywords$",Page_Keywords)
shtml=replace(shtml,"$Page_Description$",Page_Description)
shtml=replace(shtml,"$BoardListStr$",BoardListStr)
shtml=replace(shtml,"$now_where$",now_where)
shtml=replace(shtml,"$NavRight$",NavRight)
response.write shtml
	response.write ("<br>")
Dim Action
Dim i
Dim flg
    Action=Checkstr(Request.QueryString("Action"))
	Select Case Action
        Case "boardedit"
            Call BoardLists()
        Case "boardsave"
		    Call BoardSave()
		Case "boardlists"
		    Call boardlists()
		Case "boardup"
		    Call boardup()
		Case "boarddown"
		    Call boarddown()
		Case "boarddel"
		    Call boarddel()
		Case "stopip"
		    Call stopip()
		Case "userList"
		    Call UserList()
		Case "dustBin"
		    Call dustBin()
		Case "ReList"
		    Call ReList()
		Case "friendlink"
		    Call friendlink()
		Case "sitemanage"
			Call sitemanage()
		Case "dbak"
			Call dbak()
		Case "attach"
			Call attach()
		Case "ddpPlus"
			Call ddpPlus()

		Case "RepairBBS"
			Call RepairBBS()
		Case Else 
			Call sitemanage()
    End Select
	response.write ("<br><br>")

shtml=getTemplate("ddp_foot")
shtml=replace(shtml,"$SQLQueryNums$",SQLQueryNums)
shtml=replace(shtml,"$runTime$",runTime)
response.write shtml



'-----------------------定义用户修改分类列表界面
Sub BoardLists()
%>
<table width="774" border="0" cellspacing="1" cellpadding="3" align="center" class="zd_table">
<tr class="zd_td">
    <td width="26" height="18">ID</td>
    <td width="172" height="18">名称(点击进入修改)</td>
    <td width="300" height="18">简介</td>
    <td width="100" height="18">分版主</td>
	<td width="32" height="18">排序</td>
    <td width="84" height="18">操作</td>
</tr>
<%set rs2=server.CreateObject("adodb.recordset")
sql2="select * from "&BoardTable&" where board_father=0 order by board_order desc,board_id desc"
rs2.open sql2,conn,1,1
do while not rs2.eof
%>
  <tr class="zd_td">
    <td height="18"><%=rs2("board_id")%></td>
    <td><a href="admin.asp?Action=boardedit&boardid=<%=rs2("board_id")%>"><%=rs2("board_name")%></a></td>
    <td><%=Titleleft(trim(rs2("board_about")),40)%></td>
	<td><%=trim(rs2("board_admin"))%></td>
	<td><a href="admin.asp?Action=boardup&Board_order=<%=rs2("Board_order")%>">↑</a> <a href="admin.asp?Action=boarddown&Board_order=<%=rs2("Board_order")%>">↓</a></td>
    <td><a href="admin.asp?Action=boarddel&boardid=<%=rs2("board_id")%>">删除</a></td>
  </tr>
<%set rs=server.CreateObject("adodb.recordset")
sql="select * from "&BoardTable&" where board_father="&rs2("board_id")&" order by board_order desc,board_id desc"
rs.open sql,conn,1,1
do while not rs.eof
%>
  <tr class="zd_td">
    <td height="18" >-></td>
    <td>&nbsp;&nbsp; <a href="admin.asp?Action=boardedit&boardid=<%=rs("board_id")%>"><%=rs("board_name")%></a></td>
    <td><%=Titleleft(trim(rs("board_about")),40)%></td>
	<td><%=trim(rs("board_admin"))%></td>
	<td><a href="admin.asp?Action=boardup&Board_order=<%=rs("Board_order")%>">↑</a> <a href="admin.asp?Action=boarddown&Board_order=<%=rs("Board_order")%>">↓</a></td>
    <td><a href="admin.asp?Action=boarddel&boardid=<%=rs("board_id")%>">删除</a></td>
  </tr>
  <%rs.movenext
	Loop
	rs.close
set rs=Nothing
%>
  <%rs2.movenext
	Loop
	rs2.close
set rs2=Nothing
%>
</table>
<!-- 下面是对分类进行修改或者添加的功能 --><BR>
<%
boardid=checkNum(Request.QueryString("boardid"))
If boardid<>0 Then 
	set rs=server.CreateObject("adodb.recordset")
	sql="select * from "&BoardTable&" where board_id="&boardid
		rs.open sql,conn,1,3
			board_name=rs("board_name")
			board_about=rs("board_about")
			board_admin=rs("board_admin")
			board_photo=rs("board_photo")
			board_father=rs("board_father")
			board_qxs=rs("board_qxs")
		rs.close
	set rs=Nothing
	setcz="修改分类信息"
	board_act="修改提交"
Else
	setcz="添加分类信息"
	board_order="100"
	board_act="添加提交"
	board_father=0
End If 
%>
<table width="774" border="0" cellspacing="1" cellpadding="5" align="center" class="zd_table">
  <tr class="zd_td">
    <td height="5"  align="center"><B><%=setcz%></B></td>
  </tr>
  <form name="form12" method="post" action="admin.asp?Action=boardsave">
  <tr class="zd_td">
      <td>
	  分类名称：<input type="text" name="board_name" size="21" maxlength="30" value="<%=board_name%>"> 所属分类：<select name='board_father'>
	  <%
	  	response.write "<option value=""0"">根分类</option>"
	If Not IsArray(Arr_Category) Then GetBoardCache()
	If IsArray(Arr_Category) Then
		For i=0 To Ubound(Arr_Category,2)
			If Int(Arr_Category(5,i))=0 Then
				If Int(Arr_Category(1,i))=Int(board_father) Then
					nn=" selected"
				Else
					nn=""
				End If
			response.write "<option value="""&Arr_Category(1,i)&""""&nn&">"&Arr_Category(0,i)&"</option>"
			End If 
		Next
	End If 
	  %>
    </select>
	  发布权限：
	  <select name="board_qxs">
	    <option value="0" <%if board_qxs="0" then response.Write "selected=""selected""" %>>所有会员</option>
	    <option value="9" <%if board_qxs="9" then response.Write "selected=""selected""" %>>管理员</option>
	    <option value="1" <%if board_qxs="1" then response.Write "selected=""selected""" %>>版主</option>
	    </select>
	  </td>
	</tr>
  <tr class="zd_td">
      <td>
	  分类广告：<textarea rows="5" name="board_photo" cols="70" class="an"><%=board_photo%></textarea>*120字以内（支持Html）</td>
	</tr>
  <tr class="zd_td">
      <td>
	  版主：<input type="text" name="board_admin" size="30" maxlength="100" value="<%=board_admin%>"> 多位版主请用|分割，最后一位后面不要输入|。←<a href="javascript:" onClick="document.form12.board_admin.value+='|'">点此插入|符号</a>*版主继承到子分类</td>
	</tr>
  <tr class="zd_td">
      <td>
      分类说明：<textarea rows="5" name="Board_about" cols="70" class="an"><%=board_about%></textarea>*120字以内（支持Html）
      <input type="hidden" name="board_id" value="<%=boardid%>">
	  </td>
    </tr>
  <tr class="zd_td">
      <td align=center>
      <input type="submit" name="Submit3" value="<%=board_act%>" class="an">
	  </td>
    </tr>
  </form>
</table>
<%End Sub
'-----------------------定义修改分类提交
Sub BoardSave()
Board_id=Request.Form("Board_id")
Board_name=Replace(CStr(Request.Form("Board_name")),"|","") '分类中禁止使用"|"
Board_name=Replace(Board_name,"!","") '分类中禁止使用"!"
Board_About=Request.Form("Board_about")
board_admin=Request.Form("board_admin")
board_photo=Request.Form("board_photo")
board_qxs=Request.Form("board_qxs")
board_father=checkNum(Request.Form("board_father"))


If Board_id="0" Then Board_id=""
If Board_name="" Or Len(Board_name)>100 Then response.write backmsg("分类名称太短或者太长","")
If Board_About="" Or Len(Board_About)>1000 Then response.write backmsg("分类说明太短或者太长","")
If board_father="" Then response.write backmsg("父分类参数错误","")

Set rs = Server.CreateObject("ADODB.Recordset")
'判断是修改还是添加
If Board_id="" Then'如果是添加
		'这里首先要读取最大排序数字，为的是给新添加的排序字段有数据输入。
		Set Rs77=Conn.Execute("SELECT Max(board_order) FROM "& BoardTable &"")
			If Rs77.EOF Or Rs77.BOF Then 
				board_order=1
			Else
				board_order=Rs77(0)+1
			End If
		If IsNull(board_order) Then board_order=1
		'读取排序号结束。
acts="添加"
sql = "SELECT * FROM "&BoardTable&" where (Board_id is null)" 
rs.OPEN sql,Conn,1,3
rs.addnew
rs("board_order")=board_order
Else
acts="修改"
sql = "SELECT * FROM "&BoardTable&" where Board_id="&Board_id 
rs.OPEN sql,Conn,1,3
End If 
rs("Board_name")=Board_name
rs("Board_About")=Board_About
rs("board_photo")=board_photo
rs("board_admin")=board_admin
rs("board_father")=board_father
rs("board_qxs")=board_qxs
rs.update
rs.close
set rs=Nothing
Application(webname&"CacheTime")="2010-3-1 12:12:12"
response.write backmsg("恭喜，分类"&acts&"成功！","admin.asp?Action=boardlists")
End Sub
'-----------------------定义分类删除功能
Sub boarddel()
boardid=checkNum(Request.QueryString("boardid"))
getnum=conn.execute("select count(board_id) from "&BoardTable&" where Board_father="&Boardid&"")
If IsNull(getnum(0)) Or getnum(0)=0 Then
	getallnum=conn.execute("select count(board_id) from "&BoardTable&" where Board_father=0")
	If getallnum(0)=1 Then 
		response.write backmsg("该分类是唯一的分类了不能删除，建议修改分类名称参数使用。","")
	Else
		conn.execute "delete from "&BoardTable&" where Board_id="&Boardid
	End If 
Else
	response.write backmsg("该分类还有子分类"&getnum(0)&"，不能删除","")
End If
Application(webname&"CacheTime")="2010-3-1 12:12:12"
response.write backmsg("恭喜，分类删除成功！","admin.asp?Action=boardlists")
End Sub 

'-----------------------菜单排序的上升功能
Sub boardup()
Board_order=checkStr(Request.QueryString("Board_order"))
	Dim OldOrders,NewOrders
	Set Rs=Server.CreateObject("ADODB.RecordSet")
	Sql="SELECT TOP 2 Board_order from "&BoardTable&" WHERE Board_order>="&Board_order&" ORDER BY Board_order"
	Rs.Open SQL,Conn,1,3
	If Not (Rs.EOF Or Rs.BOF) Then
		OldOrders=rs("Board_order")
		Rs.MoveNext
		If Not (Rs.EOF Or  Rs.BOF) Then
			NewOrders=Rs("Board_order")
			Rs("Board_order")=OldOrders
			Rs.Update
			Rs.MovePrevious
			Rs("Board_order")=NewOrders
			Rs.Update
		End If
	End If
	Rs.Close
	Set Rs=Nothing
	Application(webname&"CacheTime")="2010-3-1 12:12:12"
	Response.Redirect "admin.asp?Action=boardlists"
End Sub 
'-----------------------菜单排序的降序功能
Sub boarddown()
Board_order=checkStr(Request.QueryString("Board_order"))
	Dim OldOrders,NewOrders
	Set Rs=Server.CreateObject("ADODB.RecordSet")
	Sql="SELECT TOP 2 Board_order from "&BoardTable&" WHERE Board_order<="&Board_order&" ORDER BY Board_order desc"
	Rs.Open SQL,Conn,1,3
	If Not (Rs.EOF Or Rs.BOF) Then
		OldOrders=rs("Board_order")
		Rs.MoveNext
		If Not (Rs.EOF Or  Rs.BOF) Then
			NewOrders=Rs("Board_order")
			Rs("Board_order")=OldOrders
			Rs.Update
			Rs.MovePrevious
			Rs("Board_order")=NewOrders
			Rs.Update
		End If
	End If
	Rs.Close
	Set Rs=Nothing
	Application(webname&"CacheTime")="2010-3-1 12:12:12"
	Response.Redirect "admin.asp?Action=boardlists"
End Sub 

'IP管理
sub stopip()
dim ipid,ipcls
ipid=CheckNum(Request.QueryString("id"))
ipcls=Checkstr(trim(Request.QueryString("cls")))

Select case ipcls
case ""

case "delip"
	conn.execute("Delete  From stopip Where id="&ipid)
case "ipadmin0"
    conn.execute("Update stopip set viw=0 Where id="&ipid)
case "ipadmin1"
    conn.execute("Update stopip set viw=1 Where id="&ipid)
case "ipadmin2"
     conn.execute("Update stopip set viw=2 Where id="&ipid)
case "saveip"		'--------Edit by zidone 2006 1214 For Ver 1.1 Dev

	Dim flg,i
	flg = 0
	
	For i = 1 To 4
		If Not IsNumeric(Request.Form("oneip" & i)) Then
			If Trim(Request.Form("oneip" & i)) <> "*" Then 
				flg = 1
				Exit For 
			End If
		End If 
	Next
	If flg = 1 Then
		Response.Write "<script language=JavaScript>{alert('起始IP地址应该全部输入数字或者通配符 *');history.back();}</script>"
		Response.End 
	End If 

	
		dim oneip,endip
		oneip=trim(Request.Form("oneip1")) &"."& trim(Request.Form("oneip2")) &"."& trim(Request.Form("oneip3")) &"."& trim(Request.Form("oneip4")) 
		endip=trim(Request.Form("endip1")) &"."& trim(Request.Form("endip2")) &"."& trim(Request.Form("endip3")) &"."& trim(Request.Form("endip4"))
		If InStr(oneip,"*")<=0 Then
			If InStr(endip,"*")>0 Then
				Response.Write "<script language=JavaScript>{alert('通配符 * 请写在起始地址段的最后一位');history.back();}</script>"
				Response.End 
			End If 
			If endip = "..." Then endip=oneip
			If InStr(endip,"...")>0 Then
				endip = Split(endip,".")(0)&"." & Split(oneip,".")(1)&"." & Split(oneip,".")(2)&"." & Split(oneip,".")(3)
			ElseIf InStr(endip,"..")>0 Then
				endip = Split(endip,".")(0)&"." & Split(endip,".")(1)&"." & Split(oneip,".")(2)&"." & Split(oneip,".")(3)
			ElseIf Right(endip,1) ="." Then 
				endip = Split(endip,".")(0)&"." & Split(oneip,".")(1)&"." & Split(endip,".")(2)&"." & Split(oneip,".")(3)
			End If 
		Else
			endip = "0.0.0.0"

		End If 

		'Valid Check by zidone
		Dim valid
		valid = 0
		If InStr(oneip,"*")<1 And InStr(endip,"*")<1 And endip<>"0.0.0.0" Then
			If Split(oneip,".")(0)>Split(endip,".")(0) Then
				valid=1
			Else
				If Split(oneip,".")(1)>Split(endip,".")(1) Then
					valid = 1
				Else
					If Split(oneip,".")(2)>Split(endip,".")(2) Then
						valid = 1
					Else
						If Split(oneip,".")(3)>Split(endip,".")(3) Then
							valid = 1
						End If 
					End If 
				End if
			End if
		End If 
		
		If valid = 1 Then
			Response.Write "<script language=JavaScript>{alert('起始IP地址应该小于结束IP地址');history.back();}</script>"
			Response.End 
		End If 
		Set rs = Server.CreateObject("ADODB.RecordSet")
		sql="Select * from stopip"
		Rs.open sql,conn,2,3
		Rs.addnew
			  If InStr(oneip,"*")<=0 Then rs("oneip")=cip(oneip)
			  If InStr(endip,"*")<=0 And endip<>"0.0.0.0" Then rs("endip")=cip(endip)
			  rs("ip1")=oneip
			  rs("ip2")=endip
			  rs("rdate")=now()
			  rs("viw")=1
		rs.update
		rs.close
		response.Redirect "admin.asp?Action=stopip"
end Select

Response.Write("<form name='form1' method='post' action='admin.asp?Action=stopip&cls=saveip'><TABLE width=""774"" border=""0"" cellspacing=""1"" cellpadding=""5"" align=""center"" class=""zd_table""><tr class=""zd_td"">  <td colspan='4'><div align='center'>IP管理</div></td></tr><tr class=""zd_td""><td width='19%'><div align='right'>禁用IP段:</div></td><td width='30%'>起始: <input name='oneip1' type='text' maxlength='3'  onKeyPress='return checkNum(event);' id='oneip1' size=4><B>.</B><input name='oneip2' type='text' maxlength='3'  id='oneip2' size=4 onKeyPress='return checkNum(event);'><B>.</B><input name='oneip3' type='text' maxlength='3'  id='oneip3' size=4 onKeyPress='return checkNum(event);'><B>.</B><input name='oneip4' type='text' maxlength='3'  id='oneip4' size=4 onKeyPress='return checkIP(event,this);'></td><td>结束: <input name='endip1' type='text' maxlength='3'  id='endip1' size=4 onKeyPress='return checkNum(event);'><B>.</B><input name='endip2' type='text' maxlength='3'  id='endip2' size=4 onKeyPress='return checkNum(event);'><B>.</B><input name='endip3' type='text' maxlength='3'  id='endip3' size=4 onKeyPress='return checkNum(event);'><B>.</B><input name='endip4' type='text' maxlength='3'  id='endip4' size=4 onKeyPress='return checkIP(event,this);'></td><td><input type='submit' name='Submit' value='添加'></td></tr><tr class=""zd_td""><td><div align='right'>说明:</div></td><input name='action_e' type='hidden' value='stopip'><td colspan='3'><font color=red>起始IP段不能低于终止IP段.<br>起始IP最后一节允许使用通配符 * ,若使用则按照起始IP作为屏蔽依据,结束IP将被忽略(如:192.168.1.*).</font></td></tr></table><br><br></form>")

 set rs=conn.execute("select * from stopip")
Response.Write("<TABLE width=""774"" class=""zd_table"" border=""0"" cellspacing=""1"" cellpadding=""5"" align=""center"" bgcolor=""#b1c9e4""><TBODY>")
Response.Write("<tr class=zd_td><td>状态</td> <td>起始</td><td>终止</td><td>时间</td><td>操作</td></tr>")
do while not rs.eof 
	If InStr(CStr(rs("ip1")),"*")>0 Then
		ip2 = "-.-.-.-"
	Else
		ip2 = rs("ip2")
	End If 
Response.Write("<tr class=zd_td><td>")
             
			  if rs("viw")=1 then
			  Response.write("<font color='#FF9900'>")
			  end if
			  if rs("viw")=0 then
			  Response.write("<font color='#009900'>")
			  end if
			   if rs("viw")=2 then
			  Response.write("<font color='#FF0000'>")
			  end if
              Response.write("●</font>")
			 
Response.Write("</td><td>"&rs("ip1")&"</td> <td>"& ip2 &"</td> <td>"&rs("rdate")&"</td> <td><a href=""admin.asp?Action=stopip&cls=delip&id="&rs("id")&""" >删除</a> <a href=""admin.asp?Action=stopip&cls=ipadmin0&id="&rs("id")&""">开通</a>  <a href=""admin.asp?Action=stopip&cls=ipadmin1&id="&rs("id")&""">禁注</a> <a href=""admin.asp?Action=stopip&cls=ipadmin2&id="&rs("id")&""">禁览</a>  </td> </tr>")
          
		rs.movenext
    	loop
		rs.close
		set rs=nothing

Response.Write("<tr class=zd_td ><td colspan='5'><div align='center'><font color='#009900'>●开通 </font><font color='#FF9900'>●禁止注册</font> <font color='#FF0000'> ●禁止浏览</font><br />全段IP: 0.0.0.0 - 127.255.255.255 , 128.0.0.0 - 255.255.255.255</div></TD></TR></TBODY></TABLE><br><br>")
end sub
'-----------------------定义修改用户列表界面
Sub UserList()
dim ipid,ipcls
uid=CheckNum(Request.QueryString("uid"))
cz=Checkstr(trim(Request.QueryString("cz")))
tiaojian=Checkstr(Trim(Request.Form("tj")))

Select case cz
case "del"
	If uid="" Then response.write backmsg("参数错误！","")
	conn.execute("Delete From "&UserTable&" Where id="&uid)
	response.write backmsg("恭喜，删除成功！！",comurl)
case "lock"
	If uid="" Then response.write backmsg("参数错误！","")
	Set Rs=Server.CreateObject("ADODB.RecordSet")
    SQL="SELECT * FROM "& UserTable &" WHERE id="&uid
    Rs.Open SQL,Conn,1,3
	isLocked=Rs("isLocked")
	If isLocked=1 Then 
		Rs("isLocked")=0
	End If 
    Rs.Update
    Rs.Close
    Set Rs=Nothing
	Response.redirect(comurl)
case "bjsave"
	Dim UserName,PassWord0,PassWord,PassWord1
	UserName=Trim(Request.Form("username"))
	PassWord0=Trim(Request.Form("pwd0"))
	umoney=Int(Request.Form("umoney"))
	user_sex=Int(Request.Form("user_sex"))
	user_from=Trim(Request.Form("user_from"))
	user_mail=Trim(Request.Form("user_mail"))
	user_qq=Trim(Request.Form("user_qq"))
	user_show=Trim(Request.Form("user_show"))
	user_hompage=Trim(Request.Form("user_hompage"))

	lockedTime=Trim(Request.Form("lockedTime"))
	isLocked=int(Request.Form("isLocked"))
	lockedReason=Trim(Request.Form("lockedReason"))
	unLockDay=Trim(Request.Form("unLockDay"))

	uid=Trim(Request.Form("uid"))
	If uid="" Then response.write backmsg("参数错误！","")
	Set Rs=Server.CreateObject("ADODB.RecordSet")
    SQL="SELECT * FROM "& UserTable &" WHERE id="&uid
    Rs.Open SQL,Conn,1,3
	If password0<>"" Then
		Rs("PWD")=MD5(PassWord0)
	End If 
	Rs("user_sex")=user_sex
	Rs("user_from")=user_from
	Rs("user_mail")=user_mail
	Rs("user_qq")=user_qq
	Rs("user_show")=user_show
	Rs("user_homepage")=user_hompage
	Rs("umoney")=umoney
	Rs("isLocked")=isLocked
	If isLocked>0 Then Rs("cookrnd")=""
	Rs("lockedTime")=lockedTime
	Rs("lockedinfo")=lockedReason&"|"&Dreamsun_name&"|"&unLockDay
    Rs.Update
    Rs.Close
    Set Rs=Nothing
	Response.Write backmsg("恭喜您，"&shuoming&"修改成功!",comurl)
case "bj"
	Set Rs_user=Server.CreateObject("ADODB.RecordSet")
    SQL_user="SELECT * FROM "& UserTable &" WHERE id="&uid
    Rs_user.Open SQL_user,Conn,1,3
	user_name=Rs_user("username")
	user_sex=Rs_user("user_sex")
	user_from=Rs_user("user_from")
	user_mail=Rs_user("user_mail")
	user_qq=Rs_user("user_qq")
	user_show=Rs_user("user_show")
	user_hompage=Rs_user("user_homepage")
	umoney=Rs_user("umoney")
	logintimes=Rs_user("logintimes")
	islocked=Rs_user("islocked")
	lockedInfo=Rs_user("lockedInfo")
	lockedTime=Rs_user("lockedTime")
	unlockedTime=dateadd("d",30,lockedTime)
	If InStr(lockedInfo,"|")>0 Then 
		lockedReason=Split(lockedInfo,"|")(0)
		lockedAdmin=Split(lockedInfo,"|")(1)
		unLockDay=Split(lockedInfo,"|")(2)
		If unLockDay="" Or IsNull(unLockDay) Then unLockDay=30
	End If
	Rs_user.Close
    Set Rs_user=Nothing
%>
<%set rs2=server.CreateObject("adodb.recordset")
sql2="select * from " & UserTable &" "& ptiaojian
if Request.QueryString("order")<>"" then
	sql2=sql2 & " order by " & CheckStr(Request.QueryString("order")) & " desc"
else
	sql2=sql2 & " order by [id] desc"
end if
rs2.open sql2,conn,1,1
If rs2.eof and rs2.bof Then
response.write "<tr bgcolor=""#FFFFFF"">"
response.write "<td height=""80"" align=""center"" colspan=""6""><center>暂无用户</center></td>"
response.write "</tr>"
else
rs2.PageSize     = MyPageSize
MaxPages         = rs2.PageCount
rs2.absolutepage = MyPage
Totalcount            = rs2.RecordCount
for i=1 to MyPageSize

If not rs2.eof Then
id=rs2("id")
If Int(rs2("islocked"))>0 Then id="<font color=red>"&id&"</font>"
%>
<%rs2.MoveNext
End If 
Next
response.write "<tr bgcolor=""#ffffff"">"
response.write "<td height=""30"" align=""center"" colspan=""7"">"& viewpage(Totalcount,MyPageSize,PageShowSize,MyPage,"Action=userList&order="&CheckStr(Request.QueryString("order")),"当前总数:","admin.asp")&"</td>"
response.write "</tr>"
End If 
response.write "</table>"
	rs2.close
	set rs2=Nothing
End Select 
End Sub
'回收站
Sub dustBin()
MyPageSize=100
sql7 = "SELECT * FROM "&bbsTable&" where [ischeck]=-1 or [Boardid] is null or [Boardid]=0 or ([boardid] not in (select board_id from "&boardtable&" ))  ORDER BY [addtime] DESC"
Set rs7 = Server.CreateObject("ADODB.Recordset")
rs7.open sql7,conn,1,1
%>



<%

End Sub 

Sub ModifyName
%>
	




<%
End Sub 
Sub sitemanage()
cls=Checkstr(Request.QueryString("cls"))
If cls="save" Then
	TieBa_Name_modify=Trim(Request.Form("TieBa_Name"))'网站名称
	TieBa_Url_modify=Trim(Request.Form("TieBa_Url"))'网站TieBa_Url
	Sys_Admin_modify=Trim(Request.Form("Sys_Admin"))'管理员。
	Sys_skins_modify=Trim(Request.Form("Sys_skins"))'风格。

	Sys_BadWords_modify=Trim(Request.Form("Sys_BadWords"))'脏话过滤[标题和内容]
	Sys_ADWords_modify=Trim(Request.Form("Sys_ADWords"))'广告过滤
	Sys_KeepName_modify =Trim(Request.Form("Sys_KeepName")) '被保留的用户名
	sys_close_modify = Request.Form("sys_close1")&Trim(Request.Form("sys_close2"))'系统是否关闭 0,开放；1，关闭； + 关闭原因
	TieBa_AD_Top_modify = Trim(Request.Form("TieBa_AD_Top"))'顶部广告
	TieBa_AD_Tie_modify = " "&Trim(Request.Form("TieBa_AD_Tie1")) & "|@|" & Trim(Request.Form("TieBa_AD_Tie2")) & "|@|"& Trim(Request.Form("TieBa_AD_Tie3"))

	TieBa_AD_A_modify =  Trim(Request.Form("TieBa_AD_A"))'广告A
	TieBa_AD_B_modify = Trim(Request.Form("TieBa_AD_B")) '广告B

	Sys_Default_Money_modify=CInt(Request.Form("Sys_Default_Money"))'注册初始论坛分数
	Sys_Add_Money_modify=CInt(Request.Form("Sys_Add_Money"))'发布文章分数
	Sys_Re_Money_modify=CInt(Request.Form("Sys_Re_Money"))'回复文章分数
	Sys_Del_Money_modify=CInt(Request.Form("Sys_Del_Money"))'删除文章分数
	Sys_Good_Money_modify=CInt(Request.Form("Sys_Good_Money"))'文章被推荐分数

	Sys_List_Num_modify=CInt(Request.Form("Sys_List_Num"))'首页每页显示条数
	Sys_Show_Num_modify=CInt(Request.Form("Sys_Show_Num"))'帖子每页显示条数
	Sys_PostTime_modify=CInt(Request.Form("Sys_PostTime"))'发帖防止灌水时间，单位：秒
	Sys_Guest_Add_modify=CInt(Request.Form("Sys_Guest_Add")) '游客是否可以发帖
	Sys_Guest_Re_modify=CInt(Request.Form("Sys_Guest_Re")) '游客是否可以回复


	Sys_uploadMoney_modify=CInt(Request.Form("Sys_uploadMoney"))'多少分才可以上传图片
	Sys_ModMoney_modify=CInt(Request.Form("Sys_ModMoney"))'多少分才可以自定义头像？建议大于上传图片分数
	Sys_DyTime_modify=CInt(Request.Form("Sys_DyTime"))'侧边栏调用多少天之内的各种帖子？
	Sys_RegTime_modify=CInt(Request.Form("Sys_RegTime")) '多少分钟后才可以同一个电脑注册？
	Sys_EditTime_modify=CInt(Request.Form("Sys_EditTime")) '多长时间以后修改帖子将自动增加 被xx修改过（仅限管理员和普通作者）

	Sys_MaxOnline_modify=CInt(Request.Form("Sys_MaxOnline"))'最大显示的在线人数
	Sys_UserCheck_modify=CInt(Request.Form("Sys_UserCheck"))'新注册用户是否需要审核----0需要审核1自动审核
	Sys_IsCheck_modify=CInt(Request.Form("Sys_IsCheck"))'会员发帖子是否需要审核------0需要审核1自动审核
	Sys_GuestIsCheck_modify=CInt(Request.Form("Sys_GuestIsCheck"))'游客发帖是否需要审核---0审核，1，自动审核
	Sys_isuserinfo_modify=CInt(Request.Form("Sys_isuserinfo"))'必须登陆才能察看用户信息．1是任何人可以看，0为登陆察看。
	Sys_isShowIpName_modify=CInt(Request.Form("Sys_isShowIpName"))'0:不显示IP的详细位置 1:按纯真数据库进行显示(来自于外部数据)


	Sys_HitsSession_modify=CInt(Request.Form("HitsSession"))'点击率阈值 22
	Sys_isReView_modify=CInt(Request.Form("Sys_isReView"))'是否回复可见 23
	Sys_loginTime_modify=CInt(Request.Form("Sys_loginTime"))'多少分钟重复登录不计算次数 24
	Sys_loginMoney_modify=CInt(Request.Form("Sys_loginMoney"))'登录送积分 25


Sys_Config_modify=Sys_Default_Money_modify &"|"& Sys_Add_Money_modify &"|"& Sys_Re_Money_modify &"|"& Sys_Del_Money_modify &"|"&Sys_Good_Money_modify&"|"&_
Sys_List_Num_modify &"|"& Sys_Show_Num_modify &"|"& Sys_PostTime_modify &"|"& Sys_Guest_Add_modify &"|"& Sys_Guest_Re_modify&"|"&_
Sys_uploadMoney_modify &"|"& Sys_ModMoney_modify &"|"& Sys_DyTime_modify &"|"& Sys_RegTime_modify &"|"& Sys_EditTime_modify &"|"&_
Sys_MaxOnline_modify &"|"& Sys_UserCheck_modify &"|"& Sys_IsCheck_modify &"|"& Sys_GuestIsCheck_modify &"|"& Sys_isuserinfo_modify &"|"&_
Sys_isShowIpName_modify&"|0|"&Sys_HitsSession_modify&"|"&Sys_isReView_modify&"|"&Sys_loginTime_modify&"|"&Sys_loginMoney_modify&"|26|27|28|29|30|31|32|33|34"

If Dreamsun_name<>"" And isadmin=9 And InStr(Sys_Admin_modify,Dreamsun_name)=0 Then 
	response.write backmsg("您目前是最高管理员,出于安全考虑,请不要试图降低自己的权限!","")
End If

Set rs99 = Server.CreateObject("ADODB.Recordset")
sql99 ="SELECT * From "&configtable&" where id=1"
	rs99.open sql99,Conn,3,3
	rs99("TieBa_Name") =TieBa_Name_modify
	rs99("TieBa_Url")=TieBa_Url_modify
	rs99("Sys_Admin") =Sys_Admin_modify
	rs99("Sys_skins")=Sys_skins_modify
	rs99("Sys_BadWords")=Sys_BadWords_modify
	rs99("Sys_ADWords")=Sys_ADWords_modify
	rs99("Sys_KeepName") =Sys_KeepName_modify
	rs99("Sys_close") =Sys_close_modify
	rs99("TieBa_AD_Top") =TieBa_AD_Top_modify
	rs99("TieBa_AD_Tie") =TieBa_AD_Tie_modify
	rs99("TieBa_AD_A") =TieBa_AD_A_modify
	rs99("TieBa_AD_B") =TieBa_AD_B_modify
	rs99("Sys_Config")=Sys_Config_modify
rs99.update
rs99.close
set rs99=Nothing
Application(webname&"CacheTime")="2010-3-1 12:12:12"
response.write backmsg("恭喜，站点参数成功！","admin.asp?Action=sitemanage")
End If 

%><!--
<div style="margin:5px;padding:3px;width:98%;border: 1px solid #CCCCCC;height:22px;">
<span style="float:left;">88广告任务网官方公告：</span><span style="float:left;width:500px;" id="announce"></span><span style="float:right;" id="dvbbsannounce2">如有技术问题，请到<A HREF="http://www.88renwu.com" target=_blank>官方论坛</A>反馈</span></div><BR><BR>-->
<form name="form13" method='post' action='admin.asp?Action=sitemanage&cls=save'>
<table width="700" border="0" cellspacing="1" cellpadding="5" align="center" class="zd_table">
<tr class="zd_td">
    <td width="100" height="18" align=center>名称</td>
    <td width="600" height="18" align=center>参数</td>
  </tr>
<tr class="zd_td" height="18">
    <td width="100" align=right>站点名称</td>
    <td width="600" align=left><input name="TieBa_Name" type="text" id="TieBa_Name" size="30" maxlength="30" value="<%=TieBa_Name%>">*网站的名称，例如：88广告任务网</td>
</tr>
<tr class="zd_td" height="18">
    <td width="100" align=right>站点地址</td>
    <td width="600" align=left><input name="TieBa_Url" type="text" id="TieBa_Url" size="30" maxlength="150" value="<%=TieBa_Url%>">*例如：http://www.88renwu.com</td>
</tr>
<tr class="zd_td" height="18">
    <td width="100" align=right>管理员</td>
    <td width="600" align=left><input name="Sys_Admin" type="text" id="Sys_Admin" size="40" maxlength="150" value="<%=Sys_Admin%>">
	请用|分割，最后面不要输入|。←<a href="javascript:" onClick="document.form13.Sys_Admin.value+='|'">点此插入|符号</a></td>
</tr>
<tr class="zd_td" height="18">
    <td width="100" align=right>风格文件夹</td>
    <td width="600" align=left>
	<select name='Sys_skins'>
    <%
	Set FSO=Server.CreateObject("Scripting.FileSystemObject")
	set objFolder=FSO.GetFolder(server.Mappath("skins/"))
	set objSubFolders=objFolder.Subfolders
	for each objSubFolder in objSubFolders
		response.write "<option value="""&objSubFolder.name&""""
		If Sys_skins=objSubFolder.name then Response.Write " selected"
		'处理xml文件
		'Set fso=Server.CreateObject("Scripting.FileSystemObject")
		' 以下修改过
		'strSourceFile = Server.MapPath("skins/"&objSubFolder.name&"\default.xml")
		strSourceFile = Server.MapPath("skins/"&objSubFolder.name&"\51e8sky1.xml")
			If fso.FileExists(strSourceFile) Then
				set xmldoc=Server.createObject("Microsoft.XMLDOM")
				xmldoc.load(strSourceFile)
				set nodes=xmldoc.selectNodes("templates")
				IsSideBar=nodes(0).selectSingleNode("ddp_skin").text
				SkinName=nodes(0).selectSingleNode("ddp_skin").text
			Else
				IsSideBar=True
				SkinName=objSubFolder.name
			End If 
		Set nodes=nothing
		Set xmldoc=nothing
		'Set fso=nothing
		'处理xml文件结束
		response.write">"&SkinName&"</option>"
	next 
	set objFolder=nothing
	set objSubFolders=nothing
	set fso=nothing
	%>
	</select>*请将符合条件的风格包放入skins文件夹
</tr>
<tr class="zd_td" height="18">
    <td width="100" align=right>积分数值</td>
    <td width="600" align=left>注册后获得<input name="Sys_Default_Money" type="text" id="Sys_Default_Money" size="5" maxlength="5" value="<%=Sys_Default_Money%>">分，发贴可获得<input name="Sys_Add_Money" type="text" id="Sys_Add_Money" size="5" maxlength="5" value="<%=Sys_Add_Money%>">分， 回帖可获得<input name="Sys_Re_Money" type="text" id="Sys_Re_Money" size="5" maxlength="5" value="<%=Sys_Re_Money%>">分 <br>
    帖子被删除后扣除<input name="Sys_Del_Money" type="text" id="Sys_Del_Money" size="5" maxlength="5" value="<%=Sys_Del_Money%>">分， 帖子被推荐为精华时加<input name="Sys_Good_Money" type="text" id="Sys_Good_Money" size="5" maxlength="5" value="<%=Sys_Good_Money%>">分，有效登录送<input name="Sys_loginMoney" type="text" id="Sys_loginMoney" size="5" maxlength="5" value="<%=Sys_loginMoney%>">积分
	
	</td>
</tr>
<tr class="zd_td" height="18">
    <td width="100" align=right>显示设置</td>
    <td width="600" align=left>
    列表页每页显示<input name="Sys_List_Num" type="text" id="Sys_List_Num" size="5" maxlength="5" value="<%=Sys_List_Num%>">条帖子，
    详细页每页显示<input name="Sys_Show_Num" type="text" id="Sys_Show_Num" size="5" maxlength="5" value="<%=Sys_Show_Num%>">条回复， 
	</td>
</tr>
<tr class="zd_td" height="18">
    <td width="100" align=right>点击次数阈值</td>
    <td width="600" align=left><input name="HitsSession" type="text" id="HitsSession" size="5" maxlength="5" value="<%=HitsSession%>">*0：可刷新，一次一个；1-N：防刷新，一次1~N随机个。比如8，就是防刷新，每次增1-8随机
	</td>
</tr>

<tr class="zd_td" height="18">
    <td width="100" align=right>时间限制</td>
    <td width="600" align=left>
    <input name="Sys_loginTime" type="text" id="Sys_loginTime" size="5" maxlength="5" value="<%=Sys_loginTime%>">分钟内重复登录不计算，发帖回帖防止刷新时间<input name="Sys_PostTime" type="text" id="Sys_PostTime" size="5" maxlength="5" value="<%=Sys_PostTime%>">秒，同一个电脑注册限制时间<input name="Sys_RegTime" type="text" id="Sys_RegTime" size="5" maxlength="5" value="<%=Sys_RegTime%>">分钟<BR>修改帖子将增加修改记录时间为<input name="Sys_EditTime" type="text" id="Sys_EditTime" size="5" maxlength="5" value="<%=Sys_EditTime%>">分钟后，侧边栏调用帖子为<input name="Sys_DyTime" type="text" id="Sys_DyTime" size="5" maxlength="5" value="<%=Sys_DyTime%>">天之内。
    </td>
</tr>
<tr class="zd_td">
<td align="right">
	系统状态
</td>
<td>
    <select name='sys_close1'>
    <option value="0" <% if Left(sys_close,1)="0" then Response.Write "selected"%>>系统正常运行</option>
    <option value="1" <% if Left(sys_close,1)="1" then Response.Write "selected"%>>系统暂停</option>
    </select>， 系统暂停原因：<input type="text" name="sys_close2" value="<%if len(sys_close)>0 then Response.Write(Right(sys_close,len(sys_close)-1))%>">。
</td>
</tr>
<tr class="zd_td">
    <td align="right">
       验证权限
    </td>
    <td>
        <select name="Sys_Guest_Add">
            <option value="0" <% If Sys_Guest_Add<>1 Then response.write "selected"%>>不允许</option>
            <Option value="1" <% If Sys_Guest_Add=1 Then response.write "selected"%>>允许</option></select>游客发帖，
        <select name="Sys_Guest_Re">
            <option value="0" <% If Sys_Guest_Re<>1 Then response.write "selected"%>>不允许</option>
            <Option value="1" <% If Sys_Guest_Re=1 Then response.write "selected"%>>允许</option></select>游客回复。<hr size="0">

       用户注册
		<select name="Sys_UserCheck">
            <option value="0" <% If Cstr(Sys_UserCheck)="0" Then response.write "selected"%>>需要审核</option>
            <option value="1" <% If Cstr(Sys_UserCheck)="1" Then response.write "selected"%>>直接通过</option>
        </select>。
        用户发帖
        <select name="Sys_IsCheck">
            <option value="0" <% If Cstr(Sys_IsCheck)="0" Then response.write "selected"%>>需要审核</option>
            <option value="1" <% If Cstr(Sys_IsCheck)="1" Then response.write "selected"%>>直接通过</option>
        </select>。
		游客发帖
		<select name="Sys_GuestIsCheck">
            <option value="0" <% If Cstr(Sys_GuestIsCheck)="0" Then response.write "selected"%>>需要审核</option>
            <option value="1" <% If Cstr(Sys_GuestIsCheck)="1" Then response.write "selected"%>>直接通过</option>
        </select>。
<hr size="0">
          <select name="Sys_isuserinfo">
            <option value="0" <% If Sys_isuserinfo<>1 Then response.write "selected"%>>登陆后可查看</option>
            <Option value="1" <% If Sys_isuserinfo=1 Then response.write "selected"%>>游客可查看</option></select>用户信息，
         <select name="Sys_isShowIpName">
            <option value="0" <% If Sys_isShowIpName<>1 Then response.write "selected"%>>不允许</option>
            <Option value="1" <% If Sys_isShowIpName=1 Then response.write "selected"%>>允许</option>
        </select>查看ip地址归属地。
<hr size="0">发帖是否允许使用【回复可见】道具
          <select name="Sys_isReView">
            <option value="0" <% If Sys_isReView<>1 Then response.write "selected"%>>不允许</option>
            <Option value="1" <% If Sys_isReView=1 Then response.write "selected"%>>允许</option></select>
    </td>
</tr>
<tr class="zd_td" height="18">
    <td width="100" align=right>上传权限</td>
    <td width="600" align=left>
<input name="Sys_uploadMoney" type="text" id="Sys_uploadMoney" size="5" maxlength="5" value="<%=Sys_uploadMoney%>">分以上可以上传图片，<input name="Sys_ModMoney" type="text" id="Sys_ModMoney" size="5" maxlength="5" value="<%=Sys_ModMoney%>">分才可以自定义头像——建议大于上传图片分数
	</td>
</tr>
<tr class="zd_td" height="18">
    <td width="100" align=right>自由广告1<BR>需要在页面中调用参数TieBa_AD_Top</td>
    <td width="600" align=left><textarea rows="5" name="TieBa_AD_Top" cols="45"><%=TieBa_AD_Top%></textarea>*支持Html</td>
</tr><tr class="zd_td" height="18">
    <td width="100" align=right>帖间广告</td>
    <td width="600" align=left>
    <%
		Dim TieBa_AD_Tie1,TieBa_AD_Tie2,TieBa_AD_Tie3,gap_len,gap_arr
		if instr(TieBa_AD_Tie,"|@|")>0 then
			'如果存在“|”，用|来区分是主题帖的广告还是奇数回复行的广告还是偶数回复行的广告
			gap_arr = Split(TieBa_AD_Tie,"|@|")
			gap_len = Ubound(gap_arr)
			if gap_len >=2 then
				TieBa_AD_Tie1 = gap_arr(0)
				TieBa_AD_Tie2 = gap_arr(1)
				TieBa_AD_Tie3 = gap_arr(2)
			elseif gap_len =1 then
				TieBa_AD_Tie1 = gap_arr(0)
				TieBa_AD_Tie2 = gap_arr(1)
				TieBa_AD_Tie3 = " "
			else 
				TieBa_AD_Tie1 = " "
				TieBa_AD_Tie2 = " "
				TieBa_AD_Tie3 = " "
			end if
		else
				TieBa_AD_Tie1 = TieBa_AD_Tie
				TieBa_AD_Tie2 = " "
				TieBa_AD_Tie3 = " "
		end if
	%>
    <textarea rows="2" name="TieBa_AD_Tie1" cols="45"><%=TieBa_AD_Tie1%></textarea>*主帖子广告,支持Html
    <textarea rows="2" name="TieBa_AD_Tie2" cols="45"><%=TieBa_AD_Tie2%></textarea>*奇数回帖行,支持Html
    <textarea rows="2" name="TieBa_AD_Tie3" cols="45"><%=TieBa_AD_Tie3%></textarea>*偶数回帖行,支持Html
    </td>
</tr>
<tr class="zd_td" height="18">
    <td width="100" align=right>自由广告2<BR>需要在页面中调用参数TieBa_AD_A</td>
    <td width="600" align=left><textarea rows="5" name="TieBa_AD_A" cols="45"><%=TieBa_AD_A%></textarea>*支持Html</td>
</tr>
<tr class="zd_td" height="18">
    <td width="100" align=right>自由广告3<BR>需要在页面中调用参数TieBa_AD_B</td>
    <td width="600" align=left><textarea rows="5" name="TieBa_AD_B" cols="45"><%=TieBa_AD_B%></textarea>*支持Html</td>
</tr>
<tr class="zd_td" height="18">
    <td width="100" align=right>保留用户名</td>
    <td width="600" align=left><textarea rows="5" name="Sys_KeepName" cols="45"><%=Sys_KeepName%></textarea>请用|分割，最后不要输入|。←<a href="javascript:" onClick="document.form13.Sys_KeepName.value+='|'">点此插入|</a></td>
</tr>
<tr class="zd_td" height="18">
    <td width="100" align=right>防御广告帖</td>
    <td width="600" align=left><textarea rows="5" name="Sys_ADWords" cols="45"><%=Sys_ADWords%></textarea>请用|分割，最后不要输入|。←<a href="javascript:" onClick="document.form13.Sys_ADWords.value+='|'">点此插入|</a></td>
</tr>
<tr class="zd_td" height="18">
    <td width="100" align=right>脏话过滤</td>
    <td width="600" align=left><textarea rows="5" name="Sys_BadWords" cols="45"><%=Sys_BadWords%></textarea>请用|分割，最后不要输入|。←<a href="javascript:" onClick="document.form13.Sys_BadWords.value+='|'">点此插入|</a></td>
</tr>
<tr class="zd_td" height="18">
    <td  align=center colspan=2><input type='button' name='Submit' onclick="form13.submit();" value='修改提交'> <input type="reset"  value="取消修改"></td>
</tr>
</table>
</form>
<script>Get_Notice(0);</script>
<%
End Sub 
'帖子回复等数据的修复。
Sub RepairBBS()
MyPageSize   = 40        '每页显示多少条

Server.Scripttimeout=999999
response.write "<font color=red>开始读取数据，请耐心等待...</font><br>" &vbcrlf
response.Flush

sql7 = "SELECT * FROM "&bbsTable&" where ischeck>0 ORDER BY [id] DESC"
Set rs7 = Server.CreateObject("ADODB.Recordset")
rs7.open sql7,conn,3,3
If rs7.eof and rs7.bof Then
	response.write "没有帖子可以修复"
Else
	rs7.PageSize     = MyPageSize
	MaxPages         = rs7.PageCount
	rs7.absolutepage = MyPage
	Totalcount            = rs7.RecordCount
	for i=1 to rs7.PageSize
		If not rs7.eof Then
			title=rs7("title")
			oldre=rs7("recount")
			oldlou=rs7("lou")
			replynum=0
					Set rs_re= Server.CreateObject("ADODB.Recordset")
					rs_re.Open "Select * From "&rebbstable&" where re="&rs7("id")&" and ischeck>0 order by addtime desc", conn,1,1  
					If rs_re.eof and rs_re.bof Then
						replynum=0
					Else
						replynum=rs_re.RecordCount
						rename=rs_re("username")
						addtime=rs_re("addtime")
						lou=rs_re("lou")
					End If 
					rs_re.close
			If replynum<>0 Then
				rs7("recount")=replynum
				rs7("rename")=rename
					If lou>=oldlou Then 
						rs7("lou")=replynum
					Else
						rs7("lou")=lou
					End If 
				rs7("retime")=addtime
			Else
				rs7("recount")=0
				rs7("rename")=rs7("username")
				rs7("lou")=0
				rs7("retime")=rs7("addtime")
			End If 
			rs7.update
			rs7.MoveNext
		end if
	Next
 		 if Totalcount/MyPageSize = int(Totalcount/MyPageSize) then 
		 infopage=int(Totalcount/MyPageSize)
		 else
		 infopage=int(Totalcount/MyPageSize)+1
		 end if
	If MyPage < infopage Then 
		response.write "修复完毕第 "&MyPage&" 页，共有 "&infopage&" 页&nbsp; <A HREF=""index.asp"">返回首页</A>"
		response.write "<meta http-equiv=""refresh"" content=""2;url=admin.asp?Action=RepairBBS&CurPage="&MyPage+1&""">"
		Else
		response.write "修复完毕!<A HREF=""index.asp"">返回首页</A>"
	End If 
End if
rs7.close
set rs7=Nothing
End Sub 
'插件列表
Sub ddpPlus()
%>
<style>
.adminplug{CLEAR: both;FLOAT: left;DISPLAY: inline}
.adminplug li{FLOAT: left;margin-right:10px}

</style>
<table width="800" align="center" cellSpacing=1 cellPadding=0 class="zd_table" border=0>
  <tr class="zd_td">
    <td height="30" align="center"><B>插件列表</B></td>
  </tr>
	<tr class="zd_td">
	<td height="30" align="center"><B><UL class="adminplug"><%=Plug_menu%></UL></td>
	</tr>
</table><BR>
<table width="800" align="center" cellSpacing=1 cellPadding=0 class="zd_table" border=0>
    <tr>
      <td class="zd_td">插件执行进度</td>
    </tr>
    <tr>
      <td height="45" class="zd_td" style="padding:10px;">
		<iframe frameborder="0" name="plugRun" id="plugRun" width="100%" height="380" src="tietu.htm"></iframe></td>
    </tr>
  </table>
  <%
End Sub 
'--------------------------数据库操作，备份还原压缩功能
Sub dbak()
%>

</td>
  </tr>
</table>

<%
End Sub 
Sub attach()
UploadDir="upload/"
maxperpage=5

cls=CheckStr(trim(Request("cls")))

if cls="Del" then
		call DelFiles()
end if

If cls="1" Then 
	upfolder=Trim(Request.Form("upfolder"))
	If upfolder<>"" Then
		session("attach_folder_"&webname)=upfolder&"/"
		Else
		session("attach_folder_"&webname)=""
	End If 
End If 
UploadDir=UploadDir & session("attach_folder_"&webname)


TruePath=Server.MapPath(UploadDir)
If not IsObjInstalled("Scripting.FileSystemObject") Then
	Response.Write "<b><font color=red>你的服务器不支持 FSO(Scripting.FileSystemObject)! 不能使用本功能</font></b>"
Else
	set fso=CreateObject("Scripting.FileSystemObject")
	if request("Action")="Del" then
		call DelFiles()
	end if
	
  if fso.FolderExists(TruePath)then
	FileCount=0
	TotleSize=0
	Set theFolder=fso.GetFolder(TruePath)
	For Each theFile In theFolder.Files
		zongshu=zongshu+1
		zongsize=zongsize+theFile.Size
	next
    totalPut=zongshu
	if MyPage<1 then
   		MyPage=1
   	end if
   	if (MyPage-1)*MaxPerPage>totalput then
		if (totalPut mod MaxPerPage)=0 then
	  		MyPage= totalPut \ MaxPerPage
	  	else
	      	MyPage= totalPut \ MaxPerPage + 1
		end if

    end If
    
   	dim c
	FileCount=0
	TotleSize=0
%>

<%
response.write viewpage(totalput,maxperpage,5,MyPage,"Action=attach","当前总数:","admin.asp")&"</td>"

response.write "<br><div align='center'>本页共显示 <b>" & FileCount & "</b> 个文件，占用 <b>" & TotleSize\1024 & "</b> K。共有 <b>" & totalPut & "</b> 个文件，占用 <b>" & zongSize\1024 & "</b> K</div>"
 else
	response.write "找不到文件夹！文件夹已经删除或未建立！"
	response.write "<a href='pic.asp'>返回</a>！"
  end if
end if
End Sub 

Public Function IsObjInstalled(strClassString)
	On Error Resume Next
	IsObjInstalled = False
	Err = 0
	Dim xTestObj
	Set xTestObj = Server.CreateObject(strClassString)
	If 0 = Err Then IsObjInstalled = True
	Set xTestObj = Nothing
	Err = 0
End Function

sub DelFiles()
	dim whichfile,arrFileName,i
	whichfile=trim(Request("FileName"))

	Set FSO=Server.CreateObject("Scripting.FileSystemObject")
	if whichfile="" then exit sub
	if instr(whichfile,",")>0 then
		arrFileName=split(whichfile,",")
		for i=0 to ubound(arrFileName)
			if left(trim(arrFileName(i)),3)<>"../" and left(trim(arrFileName(i)),1)<>"/" then
				If Left(trim(arrFileName(i)),1)="/" then trim(arrFileName(i))=Right(trim(arrFileName(i)),len(trim(arrFileName(i)))-1)
				whichfile=server.MapPath("upload/" & trim(arrFileName(i)))
				set thisfile=fso.GetFile(whichfile)
				thisfile.Delete True
			end if
		next
	else
		if left(whichfile,3)<>"../" and left(whichfile,1)<>"/" Then
			If Left(whichfile,1)="/" then whichfile=Right(whichfile,len(whichfile)-1)
			Set thisfile = fso.GetFile(server.MapPath("upload/" & whichfile))
			thisfile.Delete True
		end if
	end if
	Response.Write("<script>alert(""删除成功"");location.href="""&comurl&""";</script>")
end sub


%>
