⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin.asp

📁 网趣购物系统加强升级版 ○ 完美整合BBS论坛程序
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="Inc/SysConfig.Asp"-->
<%
Dim Caption,Content,Rs,ID,Url,Action,SetUserName,GoToUrl
YxBBs.Fun.CheckMake()
ID=YxBBs.Checknum(Request.QueryString("ID"))
Action=lcase(Request.QueryString("Action"))
If YxBBs.BoardID=0 or ID=0  Then YxBBs.Error("错误的地址栏参数,请不要手动去更改地址栏参数。")
If YxBBs.Execute("Select ID From[YX_user]where Name='"&YxBBs.MyName&"' And PassWord='"&YxBBs.MyPwd&"' And Isdel=False").Eof Then
	YxBBs.MakeCookiesEmpty()
	YxBBs.Error("该用户不存在或者已经被删除!")
End IF
YxBBs.CheckBoard()

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
URl="Show.Asp?ID="&ID
GoToUrl=True
Call YxBBs.Head("管理帖子")
Select Case Action
Case"精华"
	If Cint(YxBBs.ClassSetting(19))=0 Then YxBBs.Error("您没有操作精华帖子权限!")
	Set Rs=YxBBs.Execute("Select IsGood,Name,Caption From[YX_Topic] where TopicID="&ID&" And BoardID="&YxBBs.BoardID&"")
	If Rs.eof Then
		YxBBs.Error("该帖子不存在或已经删除!")
	Else
		IF Rs(0) Then
			YxBBs.Error("该主题帖子已经是精华帖子了!")
		ELse
			YxBBs.Execute("update [YX_Topic] set IsGood=True where TopicID="&ID&" And BoardID="&YxBBs.BoardID&"")
			YxBBs.Execute("update [YX_User] set Coin=Coin+"&YxBBs.BBSSetting(39)&",Mark=Mark+"&YxBBs.BBSSetting(40)&",GoodNum=GoodNum+1 where name='"&SetUserName&"'")
			YxBBs.InLog "将主题《"&Rs(2)&"》设为精华,主题ID:"&ID,Rs(1),0
		End If
	End If
	Caption="<meta http-equiv=refresh content=3;url=Show.Asp?ID="&ID&">设定为精华帖子成功!3秒后返回主题!"
	Rs.Close
	Call Show()
Case"取消精华"
	If Cint(YxBBs.ClassSetting(19))=0 Then YxBBs.Error("您没有操作精华帖子权限!")
	Set Rs=YxBBs.Execute("Select IsGood,Name,Caption From[YX_Topic] where TopicID="&ID&" And BoardID="&YxBBs.BoardID&"")
	If Rs.Eof Then
		YxBBs.Error("该帖子不存在或已经删除!")
	Else
		IF Not Rs(0) Then
			YxBBs.Error("该主题帖子不是精华帖子!")
		ELse
			YxBBs.Execute("update [YX_Topic] set IsGood=False where TopicID="&ID&" And BoardID="&YxBBs.BoardID&"")
			YxBBs.execute("update [YX_User] set Coin=Coin-"&YxBBs.BBSSetting(41)&",Mark=Mark-"&YxBBs.BBSSetting(42)&",GoodNum=GoodNum-1 where name='"&SetUserName&"'")
			YxBBs.InLog "将主题《"&Rs(2)&"》取消精华,主题ID:"&ID,Rs(1),0
		End If
	End If
	Caption="<meta http-equiv=refresh content=3;url=Show.Asp?ID="&ID&">取消帖子精华成功!3秒后返回主题!"
	Rs.Close
	Call Show()
Case"置顶"
	If Cint(YxBBs.ClassSetting(16))=0 Then YxBBs.Error("您没有置顶主题的权限!")
	Set Rs=YxBBs.execute("Select TopType,Name,Caption From[YX_Topic] where TopicID="&ID&" And BoardID="&YxBBs.BoardID&"")
	If Rs.eof Then
		YxBBs.Error("该帖子不存在或已经删除!")
	Else
		IF Rs(0)=5 Then
			YxBBs.Error("该帖子已经是总置顶帖!")
		ElseIf Rs(0)=4 Then
			YxBBs.Error("该帖子已经是区置顶帖!")
		ElseIF Rs(0)=3 Then
			YxBBs.Error("该主题帖子已经被置顶了!")	
		Else
			YxBBs.Execute("update [YX_Topic] Set TopType=3 where TopicID="&ID&" And BoardID="&YxBBs.BoardID&"")
			YxBBs.execute("update [YX_User] set Coin=Coin+"&YxBBs.BBSSetting(43)&",Mark=Mark+"&YxBBs.BBSSetting(44)&" Where name='"&SetUserName&"'")
			YxBBs.InLog "将主题《"&Rs(2)&"》设为置顶,主题ID:"&ID,Rs(1),0
		End If
		Caption="<meta http-equiv=refresh content=3;url=Show.Asp?ID="&ID&">成功将主题设为置顶帖子!3秒后返回主题!"
	End If
	Rs.Close
	Call Show()
Case"取消置顶"
	If Cint(YxBBs.ClassSetting(16))=0 Then YxBBs.Error("您没有操作置顶主题的权限!")
	Set Rs=YxBBs.execute("Select TopType,Name,Caption From[YX_Topic] where TopicID="&ID&" And BoardID="&YxBBs.BoardID&"")
	If Rs.eof Then
		YxBBs.Error("该帖子不存在或已经删除!")
	Else
		IF Rs(0)=5 Then
			YxBBs.Error("该帖子已经是总置顶帖!")
		ElseIf Rs(0)=4 Then
			YxBBs.Error("该帖子已经是区置顶帖!")
		ElseIF Rs(0)<>3 Then
			YxBBs.Error("该主题已经不是置顶帖!")
		Else
			YxBBs.Execute("update [YX_Topic] Set TopType=0 where TopicId="&ID&" ")
			YxBBs.execute("update [YX_User] set Coin=Coin-"&YxBBs.BBSSetting(45)&",Mark=Mark-"&YxBBs.BBSSetting(46)&" Where Name='"&SetUserName&"'")
			YxBBs.InLog "将主题《"&Rs(2)&"》取消置顶,主题ID:"&ID,Rs(1),0
		End If
		Caption="<meta http-equiv=refresh content=3;url=Show.Asp?ID="&ID&">成功的取消帖子的置顶!3秒后返回主题!"
	End If
	Set Rs=Nothing
	Call Show()
Case"总置顶"
	If Cint(YxBBs.ClassSetting(17))=0 Then YxBBs.Error("您没有管理总置顶帖子的权限!")
	Set Rs=YxBBs.execute("Select TopType,Name,Caption From[YX_Topic] where TopicID="&ID&" And (BoardID="&YxBBs.BoardID&" or TopType=5)")
	If Rs.eof Then
		YxBBs.Error("该帖子不存在或已经删除")
	Else
		IF Rs(0)=5 Then
			YxBBs.Error("该帖子已经是总置顶主题!")
		Else
			YxBBs.execute("update [YX_Topic] Set TopType=5 where TopicID="&id&" And BoardID="&YxBBs.BoardID&"")
			YxBBs.execute("update [YX_user] Set Coin=Coin+"&YxBBs.BBSSetting(51)&",Mark=Mark+"&YxBBs.BBSSetting(52)&" where Name='"&SetUserName&"'")
			YxBBs.InLog "将主题《"&Rs(2)&"》设为总置顶,主题ID:"&ID,Rs(1),0
		End If
		Caption="<meta http-equiv=refresh content=3;url=Show.Asp?ID="&ID&">成功将帖子设置为总置顶!3秒后返回主题!"
	End If
	Rs.Close
	Call Show()
Case"取消总置顶"
	If Cint(YxBBs.ClassSetting(17))=0 Then YxBBs.Error("您没有管理总置顶帖子的权限!")
	Set Rs=YxBBs.execute("Select TopType,Name,Caption From[YX_Topic] where TopicID="&ID&" And (BoardID="&YxBBs.BoardID&" or TopType=5)")
	If Rs.eof Then
		YxBBs.Error("该帖子不存在或已经删除")
	Else
		IF Rs(0)<>5 Then
			YxBBs.Error("该帖子不是总置顶主题!")
		Else
		YxBBs.execute("update [YX_Topic] set TopType=0 where TopicID="&ID&" And BoardID="&YxBBs.BoardID&"")
		YxBBs.execute("update [YX_user] set Coin=Coin-"&YxBBs.BBSSetting(53)&",Mark=Mark-"&YxBBs.BBSSetting(54)&" where name='"&SetUserName&"'")
		YxBBs.InLog "将主题《"&Rs(2)&"》取消总置顶,主题ID:"&ID,Rs(1),0
		End If
		Caption="<meta http-equiv=refresh content=3;url=Show.Asp?ID="&ID&">成功的取消帖子的总置顶!3秒后返回主题!"
	End If
	Rs.Close
	Call Show()
Case"区置顶"
	If Cint(YxBBs.ClassSetting(17))=0 Then YxBBs.Error("您没有管理区置顶帖子的权限!")
	Set Rs=YxBBs.execute("Select TopType,Name,Caption From[YX_Topic] where TopicID="&ID&" And (BoardID="&YxBBs.BoardID&" or TopType=4)")
	If Rs.eof Then
		YxBBs.Error("该帖子不存在或已经删除")
	Else
		IF Rs(0)=5 Then
			YxBBs.Error("该帖子已经是总置顶主题!")
		ElseIf Rs(0)=4 Then
			YxBBs.Error("该帖子已经是区置顶主题!")
		Else
			YxBBs.execute("update [YX_Topic] Set TopType=4 where TopicID="&id&" And BoardID="&YxBBs.BoardID&"")
			YxBBs.execute("update [YX_user] Set Coin=Coin+"&YxBBs.BBSSetting(47)&",Mark=Mark+"&YxBBs.BBSSetting(48)&" where Name='"&SetUserName&"'")
			YxBBs.InLog "将主题《"&Rs(2)&"》设为区置顶,主题ID:"&ID,Rs(1),0
		End If
		Caption="<meta http-equiv=refresh content=3;url=Show.Asp?ID="&ID&">成功将帖子设置为区置顶!3秒后返回主题!"
	End If
	Rs.Close	
	Call Show()
Case"取消区置顶"
	If Cint(YxBBs.ClassSetting(17))=0 Then YxBBs.Error("对不起,您没有管理权限!")
	IF YxBBs.ClassID>2 Then YxBBs.Error("对不起,您没有管理权限!")
	Set Rs=YxBBs.execute("Select TopType,Name,Caption From[YX_Topic] where TopicID="&ID&" And (BoardID="&YxBBs.BoardID&" or TopType=4)")
	If Rs.eof Then
		YxBBs.Error("该帖子不存在或已经删除")
	Else
		IF Rs(0)<>4 Then
			YxBBs.Error("该帖子不是区置顶主题!")
		Else
			YxBBs.execute("update [YX_Topic] set TopType=0 where TopicID="&ID&" And BoardID="&YxBBs.BoardID&"")
			YxBBs.execute("update [YX_user] set Coin=Coin-"&YxBBs.BBSSetting(49)&",Mark=Mark-"&YxBBs.BBSSetting(50)&" where name='"&SetUserName&"'")
			YxBBs.InLog "将主题《"&Rs(2)&"》取消区置顶,主题ID:"&ID,Rs(1),0
		End If
		Caption="<meta http-equiv=refresh content=3;url=Show.Asp?ID="&ID&">成功的取消帖子的区置顶!3秒后返回主题!"
	End If
	Rs.Close
	Call Show()
Case"锁定"
	If Cint(YxBBs.ClassSetting(20))=0 Then YxBBs.Error("您没有锁定主题的权限!")
	Set Rs=YxBBs.execute("Select IsLock,Name,Caption From[YX_Topic] where TopicID="&ID&" And BoardID="&YxBBs.BoardID&"")
	If Rs.eof Then
		YxBBs.Error("该帖子不存在或已经删除")
	Else
		IF Rs(0) Then
			YxBBs.Error("该主题帖子已经被锁定!")
		Else
			YxBBs.execute("update [YX_Topic] set IsLock=True where TopicID="&ID&" And BoardID="&YxBBs.BoardID&"")
			YxBBs.InLog "将主题《"&Rs(2)&"》锁定,主题ID:"&ID,Rs(1),0
		End If
		Caption="<meta http-equiv=refresh content=3;url=Show.Asp?ID="&ID&">主题已经锁定成功!3秒后返回主题!"
	End If
	Rs.Close			

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -