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

📄 admin_confirm.asp

📁 BBS源码 利用ASP的一个功能齐全的BBS论坛源码
💻 ASP
📖 第 1 页 / 共 5 页
字号:
	If Not BBS94KK.Execute("select BoardID From[KK_Admin] where Name='"&UserName&"' And BoardID=0").Eof Then
	Temp=20
	ElseIf Not BBS94KK.Execute("select BoardID From[KK_Admin] where Name='"&UserName&"' And BoardID=-1").Eof Then
	Temp=19
	ElseIf Not BBS94KK.Execute("select BoardID From[KK_Admin] where Name='"&UserName&"' And BoardID>0").Eof Then
	Temp=18
	Else
	Temp=BBS94KK.Execute("select EssayNum From[KK_User] where Name='"&UserName&"'")(0)
	Temp=Temp\80
	IF Temp>17 Then Temp=17
	End If
	BBS94KK.execute("update [KK_User] Set Grade="&Temp&" where Name='"&UserName&"'")
End Function

Sub DelUser
	Dim Alltable,UserName,Flag,I
	UserName=BBS94KK.Fun.GetStr("Name")
	Flag=BBS94KK.Fun.GetStr("Flag")
	If UserName="" then
		Call GoBack("","")
		Exit Sub
	ElseIF BBS94KK.Execute("select name From[KK_User] where Name='"&UserName&"'").eof Then
		Call GoBack("","这个用户根本不存在!")
		Exit Sub
	ElseIf Not BBS94KK.Execute("Select Name From[KK_Admin] where Name='"&UserName&"' and BoardID=0").Eof Then
		Call GoBack("","该用户是管理员(管理员不能删除,如果确实要把该用户删除,请先把管理员降职,再把该用户删除)")
		Exit Sub	
	ElseIf Flag="Yes" Then
		AllTable=Split(BBS94KK.BBSTable(0),",")
		For i=0 To uBound(AllTable)
		BBS94KK.Execute("Delete From[KK_Bbs"&AllTable(i)&"] where Name='"&UserName&"'")
		BBS94KK.Execute("Delete From[KK_Bbs"&AllTable(i)&"] where ReplyTopicID in (Select TopicID From[KK_Topic] where Name='"&UserName&"')")	
		Next
		BBS94KK.Execute("Delete From[KK_Topic] where  Name='"&UserName&"'")
		BBS94KK.Execute("Delete From[KK_Sms] where  MyName='"&UserName&"'")
		BBS94KK.Execute("Delete From[KK_Admin] where Name='"&UserName&"'")
		BBS94KK.Execute("Delete From[KK_User] where  Name='"&UserName&"'")
		Call Suc("","该用户(包括所有帖子、留言等)已经被完全删除!","Admin_Action.asp?Action=DelUser")
	Else
		BBS94KK.execute("Update [KK_User] set IsDel=true where Name='"&UserName&"'")
		Call Suc("","该用户被成功作了删除标记,不能再登陆论坛了。您可以随时恢复!","Admin_Action.asp?Action=DelUser")
	End IF
End Sub

Sub RecallUser
	Dim UserName
	UserName=Trim(Replace(Request("name"),"'",""))
	BBS94KK.Execute("update[KK_User]set IsDel=false where  Name='"&UserName&"'")
	Call Suc("","已经恢复了用户 "&UserName&" 的帐号!","Admin_Action.asp?Action=DelUser")
End Sub

Sub UpdateUserCM
	Dim Username,Coin,CoinFlag,Mark,MarkFlag
	UserName=BBS94KK.Fun.GetStr("Name")
	Coin=BBS94KK.Fun.GetStr("Coin")
	Mark=BBS94KK.Fun.GetStr("Mark")
	CoinFlag=BBS94KK.Fun.GetStr("CoinFlag")
	MarkFlag=BBS94KK.Fun.GetStr("MarkFlag")
	If UserName="" Then
		Call GoBack("","请填写用户名"):Exit Sub
	ElseIF BBS94KK.Execute("select name From[KK_User] where Name='"&UserName&"'").eof Then
		Call GoBack("","这个用户根本不存在!"):Exit Sub
	End If
	If not isnumeric(Coin) Then Coin=0
	If not IsNumeric(Mark) Then Mark=0
	IF CoinFlag="+" Then
	BBS94KK.Execute("Update [KK_User] Set Coin=Coin+"&Coin&" where Name='"&UserName&"'")
	Else
		Set Rs=BBS94KK.Execute("Select Coin,BankSave From[KK_user] where Name='"&UserName&"'")
		If Not Rs.Eof Then
			IF CCur(Rs(0)) < CCur(Coin) Then
				If CCur(Coin)-CCur(Rs(0))>CCur(Rs(1)) Then
					BBS94KK.Execute("update [KK_user] set Coin=0,BankSave=0 where Name='"&UserName&"'")
				Else
					BBS94KK.Execute("update [KK_user] set Coin=0,BankSave=BankSave-"&CCur(Coin)-CCur(Rs(0))&" where Name='"&UserName&"'")
				End If
			Else
				BBS94KK.Execute("Update [KK_User] Set Coin=Coin-"&Coin&" where Name='"&UserName&"'")
			End If
		End IF
		Rs.Close
	End if
	If MarkFlag="+" Then
	BBS94KK.Execute("Update [KK_User] Set Mark=Mark+"&Mark&" where Name='"&UserName&"'")
	Else
	BBS94KK.Execute("Update [KK_User] Set Mark=Mark-"&Mark&" where Name='"&UserName&"'")
	End if
	Call Suc("","已给用户 "&UserName&" 成功作了积分"&MarkFlag&Mark&" ,金钱"&CoinFlag&Coin&"的操作!","Admin_Action.asp?Action=UpdateUser")
End Sub

Sub UpdateUserPw
	Dim UserName,Password
	UserName=BBS94KK.Fun.GetStr("Name")
	Password=BBS94KK.Fun.GetStr("Password")
	If UserName="" or Password="" Then
		Call GoBack("",""):Exit Sub
	ElseIF BBS94KK.Execute("select name From[KK_User] where Name='"&UserName&"'").eof Then
		Call GoBack("","这个用户根本不存在!"):Exit Sub
	End If
	BBS94KK.Execute("Update [KK_User] Set [Password]='"&MD5(Password)&"' where Name='"&UserName&"'")
	BBS94KK.Execute("Update [KK_Admin] Set [Password]='"&MD5(Password)&"' where Name='"&UserName&"'")
	Call Suc("","成功的把用户 <font color=red>"&UserName&"</font> 的密码改为 <font color=red>"&Password&"</font>","Admin_Action.asp?Action=UpdateUser")
End Sub

Sub UpdateUserName
	Dim UserName,NewUserName,AllTable,i
	UserName=Lcase(BBS94KK.Fun.GetStr("Name"))
	NewUserName=BBS94KK.Fun.GetStr("NewName")
	If UserName=""  or NewUserName="" Then
		Call GoBack("",""):Exit Sub
	ElseIF BBS94KK.Execute("select name From[KK_User] where Name='"&UserName&"'").eof Then
		Call GoBack("","这个用户根本不存在!"):Exit Sub
	ElseIf Not BBS94KK.Execute("select name From[KK_User] where Name='"&NewUserName&"'").eof Then
		Call GoBack("","新用户名称已经被注册了!"):Exit Sub
	End If
	AllTable=Split(BBS94KK.BBSTable(0),",")
	For i=0 To uBound(AllTable)
		BBS94KK.Execute("Update [KK_Bbs"&AllTable(i)&"] Set Name='"&NewUserName&"' where Name='"&UserName&"'")
	Next
	BBS94KK.Execute("Update [KK_TopicVoteUser] Set [User]='"&NewUserName&"' where [User]='"&UserName&"'")
	BBS94KK.Execute("Update [KK_Topic] Set Name='"&NewUserName&"' where Name='"&UserName&"'")
	BBS94KK.Execute("Update [KK_Sms] Set MyName='"&NewUserName&"' where MyName='"&UserName&"'")
	BBS94KK.Execute("Update [KK_Sms] Set Name='"&NewUserName&"' where Name='"&UserName&"'")
	BBS94KK.Execute("Update [KK_Placard] Set Name='"&NewUserName&"' where Name='"&UserName&"'")
	BBS94KK.Execute("Update [KK_User] Set Name='"&NewUserName&"' where Name='"&UserName&"'")
	BBS94KK.Execute("Update [KK_Admin] Set Name='"&NewUserName&"' where Name='"&UserName&"'")
	Call Suc("","成功的把用户名称 <font color=red>"&UserName&"</font> 改为 <font color=red>"&NewUserName&"</font>","Admin_Action.asp?Action=UpdateUser")
End Sub


Sub UpdateUserShow
	Dim UserName,Flag
	UserName=BBS94KK.Fun.GetStr("Name")
	Flag=BBS94KK.Fun.GetStr("Flag")
	If UserName="" Then
		Call GoBack("",""):Exit Sub
	ElseIF BBS94KK.Execute("select name From[KK_User] where Name='"&UserName&"'").eof Then
		Call GoBack("","这个用户根本不存在!"):Exit Sub
	Else
		BBS94KK.Execute("update [KK_User] Set IsShow="&Flag&" Where Name='"&UserName&"'")
		IF Flag="yes" Then
			Call Suc("","成功的屏蔽了 "&UserName&" 的帖子!","Admin_Action.asp?Action=UpdateUser")
		Else
			Call Suc("","现在 "&UserName&" 的帖子又可以看到了!","Admin_Action.asp?Action=UpdateUser")
		End IF
	End IF
End Sub

Sub UpdateUserSign
	Dim UserName,Flag
	UserName=BBS94KK.Fun.GetStr("Name")
	Flag=BBS94KK.Fun.GetStr("Flag")
	If UserName="" Then
		Call GoBack("","")
	ElseIF BBS94KK.Execute("select name From[KK_User] where Name='"&UserName&"'").eof Then
		Call GoBack("","这个用户根本不存在!")
	Else
		BBS94KK.Execute("update [KK_User] Set IsSign="&Flag&" Where Name='"&UserName&"'")
		IF Flag="yes" Then
			Call Suc("","成功的屏蔽了 "&UserName&" 的签名档!","Admin_Action.asp?Action=UpdateUser")
		Else
			Call Suc("","现在 "&UserName&" 的个性签名档又可以看到了!","Admin_Action.asp?Action=UpdateUser")
		End IF
	End IF
End Sub

Sub UpdateUserHonor
	Dim UserName,Honor
	UserName=BBS94KK.Fun.GetStr("Name")
	Honor=BBS94KK.Fun.GetStr("Honor")
	If UserName="" or Honor="" Then
		Call GoBack("","")
	ElseIF BBS94KK.Execute("select name From[KK_User] where Name='"&UserName&"'").eof Then
		Call GoBack("","这个用户根本不存在!")
	Else
		BBS94KK.Execute("update [KK_User] Set Honor='"&Honor&"' Where Name='"&UserName&"'")
		Call Suc("","成功的更改了 "&UserName&" 头衔称号!","Admin_Action.asp?Action=UpdateUser")
	End IF
End Sub

Sub UpdateBbsDate
	Dim EssayNum,TopicNum,NewUser,TodayNum,UserNum,AllTable,I
	UserNum=BBS94KK.Execute("Select Count(ID) From[KK_User]")(0)
	NewUser=BBS94KK.execute("select Top 1 Name from [KK_User] order by ID desc")(0)
	AllTable=Split(BBS94KK.BBSTable(0),",")
	For i=0 To uBound(AllTable)
		EssayNum=EssayNum+BBS94KK.Execute("Select Count(BbsID) From[KK_Bbs"&AllTable(i)&"] where IsDel=False")(0)
		TodayNum=TodayNum+BBS94KK.Execute("Select Count(BbsID) From[KK_Bbs"&AllTable(i)&"] where IsDel=False And DATEDIFF('d',LastTime,'"&BBS94KK.NowBbsTime&"')<1")(0)
	Next
	TopicNum=BBS94KK.Execute("Select Count(TopicID) From[KK_Topic]")(0)
	BBS94KK.Execute("update [KK_Config] Set UserNum="&UserNum&",AllEssayNum="&EssayNum&",TopicNum="&TopicNum&",TodayNum="&TodayNum&",NewUser='"&NewUser&"'")
	Call Suc("论坛系统整理成功","论坛系统整理成功,整理后:<li>总帖数:"&EssayNum&" | 主题数:"&TopicNum&" | 今日帖数:"&TodayNum&" | 注册用户数:"&UserNum&" | 最新注册用户:"&NewUser&"","Admin_Action.asp?Action=UpdateBbs")
	Cache.name="Config"
	Cache.clean()
End Sub

Sub UpdateTopic
	Dim Caption,Content,ID1,ID2,LastReply,Go,ReplyNum,Rs1,AllTable,i,Temp,MaxID
	ID1=BBS94KK.Fun.GetStr("id1")
	ID2=BBS94KK.Fun.GetStr("id2")
	MaxID=BBS94KK.execute("select max(TopicID)from [KK_Topic]")(0)
	IF ID1="" Then
		ID1=1:ID2=100
		Go= " 开始整理 "
	Else
		IF not isnumeric(ID1) or not isnumeric(ID2) then Call GoBack("","<li>请用数字填写!"):Exit Sub
		Set Rs=BBS94KK.execute("Select TopicId,SqlTableID From [KK_Topic] where TopicID>="&ID1&" And Topicid<="&ID2&"")
		IF Rs.eof then
			If Int(ID2) < Int(MaxID) Then
				Call GoBack("数据据中没有数据","在ID:<font color=red>"&ID1&"</font> 至 <font color=red>"&ID2&"</font> 之间不存在帖子,请把结束ID的数字填大一些。")
			Else
				Call Suc("整理结束","全部整理成功!","Admin_Action.asp?Action=UpdateBbs")
			End If
			Exit Sub
		End If
		AllTable=Split(BBS94KK.BBSTable(0),",")
		Do while not rs.eof
		For i=0 To uBound(AllTable)
			IF Int(Rs(1))=Int(AllTable(i)) Then
				ReplyNum=BBS94KK.execute("select count(BbsID) from [KK_bbs"&Rs(1)&"] where IsDel=False and ReplyTopicID="&Rs(0)&"")(0)
				Set Rs1=BBS94KK.Execute("Select top 1 Name,Content From [KK_bbs"&Rs(1)&"] where IsDel=False and ReplyTopicID="&Rs(0)&" order by BbsID desc")
				IF Rs1.eof Then
					LastReply="——|暂无回复"
				Else
					LastRePly=Rs1(0)&"|"&Replace(BBS94KK.Fun.StrLeft(Rs1(1),40),"'","")
				End if
				Set Rs1=Nothing
				BBS94KK.execute("update [KK_Topic] Set ReplyNum="&ReplyNum&",LastReply='"&LastReply&"' where TopicID="&Rs(0)&"")
				Exit For
			End If
		Next
		Rs.Movenext
		Loop
		Rs.Close
		Temp=ID1
		ID1=int(ID2)+1
		ID2=int(ID2)+int(ID2)-int(Temp)+1
		Go=" 继续整理 "
	End IF
	Caption="主题帖子整理"
	Content="<form method=POST action='?Action=UpdateTopic' onSubmit='ok.disabled=true;ok.value=""正在整理-请稍等。。。""'>请填写你要整理的帖子的开始ID和结束ID:(两者之间不要相差太大)<br>你的论坛帖子最大的 ID 为:"&MaxID&"<br>初始ID:<input type=text name='ID1' size=20 value="&ID1&"><BR>结束ID:<input type=text name='ID2' size=20 value="&ID2&"><BR><input type=submit name='ok' value="&Go&"><input type=reset value=' 重 置 '> </p></form>"
	Call ShowTable(caption,Content)
End Sub

Sub UpdateAllUser
	Dim Caption,Content,ID1,ID2,Grade,GoodNum,EssayNum,Rs1,Go,AllTable,I,Temp,MaxID
	ID1=BBS94KK.Fun.GetStr("id1"):ID2=BBS94KK.Fun.GetStr("id2")
	MaxID=BBS94KK.execute("select max(id)from [KK_User]")(0)
	IF ID1="" Then
		ID1=1:ID2=100
		Go= " 开始整理 "
	Else
		IF not isnumeric(ID1) or not isnumeric(ID2) then Call GoBack("","<li>请用数字填写!"):Exit Sub
		Set Rs=BBS94KK.execute("Select name From [KK_User] where Id>="&ID1&" and id<="&ID2&"")
		IF Rs.eof then
			If Int(ID2) < Int(MaxID) Then
				Call GoBack("数据据中没有数据","在ID:<font color=red>"&ID1&"</font> 至 <font color=red>"&ID2&"</font> 之间不存在用户,请把结束ID的数字填大一些。")
			Else
				Call Suc("整理结束","全部整理成功!","Admin_Action.asp?Action=UpdateBbs")
			End If		
			Exit Sub
		End if
		AllTable=Split(BBS94KK.BBSTable(0),",")
		Do while not rs.eof
		EssayNum=0
		GoodNum=0
		For i=0 To uBound(AllTable)
			EssayNum=EssayNum+BBS94KK.execute("select Count(BbsID) from [KK_bbs"&AllTable(i)&"] where Name='"&Rs(0)&"'")(0)
		Next
			GoodNum=BBS94KK.execute("select count(TopicID) from [KK_Topic] where Name='"&Rs(0)&"' And IsGood=True")(0)
		Set Rs1=BBS94KK.execute("Select BoardID From[KK_Admin] where Name ='"&Rs(0)&"'")
		IF Rs1.eof Then
			Grade=Int(EssayNum\80)
			If Grade>17 Then Grade=17
		ElseIF Rs1("BoardID")=0 Then
			Grade=20 
		ElseIF Rs1("BoardID")=-1 Then
			Grade=19

⌨️ 快捷键说明

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