📄 admin.asp
字号:
rs.open sql,conn,1,3
if rs.eof or rs.bof then
Call GoBack("","没有此用户!")
else
rs("Name")=AdminName
If PassWord <> "" Then Rs("Password")=MD5(Password)
Rs.update
End if
rs.close
set rs=nothing
Call Suc("","管理员修改成功!","Admin.Asp")
end if
%>
<%
if Request("action")="editadmin1" then
id=Request("id")
if ID="" or not isNumeric(ID) then
Call GoBack("","错误参数!")
end if
set rs=Conn.Execute("Select Name,UserName from YX_Admin where ID="&ID)
if rs.eof or rs.bof then
Call GoBack("","没有此管理员!")
else
%>
<form action="?action=editadmin" method=post>
<table cellpadding=6 cellspacing=1 border=0 width=95% bgcolor="#FFFFFF" align="center">
<tr>
<td bgcolor=#e7e7e7 valign=middle colspan=2 align=center>
<font color="#800000"><b>管 理 员 编 辑</b></font></td></tr>
<tr>
<td bgcolor=#d7d7d7 width=40%><font color="#000077">后台登陆名称 </font></td>
<td bgcolor=#d7d7d7 width=60%>
<INPUT TYPE="hidden" name="ID" value="<%=ID%>">
<input name="AdminName" size="30" value="<%=rs(0)%>"></td>
</tr><tr>
<td bgcolor=#d7d7d7><font color="#000077">后台登陆密码</font></td>
<td bgcolor=#d7d7d7>
<input type=password name="Password" size="30"> <font color="#999999">如不更改请留空!</font></td>
</tr>
<tr>
<td bgcolor=#d7d7d7><font color="#000077">前台用户名称</font></td>
<td bgcolor=#d7d7d7>
<B><%=rs(1)%></B></td>
</tr>
<tr>
<td bgcolor=#e7e7e7 valign=middle colspan=2 align=center>
<input type="submit" value="编 辑" name="B1"></td></tr>
</table>
</form>
<%
end if
end if
set rs=nothing
%>
<%Dim Action,bbsID
username=AdminName
Server.ScriptTimeOut=999999
Action=Request.QueryString("Action")
Select Case Action
Case "Submit"
Submit()
Case "SeeRecycle"
SeeRecycle()
Case "DelRecycle"
DelRecycle()
Case "TBInfo"
TBInfo()
Case "Giveback"
Giveback()
Case "DelAll"
DelAll()
Case "Recycle"
Recycle()
End Select
AdminFooter()
Set YxBBs=Nothing
Sub Recycle()
Response.Write"<form name='yimxu' style='margin:0' method='POST' action='?Action=Submit'>"
%>
<table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#FFFFFF">
<tbody>
<tr bgcolor="#CCCCCC"><td height="25" colspan="4"><b><font color="#FFFFFF">回收站</font></b></td>
</tr>
<tr bgcolor="#DEDEDE">
<td height="25" colspan="4"><table width="100%%" border="0" cellspacing="5" cellpadding="0">
<tr>
<td width="84%">【<a href="?Action=Recycle"><font color="red">列出全部主题</font></a>】<%=TBList(0)%> </td>
<td width="16%">【<a onclick=checkclick('您确定要清空回收站的全部帖子吗?') href="?Action=DelAll"><img src="../images/del.gif" width="18" height="18" border="0" align="absmiddle">清空回收站</a>】</td>
</tr>
</table></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="5%" height="25" align="center"><b>选择</b></td>
<td width="55%" align="center"><b>帖子</b></td>
<td width="18%" align="center"><b>作者</b></td>
<td width="22%" align="center"><b>最后时间</b></td>
</tr>
<%
Dim intPageNow,arr_Rs,i,Pages,Conut,page,strPageInfo
Dim Temp,BbsID
intPageNow = Request.QueryString("page")
Set Pages = New Cls_PageView
Pages.strTableName = "[YX_Topic]"
Pages.strPageUrl = "?Action=Recycle"
Pages.strFieldsList = "TopicID,SqlTableID,Face,Caption,Name,LastTime,BoardID"
Pages.strCondiction = "IsDel=True"
Pages.strOrderList = "TopicID desc"
Pages.strPrimaryKey = "TopicID"
Pages.intPageSize = 25
Pages.intPageNow = intPageNow
Pages.strCookiesName = "Recycle"&YxBBs.TB'客户端记录总数
Pages.Reloadtime=3'每三分钟更新Cookies
Pages.strPageVar = "page"
Pages.InitClass
Arr_Rs = Pages.arrRecordInfo
strPageInfo = Pages.strPageInfo
Set Pages = nothing
If IsArray(Arr_Rs) Then
For i = 0 to UBound(Arr_Rs, 2)
Set Rs=YxBBs.Execute("Select BbsID From[YX_Bbs"&Arr_Rs(1,i)&"] Where TopicID="&Arr_Rs(0,i)&" and BoardID="&Arr_Rs(6,i))
If Not Rs.Eof Then BbsID=Rs(0)
Rs.Close
Response.Write"<tr bgcolor=""#DEDEDE""><td><input type='checkbox' name='Topic' value='"&Arr_Rs(0,i)&"|"&Arr_Rs(6,i)&"|"&Arr_Rs(1,i)&"'></td>"&_
"<td onmouseover=javascript:this.bgColor='#eeeeee' onmouseout=javascript:this.bgColor=''> "&_
"<img src='../images/face/"&Arr_Rs(2,i)&".gIf' align='absmiddle'><a href=?Action=SeeRecycle&BbsID="&BbsID&">"&YxBBs.Fun.StrLeft(Arr_Rs(3,i),25)&"</a></td>"&_
"<td align=center><a target=_blank href='Profile.Asp?name="&Arr_Rs(4,i)&"' title='查看 "&Arr_Rs(4,i)&" 的资料'>"&Arr_Rs(4,i)&"</a></td>"&_
"<td align=center>"&Arr_Rs(5,i)&"</td></tr>"
Next
Else
Response.Write"<tr><td height=25 colspan='4'>没有发现被删除的主题</td></tr>"
End If
%>
<tr bgcolor="#CCCCCC"><td colspan="4"><input type=checkbox name=chkall value=on onClick="CheckAll(this.form)"> 全选
<input type="submit" value="删除所选" name="Go"><input type="submit" class="submit" value="还原所选" name="Go"></td>
</tr></form>
<tr bgcolor="#CCCCCC"><td height=20 colspan="4"><%=strPageInfo%></td>
</tr></tbody></table>
<%
End Sub
Sub TBInfo()
Response.Write"<form name='yimxu' style='margin:0' method='POST' action='?Action=Submit'>"
%>
<table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#FFFFFF">
<tbody>
<tr bgcolor="#CCCCCC"><td height="25" colspan="4"><b><font color="#FFFFFF">回收站</font></b></td>
</tr>
<tr bgcolor="#DEDEDE">
<td height="25" colspan="4">
<table width="100%%" border="0" cellspacing="5" cellpadding="0">
<tr>
<td width="84%">【<a href="?Action=Recycle">列出全部主题</a>】<%=TBList(YxBBs.TB)%></td>
<td width="16%">【<a onclick=checkclick('您确定要清空回收站的全部帖子吗?') href="?Action=DelAll"><img src="../images/del.gif" width="18" height="18" border="0" align="absmiddle">清空回收站</a>】</td>
</tr>
</table> </tr>
<tr bgcolor="#CCCCCC">
<td width="5%" height="25" align="center"><b>选择</b></td>
<td width="55%" align="center"><b>帖子</b></td>
<td width="18%" align="center"><b>作者</b></td>
<td width="22%" align="center"><b>最后时间</b></td>
</tr>
<%
Dim intPageNow,arr_Rs,i,Pages,Conut,page,strPageInfo
Dim Temp
intPageNow = Request.QueryString("page")
Set Pages = New Cls_PageView
Pages.strTableName = "[YX_BBS"&YxBBs.TB&"]"
Pages.strPageUrl = "?TB="&YxBBs.TB
Pages.strFieldsList = "BbsID,TopicID,Face,Caption,Name,LastTime,ReplyTopicID,BoardID"
Pages.strCondiction = "IsDel=True"
Pages.strOrderList = "BbsID desc"
Pages.strPrimaryKey = "BbsID"
Pages.intPageSize = 25
Pages.intPageNow = intPageNow
Pages.strCookiesName = "Recycle"&YxBBs.TB'客户端记录总数
Pages.Reloadtime=3'每三分钟更新Cookies
Pages.strPageVar = "page"
Pages.InitClass
Arr_Rs = Pages.arrRecordInfo
strPageInfo = Pages.strPageInfo
Set Pages = nothing
If IsArray(Arr_Rs) Then
For i = 0 to UBound(Arr_Rs, 2)
Response.Write"<tr bgcolor=""#DEDEDE""><td><input type='checkbox' "
IF Arr_Rs(1,i)=0 Then
Response.Write "name='Reply' value='"&Arr_Rs(0,i)&"|"&Arr_Rs(6,i)&"|"&Arr_Rs(7,i)&"|"&YxBBs.TB&"'"
Else
Response.Write "name='Topic' value='"&Arr_Rs(1,i)&"|"&Arr_Rs(7,i)&"|"&YxBBs.TB&"'"
End If
Response.Write"></td>"&_
"<td onmouseover=javascript:this.bgColor='#eeeeee' onmouseout=javascript:this.bgColor=''> "&_
"<img src='../images/face/"&Arr_Rs(2,i)&".gIf' align='absmiddle'><a href=?Action=SeeRecycle&BbsID="&Arr_Rs(0,i)&">"&YxBBs.Fun.StrLeft(Arr_Rs(3,i),25)&"</a></td>"&_
"<td align=center><a target=_blank href='Profile.Asp?name="&Arr_Rs(4,i)&"' title='查看 "&Arr_Rs(4,i)&" 的资料'>"&Arr_Rs(4,i)&"</a></td>"&_
"<td align=center>"&Arr_Rs(5,i)&"</td></tr>"
Next
Else
Response.Write"<tr><td height=25 colspan='4'>这个数据表中没有发现被删除的帖子</td></tr>"
End If
%>
<tr bgcolor="#CCCCCC"><td colspan="4"><input type=checkbox name=chkall value=on onClick="CheckAll(this.form)"> 全选
<input type="submit" value="删除所选" name="Go">
<input type="submit" class="submit" value="还原所选" name="Go"></td>
</tr></form>
<tr bgcolor="#CCCCCC"><td height=20 colspan="4"><%=strPageInfo%></td>
</tr></tbody></table>
<%
End Sub
Sub SeeRecycle()
Dim BbsID,YxBBs_ubb,EssayType,Sql
BbsID=Trim(Request.QueryString("BbsID"))
Set Rs=YxBBs.execute("select BbsID,Caption,Content,Name,LastTime,BoardID,TopicID,ReplyTopicID,UbbString,Face from [YX_Bbs"&YxBBs.TB&"] where BbsID="&BbsID)
IF Rs.eof then
Call GoBack("","该帖不存在或者已经被永久删除")
Exit Sub
End if
If Rs(7)=0 Then EssayType="主题帖:" Else EssayType="回复帖:"
Set YxBBs_ubb=New YxBBsubb_Cls
YxBBs_ubb.UbbString=Rs(8)
%>
<table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#FFFFFF">
<tbody>
<tr bgcolor="#CCCCCC"><td height="25" colspan="2" ><b><font color="#FFFFFF">回收站 查看帖子</font></b></td>
</tr>
<tr bgcolor="#D7DAEA">
<td height="25"><%=EssayType&YxBBs.Fun.HtmlCode(Rs(1))%></td>
<td height="25" align="center">【<a href="?Action=DelRecycle&BbsID=<%=Rs(0)%>&TopicID=<%=Rs(6)%>&TB=<%=YxBBs.TB%>"><img src="../images/del.gif" width="18" height="18" border="0" align="absmiddle">永久删除</a>】 【<a href="?Action=Giveback&BbsID=<%=Rs(0)%>&TB=<%=YxBBs.TB%>&BoardID=<%=Rs(5)%>"><img src="../images/mail.gif" width="16" height="16" border="0" align="absmiddle">还原帖子</a>】</td>
</tr>
<tr bgcolor="#DEDEDE"><td colspan="2"><blockquote><span style='line-height:150%;table-layout:fixed;word-wrap:break-word;word-break:break-all; width:100%'><br>
<img src='../images/face/<%=Rs(9)%>.gIf' align='absmiddle'>
<%If Rs(7)=0 Then Response.Write "<b>"&YxBBs.Fun.HtmlCode(Rs(1))&"</b>"%>
<br><%=YxBBs_ubb.UBB(Rs(2),1)%></Span></blockquote></td></tr>
<tr bgcolor="#DEDEDE"><td colspan="2"><font color="#224021"> 帖子作者:<%=Rs(3)%> 更新时间:<%=Rs(4)%></font></td></tr>
<tr bgcolor="#CCCCCC"><td height="25" colspan="2" align="center"><a href=javascript:history.go(-1)>【返回】</a></td>
</tr>
</tbody>
</table>
<%Set YxBBs_ubb=Nothing
Rs.Close
End Sub
Sub DelRecycle()
Dim BbsID,TopicID
BbsID=Request.QueryString("BbsID")
TopicID=Request.QueryString("TopicID")
If TopicID=0 then
YxBBs.Execute("Delete From [YX_Bbs"&YxBBs.TB&"] where IsDel=True And BbsID="&BbsID)
Call Suc("","成功删除了这个回复帖!","?Action=Recycle")
Else
YxBBs.Execute("Delete From [YX_Topic] where IsDel=True And TopicID="&TopicID)
YxBBs.Execute("Delete From [YX_TopicVote] where TopicID="&TopicID)
YxBBs.Execute("Delete From [YX_TopicVoteUser] where TopicID="&TopicID)
YxBBs.Execute("Delete From [YX_Bbs"&YxBBs.TB&"] where IsDel=True And (BbsID="&BbsID&" or ReplyTopicID="&TopicID&")")
Call Suc("","成功删除这个主题(包括其回复帖)!","?Action=Recycle")
End if
End Sub
Sub DelAll()
Dim AllTable,I
AllTable=Split(YxBBs.BBSTable(0),",")
For i=0 To uBound(AllTable)
YxBBs.Execute("Delete From [YX_Bbs"&AllTable(i)&"] where IsDel=True")
Next
YxBBs.Execute("Delete From [YX_Topic] where IsDel=True")
YxBBs.execute("delete * from [YX_TopicVote] where not exists (select name from [YX_Topic] where [YX_TopicVote].TopicID=[YX_Topic].TopicId)")
YxBBs.execute("delete * from [YX_TopicVoteUser] where not exists (select name from [YX_Topic] where [YX_TopicVoteUser].TopicID=[YX_Topic].TopicId)")
Call Suc("","成功清空了回收站!","?Action=Recycle")
End Sub
Sub Giveback
Dim BbsID,TopicID,ReplyTopicID,BoardID,Temp
BbsID=Request.QueryString("BbsID")
Set Rs=YxBBs.Execute("Select TopicID,ReplyTopicID,BoardID,IsDel From[YX_Bbs"&YxBBs.TB&"] where BbsID="&BbsID)
IF Rs.eof Then
Call GoBack("","该帖不存在或者已经被永久删除"):Exit Sub
ElseIf Rs(3)=False Then
Call Suc("","该帖已经恢复了","?Action=Recycle"):Exit Sub
End IF
If Rs(0)=0 And Rs(1)<>0 then
YxBBs.Execute("Update [YX_Config] Set AllEssayNum=AllEssayNum+1")
YxBBs.Execute("Update [YX_Board] Set EssayNum=EssayNum+1 Where BoardID="&Rs(2)&" And ParentID<>0")
YxBBs.Execute("Update [YX_Topic] Set ReplyNum=ReplyNum+1,IsDel=False where TopicID="&Rs(1))
YxBBs.Execute("Update [YX_Bbs"&YxBBs.TB&"] Set IsDel=False where TopicID="&Rs(1)&" or BbsID="&BbsID)
Else
Temp=YxBBs.Execute("Select Count(BbsID) From[YX_bbs"&YxBBs.TB&"] where ReplyTopicID="&Rs(0)&" And BoardID="&rs(2))(0)
If Isnull(Temp) Then Temp=0
YxBBs.Execute("Update [YX_Config] Set TopicNum=TopicNum+1,AllEssayNum=AllEssayNum+"&Temp+1&"")
YxBBs.Execute("Update [YX_Board] Set EssayNum=EssayNum+"&Temp+1&",TopicNum=TopicNum+1 Where BoardID="&Rs(2)&" And ParentID<>0")
YxBBs.Execute("Update [YX_Topic] Set ReplyNum="&Temp&",IsDel=False where TopicID="&Rs(0))
YxBBs.Execute("update [YX_Bbs"&YxBBs.TB&"] Set IsDel=False where BbsID="&BbsID&" or ReplyTopicID="&Rs(0))
End if
Rs.Close
Call Suc("","成功的恢复帖子","?Action=Recycle")
End Sub
Sub Submit()
Dim Topic,Reply,Go,Temp,i
Topic=Request.form("Topic")
Reply=Request.form("Reply")
IF Topic="" And Reply="" Then Call GoBack("","请先选择项目。"):Exit Sub
Topic=split(Topic,",")
Reply=split(Reply,",")
Go=Request.form("Go")
If Go="删除所选" then
For i=0 to ubound(Topic)
Temp=split(Topic(I),"|")
YxBBs.Execute("Delete From [YX_Bbs"&Temp(2)&"] where TopicID="&Temp(0)&" or ReplyTopicID="&Temp(0))
YxBBs.Execute("Delete From [YX_Topic] where TopicID="&Temp(0))
YxBBs.Execute("Delete From [YX_TopicVote] where TopicID="&Temp(0))
YxBBs.Execute("Delete From [YX_TopicVoteUser] where TopicID="&Temp(0))
Next
For i=0 to ubound(Reply)
Temp=split(Reply(I),"|")
YxBBs.Execute("Delete From [YX_Bbs"&Temp(3)&"] where BbsID="&Temp(0)&" And IsDel=True")
Next
Call Suc("","成功的删除所选的帖子","?Action=Recycle")
ElseIF Go="还原所选" then
Dim TempNum
For i=0 to ubound(Topic)
Temp=split(Topic(I),"|")
TempNum=YxBBs.Execute("Select Count(BbsID) From[YX_bbs"&Temp(2)&"] where ReplyTopicID="&Temp(0)&" And BoardID="&Temp(1))(0)
If Isnull(TempNum) Then TempNum=0
YxBBs.Execute("Update [YX_Config] Set TopicNum=TopicNum+1,AllEssayNum=AllEssayNum+"&TempNum+1&"")
YxBBs.Execute("Update [YX_Board] Set EssayNum=EssayNum+"&TempNum+1&",TopicNum=TopicNum+1 Where BoardID="&Temp(1)&" And ParentID<>0")
YxBBs.Execute("Update [YX_Topic] Set ReplyNum="&TempNum&",IsDel=False where TopicID="&Temp(0))
YxBBs.Execute("update [YX_Bbs"&Temp(2)&"] Set IsDel=False where TopicID="&Temp(0)&" or ReplyTopicID="&Temp(0))
Next
For i=0 to ubound(Reply)
Temp=split(Reply(I),"|")
Set Rs=YxBBs.Execute("Select Top 1 BbsID From[YX_Bbs"&Temp(3)&"] where BbsID="&Temp(0)&" And IsDel=True")
If Not Rs.Eof Then
YxBBs.Execute("Update [YX_Config] Set AllEssayNum=AllEssayNum+1")
YxBBs.Execute("Update [YX_Board] Set EssayNum=EssayNum+1 Where BoardID="&Temp(2)&" And ParentID<>0")
YxBBs.Execute("Update [YX_Topic] Set ReplyNum=ReplyNum+1,IsDel=False where TopicID="&Temp(1))
YxBBs.Execute("Update [YX_Bbs"&Temp(3)&"] Set IsDel=False where TopicID="&Temp(1)&" or BbsID="&Temp(0))
End If
Rs.Close
Next
Call Suc("","成功的还原所选的帖子","?Action=Recycle")
End If
End SUB
Function TBList(Num)
Dim AllTable,I,Temp
AllTable=Split(YxBBs.BBSTable(0),",")
For i=0 To uBound(AllTable)
If Int(AllTable(i))=Int(Num) Then
Temp=Temp&"【<font Color=red>数据表"&AllTable(i)&"</font>】"
Else
Temp=Temp&"【<a href='?Action=TBInfo&TB="&AllTable(i)&"'>数据表"&AllTable(i)&"</a>】"
End IF
next
TBList=Temp
End Function%>
<script language="JavaScript">
<!--
function CheckAll(form) {
for (var i=0;i<form.elements.length;i++) {
var e = form.elements[i];
if (e.name != 'chkall'){
e.checked = form.chkall.checked;
}
}
}
//-->
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -