📄 admin.asp
字号:
YxBBs.InLog "将主题《"&Rs(2)&"》删除,主题ID:"&ID,Rs(1),0
Else
YxBBs.Error("该帖子不存在或已经删除")
End IF
Caption="<meta http-equiv=refresh content=3;url=List.Asp?BoardID="&YxBBs.BoardID&">成功删除主题帖子!"
End if
Rs.Close
Call Show()
Case"删除回复"
Call cheak()
If Cint(YxBBs.ClassSetting(14))=0 Then YxBBs.Error("您没有删除回复的权限!")
GoToUrl=False
Dim BbsID,Temp
BbsID=YxBBs.CheckNum(Request.QueryString("BbsID"))
Set Rs=YxBBs.execute("Select IsDel,Name,Caption From [YX_bbs"&YxBBs.TB&"] where ReplyTopicID="&ID&" And BbsID="&BbsID&" And BoardID="&YxBBs.BoardID&"")
IF Rs.eof Then
YxBBs.Error("该帖子不存在或已经删除")
Else
IF Not Rs(0) Then
YxBBs.execute("update [YX_bbs"&YxBBs.TB&"] set IsDel=True where ReplyTopicID="&ID&" And BbsID="&BbsID&" And BoardID="&YxBBs.BoardID&"")
YxBBs.execute("update [YX_Config] Set AllEssayNum=AllEssayNum-1")
YxBBs.execute("update [YX_Board] Set EssayNum=EssayNum-1 where BoardID="&YxBBs.BoardID&"")
YxBBs.execute("update [YX_Topic] set ReplyNum=ReplyNum-1 where TopicID="&ID&" And BoardID="&YxBBs.BoardID&"")
If YxBBs.BoardDepth>1 Then
YxBBs.Execute("Update [YX_Board] set TopicNum=TopicNum-1,,EssayNum=EssayNum-1 where BoardID In ("&YxBBs.BoardParentStr&") And Depth>0")
End If
BoardLastRaply()
YxBBs.InLog "删除回复《"&Rs(2)&"》,主题ID:"&ID,Rs(1),0
Else
YxBBs.Error("该帖子不存在或已经删除")
End IF
Caption="成功删除回复帖子!"
End if
Rs.Close
Call Show()
Case"移动"
Call cheak()
If Cint(YxBBs.ClassSetting(15))=0 Then YxBBs.Error("您没有移动主题的权限!")
GoToUrl=False
Caption="移动帖子"
Content="<form method=POST name='move' action='?action=move&TB="&YxBBs.TB&"&ID="&ID&"&BoardID="&YxBBs.BoardID&"'><p style='margin: 15'>请选择帖子要移动到的论坛:"&GetBoardList()&" <input type=submit value=' 移 动 '> <br><br>是否用留言通知帖子的作者:<input name='issms' onclick='if(sms.disabled==true){sms.disabled=false;sms.value=""通知:您的帖子被管理员("&YxBBs.MyName&")移动了!""}else{sms.disabled=true;sms.value="""";}' type='checkbox' value='yes'> <input name='sms' size='50' type='text' value='' disabled='true'></p></form>"
YxBBs.ShowTable Caption,"<tr><td height=""100"">"&Content&"</td></tr>"
Case"move"
Call cheak()
If Cint(YxBBs.ClassSetting(15))=0 Then YxBBs.Error("您没有移动主题的权限!")
Dim IsSms,Sms,TmpBoardID
GoToUrl=False
IsSms=YxBBs.Fun.GetStr("issms")
Sms=YxBBs.Fun.GetStr("sms")
TmpBoardID=YxBBs.Checknum(Request.form("BoardID"))
Set Rs=YxBBs.Execute("Select BoardID,Name,Caption From[YX_Topic] where TopicID="&ID&" and BoardID="&YxBBs.BoardID&"")
YxBBs.execute("update [YX_Topic] Set BoardID="&TmpBoardID&" where TopicID="&ID&"")
YxBBs.execute("update [YX_bbs"&YxBBs.TB&"] Set BoardID="&TmpBoardID&" where TopicId="&ID&" or ReplyTopicid="&ID&"")
YxBBs.InLog "将主题《"&Rs(2)&"》从ID为"&Rs(0)&"的版面移动到版面ID为"&TmpBoardID&"的版面,主题ID:"&ID,Rs(1),0
If IsSms="yes" Then
Sms=Sms&vbcrlf&"主题:"&Rs(2)&",被移动到版面ID为"&TmpBoardID&"的版块."
YxBBs.Execute("insert into [YX_Sms](name,MyName,Title,Content) values('系统消息','"&SetUserName&"','您的主题被移动通知','"&Sms&"')")
YxBBs.Execute("update [YX_User] set NewSmsNum=NewSmsNum+1,SmsSize=SmsSize+"&Len(Sms)&" Where Name='"&SetUserName&"'")
End If
Rs.Close
Caption="<meta http-equiv=refresh content=3;url=Show.Asp?ID="&ID&">主题移动成功!3秒后返回主题!"
Call Show()
Case"提升"
Call cheak()
If Cint(YxBBs.ClassSetting(21))=0 Then YxBBs.Error("您没有提升主题的权限!")
YxBBs.Execute("update [YX_Topic] set LastTime='"&YxBBs.NowBbsTime&"' where TopicID="&ID&" And BoardID="&YxBBs.BoardID&"")
YxBBs.Execute("update [YX_bbs"&YxBBs.TB&"] set LastTime='"&YxBBs.NowBbsTime&"' where TopicID="&ID&" And BoardID="&YxBBs.BoardID&"")
Set Rs=YxBBs.Execute("Select BoardID,Name,Caption From[YX_Topic] where TopicID="&ID&" and BoardID="&YxBBs.BoardID&"")
YxBBs.InLog "成功提升主题《"&Rs(2)&"》,主题ID:"&ID,Rs(1),0
Rs.Close
Caption="<meta http-equiv=refresh content=3;url=Show.Asp?ID="&ID&">主题提升成功!3秒后返回主题!"
Call Show()
Case "editsetting"
Dim BoardSetting,sql,Brule
IF YxBBs.ClassID>3 Then YxBBs.Error("管理权限不足!")
BoardID=Request.form("BoardID")
Brule=YxBBs.Fun.GetStr("Brule")
IF BoardID="" or not isNumeric(BoardID) then
YxBBs.Error("参数错误码,请确认正确的参数!")
End if
BoardSetting=Request.form("TopicCode") & "," & Request.form("UpLoadType") & "," & Request.form("TopicMaxLong") & "," & Request.form("ArticleMaxLong") & "," & Request.form("BoardMaxVote") & "," & Request.form("UserMinPost") & "," & Request.form("UserMinRemark") & "," & Request.form("UserMinMoneys") & "," & Request.form("UserMinLoginTimes") & "," & Request.form("UserMinDigestNum") & "," & Request.form("UserMinRegTime") & "," & Request.form("ALeast")
Set Rs=Server.CreateObject("Adodb.Recordset")
YxBBs.execute("update [YX_Board] Set BoardSetting='"&BoardSetting&"',Brule='"&Brule&"' where BoardID="&BoardID&"")
Set rs=nothing
Cache.name="BoardInfo":Cache.clean()
Caption="操作成功"
Content="<div style='margin:15;line-height: 150%'><li>版块权限设置成功! <li><a href=?BoardID="&BoardID&">返回版块设置</a></div>"
Call YxBBs.ShowTable(Caption,Content)
Case Else
IF YxBBs.ClassID>3 Then YxBBs.Error("管理权限不足!")
IF YxBBs.ClassID=3 And YxBBs.IsBoardAdmin=False Then YxBBs.Error("管理权限不足!")
dim ClassID,BoardName
BoardID=Request("BoardID")
if Not IsNumeric(ClassID) then
YxBBs.Error("参数错误,请从新检查!")
end if
set rs=Conn.execute("Select BoardID,BoardName,BoardSetting,brule from YX_Board where BoardID="& BoardID)
if rs.eof or rs.bof then
YxBBs.Error("找不到此版块或已删除!")
else
BoardName=rs("BoardName")
BoardSetting=split(rs("BoardSetting"),",")
Temp=YxBBs.Template.ReadTemplate("各项列表顶部")
Temp=Replace(Temp,"{标题}",YxBBs.Stats )
Response.Write Temp
%>
<form action='?action=editsetting&BoardID=<%=BoardID%>' method=post name='creator'><table cellpadding=6 cellspacing=1 border=0 width=100% align='center'>
<tr><td width=35% height=20>版块名称</td><td height=20><INPUT TYPE=hidden name=BoardID value=<%=BoardID%> readonly><%=BoardName%></td>
</tr><tr><td colspan=2 height=14><font color=#000077><b>版块相关</b></font></td>
</tr><tr><td height=20>发贴使用验证码</td>
<td height=20>是<input name=TopicCode type=radio value=1
<%if BoardSetting(0)=1 then%>
checked>
<%else%>
>
<%end if%>
否<input name=TopicCode type=radio value=0
<%if BoardSetting(0)=0 then%>
checked></td>
<%else%>
></td>
<%end if%>
</tr><tr><td height=20>上传类型</td><td height=0>
<input name=UpLoadType size=20 value=<%=BoardSetting(1)%>></td></tr><tr><td height=20>主题限制长度</td>
<td height=20><input name=TopicMaxLong size=20 value=<%=BoardSetting(2)%>></td></tr><tr>
<td height=26>帖子内容最多字节数</td><td height=26><input name=ArticleMaxlong size=20 value=<%=BoardSetting(3)%>></td>
</tr><tr><td height=20>最多投票项目</td><td height=20>
<input name=BoardMaxVote size=20 value=<%=BoardSetting(4)%> ></td></tr><tr>
</tr><tr><td>版块规则设置<br>* 设置版规的内容支持HTML.<br>* 版规默认支持样式<font color=red><div class=rule>版规内容</div></font><br>* 内容只支持255个字符. </td><td>
<textarea rows=6 cols=70 name=Brule><%=Rs("Brule")%></textarea></td></tr><tr>
<td colspan=2 height=14><font color=#000077><b>用户相关</b></font></td>
</tr><tr><td height=20>用户至少文章数</td><td height=20>
<input name=UserMinPost size=20 value=<%=BoardSetting(5)%> ></td></tr><tr>
<td height=20>用户至少积分</td><td height=20>
<input name=UserMinRemark size=20 value=<%=BoardSetting(6)%> ></td>
</tr><tr><td height=20>用户至少金钱</td><td height=20>
<input name=UserMinMoneys size=20 value=<%=BoardSetting(7)%> ></td></tr><tr>
<td height=20>登陆次数至少几次</td><td height=20>
<input name=UserMinLoginTimes size=20 value=<%=BoardSetting(8)%> ></td>
</tr><tr><td height=20>用户至少精华文章</td><td height=20>
<input name=UserMinDigestNum size=20 value=<%=BoardSetting(9)%> ></td>
</tr><tr><td height=20>至少注册时间(单位为分钟)</td><td height=20>
<input name=UserMinRegTime size=20 value=<%=BoardSetting(10)%> ></td></tr><tr>
<td height=26>帖子内容最少字节数</td><td height=26><input name=ALeast size=20 value=<%=BoardSetting(11)%> ></td></tr><tr>
<td valign=middle colspan=2 align=center height=20><input type=submit value='修 改' name='B1'></td></tr>
</table></form>
<%
Temp=YxBBs.Template.ReadTemplate("各项列表底部")
Temp=Replace(Temp,"{分页}","")
Response.Write Temp
end if
End Select
YxBBs.Footer()
Set YxBBs=Nothing
Sub Show()
Dim Temp
IF GoToUrl Then Temp="<li><a href="&Url&">回到帖子</a></li>"
Content=Content&Temp&"<li><a href=List.Asp?BoardID="&YxBBs.BoardID&">"&YxBBs.BoardName&"</a></li><li><a href=Default.Asp>返回首页</a>"
YxBBs.Success Caption,Content
End Sub
Function GetBoardList()
Dim Temp,I,II,po
Temp="<select Style='font-size: 9pt' name='BoardID' >"
If IsArray(YxBBs.Board_Rs) Then
For i=0 To Ubound(YxBBs.Board_Rs,2)
Po=""
If YxBBs.Board_Rs(0,i)=0 Then
Temp=Temp&"<option value='"&YxBBs.Board_Rs(1,i)&"'>≡"&YxBBs.Board_Rs(3,i)&"≡</option>"
Else
For II=2 to YxBBs.Board_Rs(0,i)
po=Po&"∣"
Next
Temp=Temp&"<option value='"&YxBBs.Board_Rs(1,i)&"'>"&po&"├ "&YxBBs.Board_Rs(3,i)&"</option>"
End IF
Next
End If
GetBoardList=Temp&"</select>"
End Function
Sub BoardLastRaply()
Dim Rs,Temp,TempID,TempContent
Set Rs=YxBBs.execute("select top 1 ReplyTopicID,Name,Caption,Content,TopicID,LastTime,BoardID from [YX_bbs"&YxBBs.TB&"] where BoardID="&YxBBs.BoardID&" And IsDel=False order by BbsID desc")
if Rs.eof then
Temp=""
Else
if Rs("ReplyTopicID")=0 then
TempContent=YxBBs.Fun.StrLeft(Rs("Caption"),20)
TempID=Rs("Topicid")
Else
TempContent=YxBBs.Fun.StrLeft(YxBBs.Fun.FixReply(Rs("Caption")),20)
TempID=Rs("ReplyTopicID")
'更新主题
Dim ReRs,TopicLastReply
Set ReRs=YxBBs.execute("select top 1 Name,Content from [YX_bbs"&YxBBs.TB&"] where BoardID="&YxBBs.BoardID&" And ReplyTopicID="&TempID&" And IsDel=False order by BbsID desc")
If Not ReRs.Eof Then
TopicLastReply=""&ReRs(0)&"|"&YxBBs.Fun.StrLeft(ReRs(1),40)
YxBBs.execute("Update [YX_Topic] set LastReply='"&TopicLastReply&"' where TopicId="&TempID&"")
End If
ReRs.CLose:Set ReRs=Nothing
End if
Temp=""&Rs("name")&"|"&TempContent&"|"&Rs("LastTime")&"|99|"&TempID&"|"&Rs("BoardID")&"|"&YxBBs.TB&""
end if
Rs.Close
IF Temp<>"" Then
YxBBs.execute("update [YX_Board] set LastReply='"&Temp&"' where BoardID="&YxBBs.BoardID&" and ParentID<>0")
If YxBBs.BoardDepth>1 Then
YxBBs.Execute("Update [YX_Board] set LastReply='"&Temp&"' where BoardID In ("&YxBBs.BoardParentStr&") And ParentID<>0")
End If
End IF
Cache.name="Config"
Cache.clean()
Cache.Name="BoardInfo"
Cache.clean()
End Sub
sub cheak
If YxBBs.Execute("Select ID From[YX_user]where Name='"&YxBBs.MyName&"' And PassWord='"&YxBBs.MyPwd&"'").Eof Then
YxBBs.MakeCookiesEmpty()
YxBBs.Error("该用户不存在或者已经被删除!")
End IF
Set Rs=YxBBs.Execute("Select Name,BoardID From[YX_topic] Where TopicID="&ID&" And (BoardID="&YxBBs.BoardID&" or TopType=5)")
IF Not Rs.eof Then
SetUserName=Rs("Name")
YxBBs.BoardID=Rs("BoardID")
Rs.Close
Else
YxBBs.Error("该帖子不存在或已经删除!")
End IF
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -