<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="inc/conndb.asa"-->
<!--#include file="inc/function.asp"-->
<!--#include file=cookies.asp-->
<style type="text/css">
td,body {  font-size: 9pt}
a:link{ color:#000000; text-decoration:none}     
a:visited{COLOR: #000000; TEXT-DECORATION: none} 
a:active{color:green;text-decoration:none}
a:hover{color:215dc6;text-decoration:none}</style>
<%
PageShowSize = 10            '每页显示多少个页
MyPageSize   = 40        '每页显示多少条
	
If Not IsNumeric(Request("Curpage")) Or IsEmpty(Request("Curpage")) Or Request("Curpage") <=0 Then
MyPage=1
Else
MyPage=Int(Abs(Request("Curpage")))
End if
%>
<table width="93%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
<tr>
    <td height="18"><div align="right">
      <%
comurl=Cstr(Request.ServerVariables("HTTP_REFERER"))

webtitle="管理中心-"&bbsname
navdh="管理中心"

navright="<A HREF=""admin.asp?Action=sitemanage"">站点设置</A> | <A HREF=""admin.asp?Action=userList"">会员管理</A> |  <A HREF=""admin.asp?Action=BbsList"">帖子管理</A> | 	<A HREF=""admin.asp?Action=dustBin"">帖吧回收站</A> |  	<A HREF=""admin.asp?Action=stopip"">IP禁止</A> |  	<A HREF=""admin.asp?Action=boardlists"">分类管理</A>"
Call showpageq()'调用公用页面，显示界面

%>
</div></td></tr></table>


<script language="JavaScript">
function delete_confirm(e) {
 if (event.srcElement.outerText=="删除"||event.srcElement.outerText=="还原")
  event.returnValue=confirm("您确认执行该操作么？不可恢复");
 }
 document.onclick=delete_confirm;

 function checkNum(ev)
 {
	var bl = false;
	if(ev==null)ev=window.event;
	if(ev.keyCode==46)
	{
		ev.keyCode = 9;
		return true;
	}

	if (ev.keyCode<48 || ev.keyCode>57)
	{
		
		return bl;
	}
	else
	{
		bl = true;
		//ev.returnValue=bl;
		return bl;
	}
 }
 function checkIP(ev,ctrl)
 {
	var bl = false;
	if(ev==null)ev=window.event;
	if(ev.keyCode==46)
	{
		ev.keyCode = 9;
	}
	if(ctrl.value!="" && ev.keyCode==42)
	{
		return bl;
	}
	if(ctrl.value != "")
	{
		if(ctrl.value=="*")
		{
			return bl;
		}
	}
	if (ev.keyCode<48 || ev.keyCode>57)
	{
		if(ev.keyCode==42 || ev.keyCode==9)
		{
			bl = true;
		}
		return bl;
	}
	else
	{
		bl = true;
		//ev.returnValue=bl;
		return bl;
	}
 }
</script>
<%
Function  pagecontent()
	response.write ("<br><br>")
Dim Action
Dim i
Dim flg
    Action=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 "BbsDeal"
		    Call BbsDeal()
		Case "BbsList"
		    Call BbsList()
		Case "friendlink"
		    Call friendlink()
		Case "sitemanage"
			Call sitemanage()
		Case "plug-in"
			Call PlugIn()
		Case "dbak"
			Call dbak()
		Case "freeadvadmin"
			Call freeadvadmin()
		Case "clearcache"
			Application.Contents.RemoveAll()
			response.write ("缓存已经清空..........<BR>")
		Case Else 
			Call sitemanage()
    End Select
	response.write ("<br><br>")
End Function 
%>
<%
'-----------------------定义用户修改分类列表界面
Sub BoardLists()
%>
<table width="96%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
<tr>
    <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")
sql="select * from "&BoardTable&" order by board_order desc,board_id desc"
rs2.open sql,conn,1,1
do while not rs2.eof
%>
  <tr>
    <td height="18" bgcolor="#E8EEF4" ><%=rs2("board_id")%></td>
    <td bgcolor="#E8EEF4"><a href="admin.asp?Action=boardedit&boardid=<%=rs2("board_id")%>"><%=rs2("board_name")%></a></td>
    <td bgcolor="#E8EEF4"><%=left(trim(rs2("board_about")),100)%></td>
	<td bgcolor="#E8EEF4">&nbsp;<%=trim(rs2("board_admin"))%></td>
	<td bgcolor="#E8EEF4"><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 bgcolor="#E8EEF4"><a href="admin.asp?Action=boarddel&boardid=<%=rs2("board_id")%>">删除</a></td>
  </tr>
  <%rs2.movenext
	loop%>
</table>
<!-- 下面是对分类进行修改或者添加的功能 --><BR>
<%
boardid=Request.QueryString("boardid")
If boardid<>"" 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")
setcz="修改贴吧分类信息"
board_act="修改提交"
Else
setcz="添加贴吧分类信息"
board_order="100"
board_act="添加提交"
End If 
%>
<table width="96%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
  <tr>
    <td height="5"  align="center"><B><%=setcz%></B></td>
  </tr>
  <form name="form12" method="post" action="admin.asp?Action=boardsave">
  <tr>
      <td bgcolor="#E8EEF4">
	  分类名称：
      <input type="text" name="board_name" size="25" maxlength="30" value="<%=board_name%>">*50字以内（支持Html）</td>
	</tr>
  <tr>
      <td bgcolor="#E8EEF4">
	  分类图片：
      <input type="text" name="board_photo" size="40" maxlength="200" value="<%=board_photo%>"></td>
	</tr>
  <tr>
      <td bgcolor="#E8EEF4">
	  分 吧 主：
      <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>
      <td bgcolor="#E8EEF4">
      分类说明：
        <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>
      <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")

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("分类说明太短或者太长","")
'Board_name=server.htmlencode(Board_name) '为了让名称和分类介绍支持Html,特意屏蔽了该参数
'Board_About=server.htmlencode(Board_About) '为了让名称和分类介绍支持Html,特意屏蔽了该参数

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.update
rs.close
set rs=Nothing
conn.close
set conn=Nothing
Application(webname&"Loaded")=""
response.write backmsg("恭喜，分类"&acts&"成功！","admin.asp?Action=boardlists")
End Sub
'-----------------------定义分类删除功能
Sub boarddel()
boardid=CInt(Request.QueryString("boardid"))
conn.execute "delete from "&BoardTable&" where Board_id="&Boardid
'conn.execute "delete from art_body where typeid="&Board_id
conn.close
Set conn=Nothing
Application(webname&"Loaded")=""
response.write backmsg("恭喜，分类删除成功！","admin.asp?Action=boardlists")
End Sub 

'-----------------------菜单排序的上升功能
Sub boardup()
Board_order=CInt(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&"Loaded")=""
	Response.Redirect "admin.asp?Action=boardlists"
End Sub 
'-----------------------菜单排序的降序功能
Sub boarddown()
Board_order=CInt(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&"Loaded")=""
	Response.Redirect "admin.asp?Action=boardlists"
End Sub 

'IP管理
sub stopip()
dim ipid,ipcls
ipid=CInt(Request.QueryString("id"))
ipcls=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 
		'If Not IsNumeric(Request.Form("endip" & i)) Then
			'If Trim(Request.Form("endip" & 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

%><form name='form1' method='post' action='admin.asp?Action=stopip&cls=saveip'><table width="83%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
  <tr><td height="40" colspan='4'><div align='center'>IP管理</div></td></tr><tr><td width='12%'><div align='right'>禁用IP段:</div></td><td width='37%' bgcolor="#E8EEF4">起始: 
    <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 width="40%" bgcolor="#E8EEF4">结束: 
      <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 width="11%" bgcolor="#E8EEF4"><input type='submit' name='Submit' value='添加'></td></tr><tr><td><div align='right'>说明:</div></td><input name='action_e' type='hidden' value='stopip'><td colspan='3' bgcolor="#E8EEF4"><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")
%><table width="83%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
        <TBODY>
<tr><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 
%><tr class=zd_td><td bgcolor="#E8EEF4"><%
			  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>")
			 
%></td><td bgcolor="#E8EEF4"><%=rs("ip1")%></td> <td bgcolor="#E8EEF4"><%=ip2%></td> <td bgcolor="#E8EEF4"><%=rs("rdate")%></td> <td bgcolor="#E8EEF4"><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

%><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=CInt(Request.QueryString("uid"))
cz=trim(Request.QueryString("cz"))
tiaojian=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 "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"))
	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.Update
    Rs.Close
    Set Rs=Nothing
	Response.Write backmsg("恭喜您，"&shuoming&"修改成功!","")
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")
	Rs_user.Close
    Set Rs_user=Nothing
%>
<form name="save" method="post" action="admin.asp?Action=userList&cz=bjsave">
  <table width="66%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
  <tr>
    <td height="30" align="center" colspan=2><B>密码修改</B></td>
    </tr>
<tr>
    <td width="30%" height="30"  bgcolor="#E8EEF4"><strong>帐  号：</strong></td>
    <td bgcolor="#E8EEF4">&nbsp;
      <input name="username" type="text" id="username" size="20" maxlength="20" value="<%=user_name%>" disabled=true>
    </td><input name="uid" type="hidden"  value="<%=uid%>">
    </tr>
  <tr>
    <td height="30"  bgcolor="#E8EEF4"><strong> 密 码：</strong></td>
    <td bgcolor="#E8EEF4">&nbsp;
      <input name="pwd0" type="password" id="pwd0" size="20" maxlength="20"> <font color="#ff0000">如不修改，请留空</a></td>
    </tr>
  <tr>
    <td height="30"  bgcolor="#E8EEF4"><strong>积分：</strong></td>
    <td bgcolor="#E8EEF4">&nbsp;
      <input name="umoney" type="text" id="umoney" size="10" maxlength="8" value="<%=umoney%>"></td>
    </tr>
  <tr>
    <td height="30"  bgcolor="#E8EEF4"><strong>登录信息：</strong></td>
    <td bgcolor="#E8EEF4">&nbsp;共登录<%=logintimes%>次</td>
    </tr>
  <tr>
    <td height="30"  bgcolor="#E8EEF4"><strong>性别：</strong></td>
    <td bgcolor="#E8EEF4">&nbsp;
      <select name="user_sex">
<option value="0" <% If user_sex<>1 Then response.write "selected"%>>男</option>
<Option value="1" <% If user_sex=1 Then response.write "selected"%>>女</option></select></td>
    </tr>
  <tr>
    <td height="30"  bgcolor="#E8EEF4"><strong>电子邮件：</strong></td>
    <td bgcolor="#E8EEF4">&nbsp;
      <input name="user_mail" type="text" id="user_mail" size="40" maxlength="50" value="<%=user_mail%>"></td>
    </tr>
  <tr>
    <td height="30"  bgcolor="#E8EEF4"><strong>QQ号码：</strong></td>
    <td bgcolor="#E8EEF4">&nbsp;
      <input name="user_qq" type="text" id="user_qq" size="20" maxlength="12" value="<%=user_qq%>"></td>
    </tr>
  <tr>
    <td height="30"  bgcolor="#E8EEF4"><strong>来自地区：</strong></td>
    <td bgcolor="#E8EEF4">&nbsp;
      <input name="user_from" type="text" id="user_from" size="40" maxlength="40" value="<%=user_from%>"></td>
    </tr>
  <tr>
    <td height="30"  bgcolor="#E8EEF4"><strong>个人主页：</strong></td>
    <td bgcolor="#E8EEF4">&nbsp;
      <input name="user_hompage" type="text" id="user_hompage" size="40" maxlength="200" value="<%=user_hompage%>"></td>
  </tr>
  <tr>
    <td height="30"  bgcolor="#E8EEF4"><strong>个性签名：</strong></td>
    <td bgcolor="#E8EEF4">&nbsp;
      <input name="user_show" type="text" id="user_show" size="40" maxlength="100" value="<%=user_show%>"> 100中文字以内</td>
   </tr>

  <tr>
    <td height="30" >　</td>
    <td><input name="submit" type="submit" id="submit" value="提  交">
      &nbsp;&nbsp;
      <input name="reset" type="reset" id="reset" value="重新填写"></td>
    </tr>
</table>
</form>
<%
Case "modifyName"
	Call ModifyName()

Case "updName"
	If Request.Form("ouid")="" Or Request.Form("nuid")="" Then
		Response.Write("<script>alert('参数错误，无法提交');window.history.go(-1);</script>")
		Response.End()
	End If 
	nuid = Request.Form("nuid")
	ouid = Request.Form("ouid")
	
	' 判断该用户是否为版主或管理员 'Add For Customer Issue
	if AdminLevel(ouid) > 0 then
		Response.Write(backMsg(ouid&"是版主或管理员,改名前请先释放其权限",""))
		Response.End()
	end if
	
	sqlUpdUname0 = "select [username] from "& UserTable &" where [username]='"&nuid&"'"
	set userExist = conn.Execute(sqlUpdUname0)
	If Not userExist.eof Then
		Response.Write("<script>alert('用户名:"&nuid&" 已存在，请选用其他的名称');window.history.go(-1);</script>")
		Response.End()
	End If 
	sqlUpdUname1 = "update "& UserTable & " Set [username]='"& nuid &"' where [username]='"&ouid&"' "
	sqlUpdUname2 = "update "& bbstable & " Set [username]='"& nuid &"' where [username]='"&ouid&"'"
	sqlUpdUname3 = "update "& bbstable & " Set [rename]='"& nuid &"' where [rename]='"&ouid&"'"
	sqlUpdUname4 = "update "& rebbstable & " Set [username]='"& nuid &"' where [username]='"&ouid&"'"
	sqlUpdUname5 = "update "& "message" & " Set [incept]='"& nuid &"' where [incept]='"&ouid&"'"
	sqlUpdUname6 = "update "& "message" & " Set [sender]='"& nuid &"' where [sender]='"&ouid&"'"
	
	'Add For V1.5 CHANG,ZIDONE 积分表更新'''Begin
	sqlUpdUname7 = "update "& "[Account]" & " Set [accFromUser]='"& nuid &"' where [accFromUser]='"&ouid&"'"
	sqlUpdUname8 = "update "& "[Account]" & " Set [accToUser]='"& nuid &"' where [accToUser]='"&ouid&"'"
	''''''''''''''''''''''''''''''''''''''''End
	conn.Execute(sqlUpdUname1)
	Response.Write("&nbsp;&nbsp;Update User List …… OK!<br />"&VbCrLf )
	conn.Execute(sqlUpdUname2)
	Response.Write("&nbsp;&nbsp;Update BBS Title …… OK!<br />"&VbCrLf)
	conn.Execute(sqlUpdUname3)
	Response.Write("&nbsp;&nbsp;Update LastReply …… OK!<br />"&VbCrLf)
	conn.Execute(sqlUpdUname4)
	Response.Write("&nbsp;&nbsp;Update BBS Reply …… OK!<br />"&VbCrLf)
	conn.Execute(sqlUpdUname5)
	Response.Write("&nbsp;&nbsp;Update ReceiveMSG…… OK!<br />"&VbCrLf)
	conn.Execute(sqlUpdUname6)
	Response.Write("&nbsp;&nbsp;Update Send MSG  …… OK!<br />"&VbCrLf)
	
	'Add For V1.5 CHANG,ZIDONE 积分表更新'''Begin
	conn.Execute(sqlUpdUname7)
	Response.Write("&nbsp;&nbsp;Update [ACCOUNT1]  …… OK!<br />"&VbCrLf)
	conn.Execute(sqlUpdUname8)
	Response.Write("&nbsp;&nbsp;Update [ACCOUNT2]  …… OK!<br />"&VbCrLf)
	''''''''''''''''''''''''''''''''''''''''End
	
	Response.Write("<script>alert('更新用户信息成功，请确定返回');window.location='?Action=userList'</script>")
	Response.End()

Case Else
If tiaojian<>"" Then ptiaojian=" where username like '%"&tiaojian&"%'"
%>
<table width="96%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
<tr>
<td height="18" align="center" colspan="6"><center><B>会员管理</B></center></td></tr>
<tr><form name='tiaojian' method='post' action='admin.asp?Action=userList'>
<td height="10" align="left" colspan="6">&nbsp;
会员检索：<input name='tj' type='text' size='20' maxlength='10'>&nbsp;<input  type='submit' name='Submit' value='检索'> (* 支持模糊查询)</td></form></tr>
<%
	userUrl = Request.QueryString
	newUrl = ""
	if Instr(userUrl,"order")>0 then
		for ui2=0 to ubound(split(userUrl,"&"))
			if instr(split(userUrl,"&")(ui2),"order")<=0 then 
				newUrl =newUrl & split(userUrl,"&")(ui2) &"&"
			end if
		next 
	else
		newUrl = userUrl
	end if
	if(Right(newUrl,1))="&" then newUrl=Left(newUrl,Len(newUrl)-1)
%>
<tr>
    <td width="26" height="18" bgColor="#EFEFEF"><strong><a href='?<%=newUrl%><%if 1=1 then%>&order=[id]<%end if%>'>ID</a></strong></td>
    <td width="172" height="18" bgColor="#EFEFEF"><strong><a href='?<%=newUrl%><%if 1=1 then%>&order=username<%end if%>'>用户名</a></strong>(点击排序)</td>
    <td width="300" height="18" bgColor="#EFEFEF"><strong><a href='?<%=newUrl%><%if 1=1 then%>&order=regTime<%end if%>'>注册时间</a></strong>(点击排序)</td>
    <td width="100" height="18" bgColor="#EFEFEF"><strong><a href='?<%=newUrl%><%if 1=1 then%>&order=umoney<%end if%>'>积分</a></strong>(点击排序)</td>
	<td height="18" bgColor="#EFEFEF"><strong>编辑</strong></td>
    <td height="18" bgColor="#EFEFEF"><strong>删除</strong></td>
</tr>
<%set rs2=server.CreateObject("adodb.recordset")
sql2="select * from " & UserTable &" "& ptiaojian
if Request.QueryString("order")<>"" then
	sql2=sql2 & " order by " & 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
%>
  <tr>
    <td height="18" ><%=rs2("id")%></td>
    <td><a href="user.asp?Action=infoshow&username=<%=rs2("username")%>" target=blank><%=rs2("username")%></a></td>
    <td><%=trim(rs2("regtime"))%></td>
	<td><%=trim(rs2("umoney"))%></td>
	<td><a href="admin.asp?Action=userList&cz=bj&uid=<%=rs2("id")%>">编辑</a> 
	<a href="admin.asp?Action=userList&cz=modifyName&uName=<%=rs2("username")%>">改名</a></td>
    <td><a href="admin.asp?Action=userList&cz=del&uid=<%=rs2("id")%>">删除</a></td>
  </tr>
<%rs2.MoveNext
End If 
Next
response.write "<tr bgcolor=""#ffffff"">"
response.write "<td height=""30"" align=""center"" colspan=""6""><center>"& viewpage(Totalcount,MyPageSize,PageShowSize,MyPage,"Action=userList&order="&Request.QueryString("order"),"当前总数:","admin.asp")&"</center></td>"
response.write "</tr>"
End If 
response.write "</table>"
	rs2.close
	set rs2=Nothing
End Select 
End Sub
'回收站
Sub dustBin()
sql7 = "SELECT * FROM "&bbsTable&" where [ischeck]=-1 or [Boardid] is null or [Boardid]=0 or ([boardid] not in (select board_id from bbsboard ))  ORDER BY [addtime] DESC"

'sql7 = "SELECT b.title as btitle,b.id as bid,b.ischeck as bic,r.title as rtitle,r.re as re,r.id as rid,r.ischeck as ric FROM "&bbsTable&" as b,"&rebbsTable&" as r where bic=0 or ric=0 and re=bid ORDER BY bid DESC"


Set rs7 = Server.CreateObject("ADODB.Recordset")
rs7.open sql7,conn,1,1
%>
<form action="admin.asp?Action=BbsDeal" method=post name=inbox>
  <table width="96%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
    <tr>
      <td height="30" align="center" colspan="4"><b>贴吧回收站</b></td>
    </tr>
    <tr>
      <td height="30" align="left" colspan="4" bgcolor="#E8EEF4"> 使用说明:<br />
        &nbsp; * 某个贴吧分类被删除后，原分类下所有帖子将会被自动回收到回收站<br />
        &nbsp; * 管理员从前台删除某篇帖子后，该帖子会自动转入到回收站<br />
        &nbsp; * 帖子主题进入回收站后，其回复的帖子不会在下面的“帖子回复”列表中出现<br />
      &nbsp; * 管理员从前台删除某篇回复后，该回复会自动转入到下面的“帖子回复”列表中 </td>
    </tr>
    <tr>
      <td height="30" align="left" colspan="4">&nbsp; <b>帖子主题</b>(请删除或者转移)</td>
    </tr>
    <%If rs7.eof and rs7.bof Then%>
    <tr bgcolor="#ffffff">
      <td height="33" colspan="4" align="center" bgcolor="#E0E9F1"><b>暂无帖子</b></td>
    </tr>
    <%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")
		if Rs7("TitleColor")<>"" Then title="<font color="&Rs7("TitleColor")&">"&title&"</font>"
%>
    <tr bgcolor="#ffffff">
      <td width="9%" height="24" align="center" bgcolor="#E8EEF4"><input name=bbsid2 type=checkbox value="<%=rs7("id")%>" />      </td>
      <td width="76%" bgcolor="#E8EEF4">&nbsp;<a href="show.asp?id=<%=rs7("id")%>" target=_blank><%=title%></a></td>
      <td width="15%" colspan="2" bgcolor="#E8EEF4"><a href='edit.asp?tn=bbs&id=<%=rs7("id")%>'>编辑</a></td>
    </tr>
    <%
rs7.MoveNext
end if
Next
%>
    <tr bgcolor="#ffffff">
      <td height="35" colspan="3" align="center" bgcolor="#C5D5E4"><center>
        移动到：
            <% Call boardselect()%>
        <input type="checkbox" name="chkall2" value="on" onclick="CheckAll(this.form)" />
        全选/取消
        <input name="cz" type="radio" value="BatchDel" />
        批量删除(<font color=red>真正删除</font>)
        <input type="radio" name="cz" value="BatchMove" />
        批量移动
        <input type="radio" name="cz" value="ReDel" />
        批量还原
        <input name="Submit2" type="submit" class="button" id="Submit2" value="执行" onclick="{if(confirm('您确定执行的操作吗?')){return true;}return false;}" />
      </center></td>
    </tr>
    <%response.write "<tr bgcolor=""#ffffff"">"
response.write "<td height=""80"" align=""center"" colspan=""4""><center>"& viewpage(Totalcount,MyPageSize,PageShowSize,MyPage,"Action=dustBin","当前总数:","admin.asp")&"</center></td>"
response.write "</tr>"
		End if
	rs7.close
	set rs7=Nothing
%>
  </table>
</form>


<%sql7 = "SELECT * FROM "&rebbsTable&" where [ischeck]=-1 ORDER BY addtime DESC"
Set rs7 = Server.CreateObject("ADODB.Recordset")
rs7.open sql7,conn,1,1
%>
<form action="admin.asp?Action=BbsDeal" method=post name=inbox>
  <table width="91%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
    <tr>
      <td height="30" align="left" colspan="3">&nbsp; <b>帖子回复</b>(请删除或者还原)</td>
    </tr>
    <%If rs7.eof and rs7.bof Then%>
    <tr bgcolor="#ffffff">
      <td height="30" colspan="3" align="center" bgcolor="#D1DDE9"><b>暂无帖子</b></td>
    </tr>
    <%Else
rs7.PageSize     = MyPageSize
MaxPages         = rs7.PageCount
rs7.absolutepage = MyPage
Totalcount            = rs7.RecordCount
for i=1 to rs7.PageSize
If not rs7.eof Then
		retitle=Rs7("title")
%>
    <tr bgcolor="#ffffff">
      <td width="53" height="24" align="center" bgcolor="#E8EEF4"><input name=bbsid3 type=checkbox value="<%=rs7("id")%>" /></td>
      <td width="663" bgcolor="#E8EEF4">&nbsp;<a href="show.asp?id=<%=rs7("re")%>" target=_blank></a><%=retitle%></td>
      <td width="130" align="center" bgcolor="#E8EEF4"><a href='edit.asp?tn=rebbs&id=<%=rs7("id")%>'>编辑</a></td>
    </tr>
    <%
rs7.MoveNext
end if
Next
%>
    <tr bgcolor="#ffffff">
      <td height="30" colspan="3" align="center" bgcolor="#C5D5E4"><center>
          <input type="checkbox" name="chkall3" value="on" onclick="CheckAll(this.form)" />
        全选/取消
        <input name="cz" type="radio" value="BatchDelR" />
        批量删除(<font color=red>真正删除</font>)
        <input type="radio" name="cz" value="ReDelR" />
        批量还原
        <input name="Submit4" type="submit" class="button" id="Submit3" value="执行" onclick="{if(confirm('您确定执行的操作吗?')){return true;}return false;}" />
      </center></td>
    </tr>
    <%response.write "<tr bgcolor=""#ffffff"">"
response.write "<td height=""80"" align=""center"" colspan=""4""><center>"& viewpage(Totalcount,MyPageSize,PageShowSize,MyPage,"Action=dustBin","当前总数:","admin.asp")&"</center></td>"
response.write "</tr>"
		End if
	rs7.close
	set rs7=Nothing
%>
  </table>
  <br>
  <br>

</form><script language=javascript>
function CheckAll(form1)  {
  for (var i=0;i<form1.elements.length;i++)    {
    var e = form1.elements[i];
    if (e.name != 'chkall')       e.checked = form1.chkall.checked; 
   }
  }
</script>
<%

End Sub 
Sub BbsDeal()
cz=Trim(Request.Form("cz"))
bbsid=trim(Request.Form("bbsid"))
boardid=trim(Request.Form("boardid"))

if cz="" or isnull(cz) then	response.write backmsg("请选择相关参数！","")
'批量删除、清空回收站
If cz="BatchDel" Then 
	if bbsid="" or isnull(bbsid) then
		response.write backmsg("请选择相关参数！","")
	else
		conn.execute("delete from "&bbsTable&" where id in ("&bbsid&")")
		conn.execute("delete from "&rebbsTable&" where re in ("&bbsid&")")
		response.write backmsg("恭喜，批量删除成功",comurl)
	end if
End If

'批量删除回复、清空回收站
If cz="BatchDelR" Then 
	if bbsid="" or isnull(bbsid) then
		response.write backmsg("请选择相关参数！","")
	else
		conn.execute("delete from "&rebbsTable&" where id in ("&bbsid&")")
		response.write backmsg("恭喜，批量删除回帖成功",comurl)
	end if
End If

'还原帖子
If cz="ReDel" Then 
	if bbsid="" or isnull(bbsid) then
		response.write backmsg("请选择相关参数！","")
	else
		conn.execute("update "&bbsTable&" set IsCheck=1 where id in ("&bbsid&")")
		If boardid<>"" Then '如果有了分类参数，就还原到那个分类下了。
			conn.execute("update "&bbsTable&" set boardid="&boardid&" where id in ("&bbsid&")")
			shuo="新的分类id为"&boardid
		End If 
		response.write backmsg("恭喜，批量还原成功"&shuo,comurl)
	end if
End If

'还原帖子
If cz="ReDelR" Then 
	if bbsid="" or isnull(bbsid) then
		response.write backmsg("请选择相关参数！","")
	else
		conn.execute("update "&rebbsTable&" set IsCheck=1 where id in ("&bbsid&")")
		response.write backmsg("恭喜，批量还原回帖成功"&shuo,comurl)
	end if
End If 

'批量虚拟删除
If cz="BatchVDel" Then 
	if bbsid="" or isnull(bbsid) then
		response.write backmsg("请选择相关参数！","")
	else
		conn.execute("update "&bbsTable&" set IsCheck=-1 where id in ("&bbsid&")")
		response.write backmsg("恭喜，批量删除成功",comurl)
	end if
End If 
 
'批量移动
If cz="BatchMove" Then 
if boardid="" or isnull(boardid) then	response.write backmsg("请选择相关分类参数！","")
	if bbsid="" or isnull(bbsid) then
		response.write backmsg("请选择相关参数！","")
	else
		conn.execute("update "&bbsTable&" set boardid="&boardid&" where id in ("&bbsid&")")
		response.write backmsg("恭喜，批量移动成功",comurl)
	end if
End If 
End Sub

Sub BbsList()
boardid=Request("boardid")
If boardid<>"" And boardid<>0 Then
tiaojian="and boardid="&boardid
tiaoj="&boardid="&boardid
End If 
sql7 = "SELECT * FROM "&bbsTable&" where ischeck>-1 "&tiaojian&" ORDER BY id DESC"
Set rs7 = Server.CreateObject("ADODB.Recordset")
rs7.open sql7,conn,1,1
%>
<form action="admin.asp?Action=BbsDeal" method=post name=inbox>
  <table width="96%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
    <tr>
      <td height="30" align="center" colspan="2"><b>帖子批处理</b> &nbsp;&nbsp;筛选帖子：
          <%
Response.Write("<select name=""board""  onchange='window.location=this.value'>"&Chr(13)&Chr(10))
sql_bn21 = "SELECT board_name,board_id FROM "&boardtable&" ORDER BY board_order DESC,board_id DESC" 
Set rs_bn21 = Server.CreateObject("ADODB.Recordset")
	rs_bn21.OPEN sql_bn21,Conn,0,1
		listidss = listidss&"<option value='?Action=BbsList'>请选择贴吧</option>"&Chr(13)&Chr(10)
		if rs_bn21.eof and rs_bn21.bof then
			'Response.Write"还没有贴吧" '-- Delete by zidone 06/12/18
		else
			Dim sel
			do while not rs_bn21.eof
				'----Add by zidone For Stronger Program 2006/12/30
				If request.QueryString("Action")="BbsList" And request.QueryString("boardid")<>"" Then
					If CStr(request.QueryString("boardid"))=CStr(rs_bn21(1)) Then
						sel="selected"
					Else
						sel=""
					End If 
				End if
				listidss=listidss&"<Option value=""?Action=BbsList&boardid="&rs_bn21(1)&"""  "&sel&" >"&rs_bn21(0)&"</option>"&Chr(13)&Chr(10)
				rs_bn21.movenext
			loop
		end if
	rs_bn21.close
Set rs_bn21=Nothing
Response.Write(listidss)
Response.Write("</select>")
%></td>
    </tr>
    <%If rs7.eof and rs7.bof Then%>
    <tr bgcolor="#ffffff">
      <td height="30" colspan="2" align="center" bgcolor="#DCE4ED"><b>暂无帖子</b></td>
    </tr>
    <%Else
rs7.PageSize     = MyPageSize
MaxPages         = rs7.PageCount
rs7.absolutepage = MyPage
Totalcount            = rs7.RecordCount
for i=1 to rs7.PageSize
If not rs7.eof Then
	'显示是否被审核
	if CStr(rs7("isCheck"))= "0" then
		chkStr = " <font color=gray>[未审核]</font>"
	else
		chkStr = " "
	end if
	title=Rs7("title")
	if Rs7("TitleColor")<>"" Then title="<font color="&Rs7("TitleColor")&">"&title&"</font>"
%>
    <tr bgcolor="#ffffff">
      <td width="8%" height="24" align="center" bgcolor="#E8EEF4"><input name=bbsid type=checkbox value="<%=rs7("id")%>" />      </td>
      <td width="92%" colspan="2" bgcolor="#E8EEF4">&nbsp;<a href="show.asp?id=<%=rs7("id")%>" target=_blank><%=title&chkStr%></a><a href='edit.asp?tn=bbs&id=<%=rs7("id")%>'> 编辑</a></td>
    </tr>
    <%
rs7.MoveNext
end if
Next
%>
    <tr bgcolor="#ffffff">
      <td height="31" colspan="2" align="center" bgcolor="#C5D5E4"><center>
        移动到：
            <% Call boardselect()%>
        <input type="checkbox" name="chkall" value="on" onclick="CheckAll(this.form)" />
        全选/取消
        <input name="cz" type="radio" value="BatchVDel" />
        批量删除
        <input type="radio" name="cz" value="BatchMove" />
        批量移动
        <input name="Submit5" type="submit" class="button" id="Submit" value="执行" onclick="{if(confirm('您确定执行的操作吗?')){return true;}return false;}" />
      </center></td>
    </tr>
    <%response.write "<tr bgcolor=""#ffffff"">"
response.write "<td height=""80"" align=""center"" colspan=""4""><center>"& viewpage(Totalcount,MyPageSize,PageShowSize,MyPage,"Action=BbsList"&tiaoj,"当前总数:","admin.asp")&"</center></td>"
response.write "</tr>"
		End if
	rs7.close
	set rs7=Nothing
%>
  </table>
</form><script language=javascript>
function CheckAll(form1)  {
  for (var i=0;i<form1.elements.length;i++)    {
    var e = form1.elements[i];
    if (e.name != 'chkall')       e.checked = form1.chkall.checked; 
   }
  }
</script>
<%
End Sub
%>
<%
Sub ModifyName
%>
	<table width="96%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
		<form name=form1 method=post action="?Action=userList&cz=updName">
		<tr>
		<td height="30" align="center" colspan=2><B>修改会员ID</B><br>
		</td>
		</tr>
		<tr>
		<td height="30" colspan=2 align="left" bgcolor="#E8EEF4">
			&nbsp;&nbsp;* 该操作将改变会员的ID,以及所有该会员在贴吧的发帖、回帖、短消息及其他涉及到ID的地方。<br>
			&nbsp;&nbsp;* 请慎用。
		</td>
		</tr>
		<tr>
			<td height="30" ><strong>原ID:</strong></td>
		  <td bgcolor="#E8EEF4">&nbsp;<%=Request.QueryString("uName")%></td>
		</tr>
		<tr>
			<td height="30" ><strong>变更为:</strong></td>
			<td bgcolor="#E8EEF4">&nbsp;
			  <input type="text" name="nuid" value="<%=Request.QueryString("uName")%>"/>
			<input type="hidden" name="ouid" value="<%=Request.QueryString("uName")%>"/>
		  </td>
		</tr>
		<tr>
		<td height="30" align="center" colspan=2><span onclick="if(!confirm('确定要更改此名称?'))return false;"><input type="submit" name="sb" value="执行变更" /></span><input type="button" name="rs" onclick="history.go(-1);" value="返回上页" /><br>
		</td>
		</tr></form>
</table>
<%
End Sub
Sub friendlink()
cls=trim(Request.QueryString("cls"))
lid=trim(Request.QueryString("id"))
Select case cls
case ""
case "del"
	conn.execute("Delete  From "&LinkTable&" Where id="&lid)
	response.write backmsg("恭喜，链接删除成功！","admin.asp?Action=friendlink")
case "up"
Link_order=CInt(Request.QueryString("link_order"))
	Dim OldOrders,NewOrders
	Set Rs=Server.CreateObject("ADODB.RecordSet")
	Sql="SELECT TOP 2 link_order from "&LinkTable&" WHERE link_order>="&link_order&" ORDER BY link_order"
	Rs.Open SQL,Conn,1,3
	If Not (Rs.EOF Or Rs.BOF) Then
		OldOrders=rs("link_order")
		Rs.MoveNext
		If Not (Rs.EOF Or  Rs.BOF) Then
			NewOrders=Rs("link_order")
			Rs("link_order")=OldOrders
			Rs.Update
			Rs.MovePrevious
			Rs("link_order")=NewOrders
			Rs.Update
		End If
	End If
	Rs.Close
	Set Rs=Nothing
	Response.Redirect "admin.asp?Action=friendlink"
case "down"
link_order=CInt(Request.QueryString("link_order"))
	Set Rs=Server.CreateObject("ADODB.RecordSet")
	Sql="SELECT TOP 2 link_order from "&linkTable&" WHERE link_order<="&link_order&" ORDER BY link_order desc"
	Rs.Open SQL,Conn,1,3
	If Not (Rs.EOF Or Rs.BOF) Then
		OldOrders=rs("link_order")
		Rs.MoveNext
		If Not (Rs.EOF Or  Rs.BOF) Then
			NewOrders=Rs("link_order")
			Rs("link_order")=OldOrders
			Rs.Update
			Rs.MovePrevious
			Rs("link_order")=NewOrders
			Rs.Update
		End If
	End If
	Rs.Close
	Set Rs=Nothing
	Response.Redirect "admin.asp?Action=friendlink"
case "save"

id=Request.Form("fid")
Link_name=CStr(Request.Form("Link_name"))
Link_info=Request.Form("Link_info")
Link_url=Request.Form("Link_url")

If Link_name="" Or Len(Link_name)>100 Then response.write backmsg("名称太短或者太长","")
If Link_info="" Or Len(Link_info)>200 Then response.write backmsg("说明太短或者太长","")
If Link_url="" Or Len(Link_info)>200 Then response.write backmsg("地址太短或者太长","")
Set rs = Server.CreateObject("ADODB.Recordset")
'判断是修改还是添加
If id="" Then'如果是添加
		'这里首先要读取最大排序数字，为的是给新添加的排序字段有数据输入。
		Set Rs77=Conn.Execute("SELECT Max(Link_order) FROM "& LinkTable &"")
			If Rs77.EOF Or Rs77.BOF Then 
				Link_order=1
			Else
				Link_order=Rs77(0)+1
			End If
		If IsNull(Link_order) Then Link_order=1
		'读取排序号结束。
acts="添加"
sql = "SELECT * FROM "&LinkTable&" where (id is null)" 
rs.OPEN sql,Conn,1,3
rs.addnew
rs("Link_order")=Link_order
Else
acts="修改"
sql = "SELECT * FROM "&LinkTable&" where id="&id 
rs.OPEN sql,Conn,1,3
End If 
rs("Link_name")=Link_name
rs("Link_url")=Link_url
rs("Link_info")=Link_info
rs.update
rs.close
set rs=Nothing
conn.close
set conn=nothing
response.write backmsg("恭喜，链接"&acts&"成功！","admin.asp?Action=friendlink")
End Select 
%>
<table width="96%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
<tr>
    <td width="32" height="18">ID</td>
    <td width="208" height="18">名称(点击进入修改)</td>
    <td width="242" height="18">简介</td>
    <td width="219" height="18">地址</td>
	<td width="64" height="18">排序</td>
    <td width="105" height="18">操作</td>
  </tr>
<%set rs2=server.CreateObject("adodb.recordset")
sql="select * from "&LinkTable&" where link_type=0 order by link_order desc,id desc"
rs2.open sql,conn,1,1
do while not rs2.eof
%>
  <tr>
    <td height="18" bgcolor="#E8EEF4" ><%=rs2("id")%></td>
    <td bgcolor="#E8EEF4"><a href="admin.asp?Action=friendlink&cls=edit&id=<%=rs2("id")%>"><%=rs2("link_name")%></a></td>
    <td bgcolor="#E8EEF4"><%=left(trim(rs2("link_info")),100)%></td>
	<td bgcolor="#E8EEF4"><a href="<%=trim(rs2("link_url"))%>" target=_blank><%=trim(rs2("link_url"))%></a></td>
	<td bgcolor="#E8EEF4"><a href="admin.asp?Action=friendlink&cls=up&link_order=<%=rs2("link_order")%>">↑</a> <a href="admin.asp?Action=friendlink&cls=down&link_order=<%=rs2("link_order")%>">↓</a></td>
    <td bgcolor="#E8EEF4"><a href="admin.asp?Action=friendlink&cls=del&id=<%=rs2("id")%>">删除</a></td>
  </tr>
  <%rs2.movenext
	loop%>
</table>
 </tr>
<%
If cls="edit" And lid<>"" Then
shuoming="编辑"
set rs2=server.CreateObject("adodb.recordset")
sql="select * from "&LinkTable&" where id="&lid
rs2.open sql,conn,1,1
If rs2.eof Or rs2.bof Then 
Call backmsg("参数错误或者无此链接","")
Else
link_name=rs2("link_name")
link_url=rs2("link_url")
link_info=rs2("link_info")
End If
Else
shuoming="新增加"
End If 
%><BR><CENTER><B><%=shuoming%>链接</B></CENTER>

<form name='form1' method='post' action='admin.asp?Action=friendlink&cls=save'>
<table width="96%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
<tr>
    <td width="30" height="18">ID</td>
    <td width="194" height="18">名称</td>
    <td width="225" height="18">简介</td>
    <td width="196" height="18">地址</td>
	<td width="65" height="18">排序</td>
    <td width="160" height="18">操作</td>
  </tr>
<tr>
    <td width="30" height="18" bgcolor="#E8EEF4"><input name="fid" type="hidden" id="id" value="<%=lid%>"></td>
    <td width="194" height="18" bgcolor="#E8EEF4"><input name="link_name" type="text" id="link_name" size="20" maxlength="20" value="<%=link_name%>"></td>
    <td width="225" height="18" bgcolor="#E8EEF4"><input name="link_info" type="text" id="link_info" size="20" maxlength="200" value="<%=link_info%>"></td>
    <td width="196" height="18" bgcolor="#E8EEF4"><input name="link_url" type="text" id="link_url" size="20" maxlength="200" value="<%=link_url%>"></td>
	<td width="65" height="18" bgcolor="#E8EEF4">排序</td>
    <td width="160" height="18" bgcolor="#E8EEF4"><input type='submit' name='Submit' value='<%=shuoming%> 提交'></td>
  </tr>
</table>
</form>

<%
End Sub %>


<%
 

Sub sitemanage()
cls=trim(Request.QueryString("cls"))
If cls="save" Then
first_money_modify=CInt(Request.Form("first_money"))'注册初始论坛分数
add_money_modify=CInt(Request.Form("add_money"))'发布文章分数
re_money_modify=CInt(Request.Form("re_money"))'回复文章分数
del_money_modify=CInt(Request.Form("del_money"))'删除文章分数
good_money_modify=CInt(Request.Form("good_money"))'文章被推荐分数
currentUserColor_modify=Trim(Request.Form("currentUserColor"))'当前用户颜色
boardManagerColor_modify=Trim(Request.Form("boardManagerColor"))'分版主颜色
superManagerColor_modify=Trim(Request.Form("superManagerColor"))'最高管理员颜色
indexnum_modify=CInt(Request.Form("indexnum"))'首页每页显示条数
bbsnum_modify=CInt(Request.Form("bbsnum"))'帖子每页显示条数
hothits_modify=CInt(Request.Form("hothits"))'阅读数达到多少红色显示
hotrehits_modify=CInt(Request.Form("hotrehits"))'回复数达到多少红色显示
posttime_modify=CInt(Request.Form("posttime"))'发帖防止灌水时间，单位：秒
isup_modify=CInt(Request.Form("isup"))'--------------------回复后是否升起
boardtr_modify=CInt(Request.Form("boardtr"))'----------------分类列表，几个分类自动换行
bbsname_modify=Trim(Request.Form("bbsname"))'网站名称
bbsurl_modify=Trim(Request.Form("bbsurl"))'网站bbsurl
bbs_about1_modify=Trim(Request.Form("bbs_about1"))'贴吧图片
bbs_about_modify=Trim(Request.Form("bbs_about"))'贴吧简介
copyright_modify=Trim(Request.Form("copyright"))'版权设置
bbsbanzhu_modify=Trim(Request.Form("bbsbanzhu"))'版主.多个版主请用|分割。
guestadd_modify=CInt(Request.Form("guestadd"))'游客是否可以发贴
guestrev_modify=CInt(Request.Form("guestrev"))'游客是否可以回复
iscallonline_modify=CInt(Request.Form("iscallonline"))'是否显示在线列表
zanghuaguolv_modify=Trim(Request.Form("zanghuaguolv"))'脏话过滤[标题和内容]
zanghuaguolvChar_modify=Trim(Request.Form("zanghuaguolvChar"))'脏话被替换成的字符
indeximg_modify=Trim(Request.Form("indeximg"))
isuserinfo_modify=CInt(Request.Form("isuserinfo"))'必须登陆才能察看用户信息．1是任何人可以看，0为登陆察看。
isFeeTopic_modify = Cint(Request.Form("isFeeTopic")) '是否允许发布 扣积分才能看的帖子 Add For V1.5
isReTopic_modify = Cint(Request.Form("isReTopic")) '是否允许发布 扣积分才能看的帖子 Add For V1.5
isCheck_modify  = Cint(Request.Form("isCheck")) '是否默认屏蔽或者打开帖子 Add For V1.5
isShowIpName_modify = Cint(Request.Form("isShowIpName")) '是否显示IP的详细地理位置 Add For V1.5
adFilter_modify = Request.Form("adFilter")
keepUsername_modify = Request.Form("keepUsername")
bbs_about_top_modify = Request.Form("bbs_about_top")
bbs_about_gaps_modify = " "&Trim(Request.Form("bbs_about_gaps1")) & "|@|" & Trim(Request.Form("bbs_about_gaps2")) & "|@|"& Trim(Request.Form("bbs_about_gaps3"))
sys_close_modify = Request.Form("sys_close1")&Trim(Request.Form("sys_close2"))
maxOnline_modify = Cint(Request.Form("maxOnline"))'最大在线人数 Add For V1.5
If Dreamsun_name<>"" And isadmin=9 And InStr(bbsbanzhu_modify,Dreamsun_name)=0 Then 
	response.write backmsg("您目前是最高管理员,出于安全考虑,请不要试图降低自己的权限!","")
End If

Set rs99 = Server.CreateObject("ADODB.Recordset")
sql99 ="SELECT * From config where id=1"
rs99.open sql99,Conn,3,3
'----分数设置---------------------------------
rs99("first_money")=first_money_modify'注册初始论坛分数
rs99("add_money")=add_money_modify'发布文章分数
rs99("re_money")=re_money_modify'回复文章分数
rs99("del_money")=del_money_modify'删除文章分数
rs99("good_money")=good_money_modify'文章被推荐分数
'----在线会员---------------------------------
rs99("currentUserColor")=currentUserColor_modify'当前用户颜色
rs99("boardManagerColor")=boardManagerColor_modify'分版主颜色
rs99("superManagerColor")=superManagerColor_modify'最高管理员颜色
'----显示设置---------------------------------
rs99("indexnum")=indexnum_modify'首页每页显示条数
rs99("bbsnum")=bbsnum_modify'帖子每页显示条数
rs99("hothits")=hothits_modify'阅读数达到多少红色显示
rs99("hotrehits")=hotrehits_modify'回复数达到多少红色显示
rs99("posttime")=posttime_modify'发帖防止灌水时间，单位：秒
rs99("isup")=isup_modify'--------------------回复后是否升起
rs99("boardtr")=boardtr_modify'----------------分类列表，几个分类自动换行
rs99("bbsname")=bbsname_modify'网站名称
rs99("bbs_about1")=bbs_about1_modify'贴吧广告2
rs99("bbsurl")=bbsurl_modify'贴吧bbsurl
'----关于和版权-------------------------------
rs99("bbs_about")=bbs_about_modify'贴吧广告1
rs99("copyright")=copyright_modify'版权设置
'----权限设置---------------------------------
rs99("bbsbanzhu")=bbsbanzhu_modify'版主.多个版主请用|分割。
rs99("guestadd")=guestadd_modify'游客是否可以发贴
rs99("guestrev")=guestrev_modify'游客是否可以回复
rs99("iscallonline")=iscallonline_modify'是否显示在线列表
rs99("zanghuaguolv")=zanghuaguolv_modify'脏话过滤[标题和内容]
rs99("zanghuaguolvChar")=zanghuaguolvChar_modify'脏话被替换成的字符
rs99("indeximg")=indeximg_modify
rs99("isuserinfo")=isuserinfo_modify'必须登陆才能察看用户信息．1是任何人可以看，0为登陆察看。
rs99("isFeeTopic")=isFeeTopic_modify ' 允许发需要积分才能察看的帖子 Add For V1.5 
rs99("isReTopic")=isReTopic_modify '是否允许禁止回复 Add For V1.5 
rs99("isCheck")=isCheck_modify '默认自动审核 Add For V1.5 
rs99("isShowIpName")=isShowIpName_modify '是否显示IP的详细地理位置 Add For V1.5 
rs99("adFilter")= adFilter_modify '广告词过滤 Add For V1.5 
rs99("keepUsername") = keepUsername_modify '系统保留的用户名 Add For V1.5 
rs99("bbs_about_top")= bbs_about_top_modify '顶部广告 Add For V1.5 
rs99("bbs_about_gaps")= bbs_about_gaps_modify '帖间广告 Add For V1.5 
rs99("sys_close")= sys_close_modify '系统关闭 Add For V1.5 
rs99("maxOnline")= maxOnline_modify '最大在线人数 Add For V1.5 
rs99.update
rs99.close
set rs99=Nothing
Application(webname&"Loaded")=""
response.write backmsg("恭喜，站点参数成功！","admin.asp?Action=sitemanage")
End If 
%>


<form name="form13" method='post' action='admin.asp?Action=sitemanage&cls=save'>
<table width="96%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
  <tr>
    <td width="106" height="18" align=center><div align="right">名称</div></td>
    <td width="796" height="18" align=center>参数</td>
  </tr>
<tr height="18">
    <td width="106"  bgcolor="#C5D5E4"><div align="right">站点名称</div></td>
    <td width="796" height="30" align=left bgcolor="#E8EEF4"><input name="bbsname" type="text" id="bbsname" size="30" maxlength="30" value="<%=bbsname%>">
      *网站的名称</td>
</tr>
<tr height="18">
    <td width="106"  bgcolor="#C5D5E4"><div align="right">站点地址</div></td>
    <td width="796" height="30" align=left bgcolor="#E8EEF4"><input name="bbsurl" type="text" id="bbsurl" size="30" maxlength="150" value="<%=bbsurl%>">
      *(不写http://)</td>
</tr>
<tr height="18">
    <td width="106"  bgcolor="#C5D5E4"><div align="right">总管理员</div></td>
    <td width="796" height="30" align=left bgcolor="#E8EEF4"><input name="bbsbanzhu" type="text" id="bbsbanzhu" size="30" maxlength="150" value="<%=bbsbanzhu%>">
	请用|分割，最后面不要输入|。←<a href="javascript:" onClick="document.form13.bbsbanzhu.value+='|'">点此插入|符号</a></td>
</tr>
<tr height="18">
    <td width="106"  bgcolor="#C5D5E4"><div align="right">积分数值</div></td>
    <td width="796" align=left bgcolor="#E8EEF4">注册后获得
      <input name="first_money" type="text" id="first_money" size="5" maxlength="5" value="<%=first_money%>">分，发贴可获得<input name="add_money" type="text" id="add_money" size="5" maxlength="5" value="<%=add_money%>">分， 回帖可获得<input name="re_money" type="text" id="re_money" size="5" maxlength="5" value="<%=re_money%>">分 
      <hr size="0" />
      
    帖子被删除后扣除<input name="del_money" type="text" id="del_money" size="5" maxlength="5" value="<%=del_money%>">分， 帖子被推荐为精华时加<input name="good_money" type="text" id="good_money" size="5" maxlength="5" value="<%=good_money%>">分</td>
</tr>
<tr height="18">
    <td width="106"  bgcolor="#C5D5E4"><div align="right">显示设置</div></td>
    <td width="796" align=left bgcolor="#E8EEF4">
    列表页每页显示
      <input name="indexnum" type="text" id="indexnum" size="5" maxlength="5" value="<%=indexnum%>">条帖子，
    详细页每页显示<input name="bbsnum" type="text" id="bbsnum" size="5" maxlength="5" value="<%=bbsnum%>">条回复， 
    帖子阅读数超过<input name="hothits" type="text" id="hothits" size="5" maxlength="5" value="<%=hothits%>">次时高亮显示
    <hr size="0" />
    回帖数超过<input name="hotrehits" type="text" id="hotrehits" size="5" maxlength="5" value="<%=hotrehits%>">次时高亮显示，
    防止刷新时间为<input name="posttime" type="text" id="posttime" size="5" maxlength="5" value="<%=posttime%>">秒，
    导航列表中每行显示<input name="boardtr" type="text" id="boardtr" size="5" maxlength="5" value="<%=boardtr%>">个分类    </td>
</tr>
<tr height="18">
    <td width="106"  bgcolor="#C5D5E4"><div align="right">用户颜色</div></td>
    <td width="796" align=left bgcolor="#E8EEF4">当前用户颜色：
      <input name="currentUserColor" type="text" id="currentUserColor" size="10" maxlength="10" value="<%=currentUserColor%>"> 分版主颜色：<input name="boardManagerColor" type="text" id="boardManagerColor" size="10" maxlength="10" value="<%=boardManagerColor%>"> 最高管理员颜色：<input name="superManagerColor" type="text" id="superManagerColor" size="10" maxlength="10" value="<%=superManagerColor%>"> </td>
</tr>
<tr>
<td  bgcolor="#C5D5E4">
	<div align="right">系统状态</div></td>
<td height="30" bgcolor="#E8EEF4">
    <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>
    <td  bgcolor="#C5D5E4">
<div align="right">帖子相关</div></td>
    <td bgcolor="#E8EEF4">
        <select name="guestadd">
            <option value="0" <% If guestadd<>1 Then response.write "selected"%>>不允许</option>
            <Option value="1" <% If guestadd=1 Then response.write "selected"%>>允许</option></select>游客发贴，
                <select name="guestrev">
            <option value="0" <% If guestrev<>1 Then response.write "selected"%>>不允许</option>
            <Option value="1" <% If guestrev=1 Then response.write "selected"%>>允许</option></select>游客回复，
                <select name="iscallonline">
            <option value="0" <% If iscallonline<>1 Then response.write "selected"%>>不显示</option>
            <Option value="1" <% If iscallonline=1 Then response.write "selected"%>>显示</option></select>在线列表。<hr size="0">
                <select name="isuserinfo">
            <option value="0" <% If isuserinfo<>1 Then response.write "selected"%>>登陆后可查看</option>
            <Option value="1" <% If isuserinfo=1 Then response.write "selected"%>>游客可查看</option></select>用户信息，
                回帖后<select name="isup">
            <option value="0" <% If isup<>1 Then response.write "selected"%>>不升起该帖子</option>
            <Option value="1" <% If isup=1 Then response.write "selected"%>>该帖升起</option>
        </select>，
        
        <select name="isCheck">
            <option value="0" <% If Cstr(isCheck)="0" Then response.write "selected"%>>关闭</option>
            <option value="1" <% If Cstr(isCheck)="1" Then response.write "selected"%>>启用</option>
        </select>自动审核帖子。    </td>
</tr>
<tr height="18">
    <td width="106" height="119"  bgcolor="#C5D5E4"><div align="right">系统相关</div></td>
    <td width="796" align=left bgcolor="#E8EEF4"><table width="444" border="0" cellpadding="2" cellspacing="2">
        <tr>
          <td height="28"><select name="isFeeTopic">
            <option value="0" <%If CStr(isFeeTopic)="0" then Response.Write(" selected")%>>允许普通会员发布</option>
            <option value="1" <%If CStr(isFeeTopic)="1" then Response.Write(" selected")%>>只允许分版主和管理员</option>
            <option value="2" <%If CStr(isFeeTopic)="2" then Response.Write(" selected")%>>只允许管理员发布</option>
          </select>
扣积分才能查看的帖子 </td>
          </tr>
        <tr>
          <td height="28"><select name="isReTopic">
            <option value="0" <%If CStr(isReTopic)="0" then Response.Write(" selected")%>>允许普通会员发布</option>
            <option value="1" <%If CStr(isReTopic)="1" then Response.Write(" selected")%>>不允许普通会员发布</option>
            <!--option value="2" <%If CStr(isReTopic)="2" then Response.Write(" selected")%>>允许管理员发布</option-->
          </select>
禁止回复的帖子。</td>
          </tr>
        <tr>
          <td height="28"><select name="isShowIpName">
            <option value="0" <%If CStr(isShowIpName)="0" then Response.Write(" selected")%>>关闭</option>
            <option value="1" <%If CStr(isShowIpName)="1" then Response.Write(" selected")%>>使用91Webs数据</option>
            <option value="2" <%If CStr(isShowIpName)="2" then Response.Write(" selected")%>>使用纯真数据库</option>
          </select>
显示IP地址的详细位置。</td>
          </tr>
      </table>	  </td>
</tr>
<tr height="18">
    <td width="106"  bgcolor="#C5D5E4"><div align="right">版权信息</div></td>
    <td width="796" align=left bgcolor="#E8EEF4"><textarea rows="5" name="copyright" cols="45"><%=copyright%></textarea>*120字以内，支持Html</td>
</tr>

<tr height="18">
    <td width="106"  bgcolor="#C5D5E4"><div align="right">保留用户名</div></td>
    <td width="796" align=left bgcolor="#E8EEF4"><textarea rows="5" name="keepUsername" cols="45"><%=keepUsername%></textarea>请用|分割，最后不要输入|。←<a href="javascript:" onClick="document.form13.keepUsername.value+='|'">点此插入|</a></td>
</tr>
<tr height="18">
    <td width="106"  bgcolor="#C5D5E4"><div align="right">防御广告帖</div></td>
    <td width="796" align=left bgcolor="#E8EEF4"><textarea rows="5" name="adFilter" cols="45"><%=adFilter%></textarea>请用|分割，最后不要输入|。←<a href="javascript:" onClick="document.form13.adFilter.value+='|'">点此插入|</a></td>
</tr>
<tr height="18">
    <td width="106"  bgcolor="#C5D5E4"><div align="right">脏话过滤</div></td>
    <td width="796" align=left bgcolor="#E8EEF4"><textarea rows="5" name="zanghuaguolv" cols="45"><%=zanghuaguolv%></textarea>请用|分割，最后不要输入|。←<a href="javascript:" onClick="document.form13.zanghuaguolv.value+='|'">点此插入|</a></td>
</tr>
<tr height="18">
    <td width="106"  bgcolor="#C5D5E4"><div align="right">脏话替换</div></td>
    <td width="796" align=left bgcolor="#E8EEF4"><input name="zanghuaguolvChar" type="text" id="zanghuaguolvChar" size="30" maxlength="30" value="<%=zanghuaguolvChar%>"></td>
</tr>
<tr height="18">
    <td colspan=2  align=center bgcolor="#C5D5E4"><input type='button' name='Submit' onclick="form13.submit();" value='修改提交'> <input type="reset"  value="取消修改"></td>
</tr>
</table>
</form>
<%
End Sub 
%>

<%
Sub PlugIn()
%>
<table width="96%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
  <tr>
	<td height="30" align="center" colspan="7"><B>插件管理器</B></td>
  </tr>
	<tr>
		<td height="18" align=center bgcolor="#E8EEF4"><B>ID</B></td>
		<td height="18" align=center bgcolor="#E8EEF4"><B>名称</B></td>
		<td height="18" align=center bgcolor="#E8EEF4"><B>版本</B></td>
		<td height="18" align=center bgcolor="#E8EEF4"><B>开发者</B></td>
		<td height="18" align=center bgcolor="#E8EEF4"><B>机构</B></td>
		<td height="18" align=center bgcolor="#E8EEF4"><B>简介</B></td>
		<td height="18" align=center bgcolor="#E8EEF4"><B>管理</B></td>
	</tr>
<%
		Set fso=Server.CreateObject("Scripting.FileSystemObject")
		Set objFolder=fso.GetFolder(Server.MapPath("./plug-in"))
		Set objSubFolders=objFolder.Subfolders
		for each objSubFolder in objSubFolders 
			If fso.FileExists(objSubFolder+"\config.xml") Then 
				set xmldoc=Server.createObject("Microsoft.XMLDOM")
				xmldoc.load(objSubFolder+"\config.xml")
				set nodes=xmldoc.selectNodes("//setting")
				Response.Write("<tr class='zd_td'>")
				Response.Write("<td>"+nodes(0).childNodes(0).text+"</td>")
				Response.Write("<td>"+nodes(0).childNodes(1).text+"</td>")
				Response.Write("<td>"+nodes(0).childNodes(2).text+"</td>")
				Response.Write("<td>"+nodes(0).childNodes(3).text+"</td>")
				Response.Write("<td>"+nodes(0).childNodes(4).text+"</td>")
				Response.Write("<td>"+nodes(0).childNodes(5).text+"</td>")
				Response.Write("<td><a href='plug-in/"+objSubFolder.Name+"/"+nodes(0).childNodes(6).text+"' target='_blank'>管理</a></td>")
				Response.Write("</tr>")
				Response.write(VbCrLf)
			End If 
		next 
		Set objFolder=nothing
		Set objSubFolders=nothing
		Set fso=nothing

%>
	<tr>
	<td height="１０" align="center" colspan="7">　<font color=red>＊该功能需要FSO支持，官方会不定期推出新插件</font></td>
	</tr>

</table>
<%
End Sub 
'--------------------------数据库操作，备份还原压缩功能
Sub dbak()
%>
<table width="96%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
  <tr>
    <td height="30" align="left" colspan=2>

<%
db=Dreamsundb
'获取数据库路径后，开始取出数据库的名字
AccessPath0 = split(db,"/")
AccessPath00 = AccessPath0(ubound(AccessPath0))
'总路径中替换掉名字，就是文件夹
AccessPath=Replace(db,"/"&AccessPath00,"")
cz=trim(Request.QueryString("cz"))
IF cz="sqlquery" Then
	Dim SQL_Query,abc
	SQL_Query=Request.Form("SQL_Query")
	Conn.Execute SQL_Query,abc
	'SQLQueryNums=SQLQueryNums+1
	Response.Write("<a href=""?Action=dbak"">SQL语句执行成功，请点击返回</a>")
ElseIF cz="Compact" Then
	Dim FSO,Engine
	Set FSO=Server.CreateObject("Scripting.FileSystemObject")
	IF FSO.FileExists(Server.Mappath(db)) Then
		Response.Write "压缩数据库开始，网站暂停一切用户的前台操作......<br>"
		Conn.Close
		Set Conn=Nothing

		Set Engine = CreateObject("JRO.JetEngine")
		Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath(db), "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath(db & ".temp")
		FSO.CopyFile Server.Mappath(db & ".temp"),Server.Mappath(db)
		FSO.DeleteFile(Server.Mappath(db & ".temp"))
		Set FSO = Nothing
		Set Engine = Nothing
		Response.write "压缩数据库完成..."
		Response.Write "<br>网站恢复正常访问..."
		Response.Write("<br><a href='?Action=dbak'>请点击返回</a>")
	End IF
ElseIF cz="Backup" Then
	Response.Write "备份数据库开始，网站暂停一切用户的前台操作......<br>"
	Conn.Close
	Set Conn=Nothing
	CopyFiles Server.Mappath(db),Server.Mappath(db & "_" & DateToStr(Now(),"YmdHIS") &".bak")
	Response.write "<br>备份完成..."
	Response.write "<br>网站恢复正常访问..."
	Response.Write("<br><a href='?Action=dbak'>请点击返回</a>")

ElseIF cz="Restore" Then
	Response.Write "还原数据库开始，网站暂停一切用户的前台操作......<br>"
	Conn.Close
	Set Conn=Nothing
	IF Request.QueryString("filename")=Empty Then
		Response.Write("<b>要还原的文件名不能为空</b>")
	Else
        Response.write "备份原数据库.<br>"
        CopyFiles Server.Mappath(db),Server.Mappath(db & ".TEMP")
        if DeleteFiles(Server.Mappath(db))=1 then response.write ("<br>原数据库删除成功")
        Response.write "<br>更新数据库."
        CopyFiles Server.Mappath(AccessPath)&"/"&Request.QueryString("filename"),Server.Mappath(db)
        if DeleteFiles(Server.MapPath(AccessPath&"/"&Request.QueryString("filename")))=1 then response.write ("<br>Bak备份删除成功")
		if DeleteFiles(Server.Mappath(db & ".TEMP"))=1 then response.write ("<br>Temp备份删除成功")

		Response.write "<br>还原完成..."
	end if

	Response.write "<br>网站恢复正常访问..."
	Response.Write("<br><a href='?Action=dbak'>请点击返回</a>")   

ElseIF cz="DeleFile" Then
	IF Request.QueryString("filename")=Empty Then
		Response.Write("<a href='?Action=dbak'>要删除的文件名不能为空，请点击返回</a>")
	Else
		IF DeleteFiles(Server.MapPath(AccessPath&"/"&Request.QueryString("filename")))=1 Then
			response.write backmsg("文件删除成功，请点击返回","?Action=dbak")
		Else
			response.write backmsg("文件删除失败，请点击返回","?Action=dbak")
		End IF
	End IF
Else
	Response.Write("<div align='center'><b>备份文件列表</b></div>")
	Dim DataFolder,DataFileList,DataFile,DataFileName
	Set FSO=Server.CreateObject("Scripting.FileSystemObject")
	Set DataFolder=FSO.GetFolder(Server.MapPath(AccessPath))
	Set DataFileList=DataFolder.Files
	For Each DataFile IN DataFileList
		IF Ubound(Split(DataFile,"."))>=2 and (Right(DataFile,3)="bak") Then
			DataFileName=DataFile.Name
			Response.Write("&nbsp;&nbsp;<font color='#FF0000'>"&DataFileName&"</font>&nbsp;&nbsp;|&nbsp;&nbsp;<b><a href='"&AccessPath&"/"&DataFileName&"'>下载此文件</a></b>&nbsp;&nbsp;|&nbsp;&nbsp;<b><a href='?Action=dbak&cz=DeleFile&filename="&DataFileName&"'>删除</a></b>此文件&nbsp;&nbsp;|&nbsp;&nbsp;从此文件<b><a href='?Action=dbak&cz=Restore&filename="&DataFileName&"' >还原</a></b>数据<br>")
		End IF
	Next
End If
%>
</td>
  </tr>
</table>

<%
End Sub 
%>