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

📄 admin_postings.asp

📁 品泡女人香XI8.NET文章管理系统的源码
💻 ASP
📖 第 1 页 / 共 5 页
字号:

	Public Sub fixtopic()
		Dim myistop
		LogType=3
		'Get_RequestInfo
		sucmsg="修复帖子"
		Set Rs=Dvbbs.Execute("select istop from dv_topic where boardID="&Dvbbs.BoardID&" and topicID="&ID)
		If Rs.Eof And Rs.Bof Then
			Dvbbs.AddErrCode(32)
			Exit Sub
		End If		
		myistop=rs(0)
		Set Rs=Dvbbs.Execute("Select count(*),max(DateAndTime) from "&TotalUseTable&" where (Not BoardID In (444,777)) And RootID="&ID)
		If Not IsNull(rs(0)) And Not IsNull(rs(1)) Then
			If myistop=0 Then
				Dvbbs.Execute("update dv_topic set child="&Rs(0)-1&",LastPostTime='"&rs(1)&"' where topicID="&ID)
			ElseIf myistop=1 Then
				If IsSqlDataBase=1 Then
					Dvbbs.Execute("update dv_topic set child="&Rs(0)-1&",LastPostTime=DateAdd(d,100,'"&rs(1)&"') where topicID="&ID)
				Else
					Dvbbs.Execute("update dv_topic set child="&Rs(0)-1&",LastPostTime=DateAdd('d',100,'"&rs(1)&"') where topicID="&ID)
				End If
			ElseIf myistop=2 Then
				If IsSqlDataBase=1 Then
					Dvbbs.Execute("update dv_topic set child="&Rs(0)-1&",LastPostTime=DateAdd(d,200,'"&rs(1)&"') where topicID="&ID)
				Else
					Dvbbs.Execute("update dv_topic set child="&Rs(0)-1&",LastPostTime=DateAdd('d',200,'"&rs(1)&"') where topicID="&ID)
				End If
			ElseIf myistop=3 Then
				If IsSqlDataBase=1 Then
					Dvbbs.Execute("update dv_topic set child="&Rs(0)-1&",LastPostTime=DateAdd(d,300,'"&rs(1)&"') where topicID="&ID)
				Else
					Dvbbs.Execute("update dv_topic set child="&Rs(0)-1&",LastPostTime=DateAdd('d',300,'"&rs(1)&"') where topicID="&ID)
				End If
			End If
			Set Rs=Nothing
		End If
		Insert_Forum_Log()
		Update_User_Point("")
		Topic_Manage_Sms()
		Dvbbs.Dvbbs_Suc(SucMsgInfo(sucmsg))
	End Sub
	'精华帖子
	Public Sub isbest()
		LogType=3
		Dim datetimestr
		Get_RequestInfo
		Set rs=Dvbbs.Execute("Select * From "&TotalUseTable&" Where boardid="&dvbbs.boardid&" and AnnounceID="&replyID)
		If rs.eof and rs.bof Then
			Dvbbs.AddErrCode(32)
			Exit Sub
		End If
		topic=rs("topic")
		topicusername=rs("username")
		topicuserID=rs("postuserID")
		If topic="" Then topic=left(replace(rs("body"),chr(10),","),26)
		datetimestr=replace(replace(rs("dateandtime"),"上午",""),"下午","")

		Dvbbs.Execute("Update "&TotalUseTable&" Set isbest=1 where boardID="&Dvbbs.BoardID&" and announceID="&replyID)
		Dvbbs.Execute("Update Dv_topic Set isbest=1 where boardID="&Dvbbs.BoardID&" and topicID="&ID)
		Dvbbs.Execute("Insert Into Dv_bestTopic (title,boardID,AnnounceID,rootID,postusername,postuserID,dateandtime,expression) values ('"&Dvbbs.CheckStr(topic)&"',"&rs("boardID")&","&rs("AnnounceID")&","&rs("rootID")&",'"&Dvbbs.CheckStr(topicusername)&"',"&rs("postuserID")&",'"&datetimestr&"','"&rs("expression")&"')")
		
		Set Rs=Nothing

		Insert_Forum_Log()
		Update_User_Point(",userIsBest=userisBest+1")
		Topic_Manage_Sms()
		Dvbbs.Dvbbs_Suc(SucMsgInfo(sucmsg))
	End Sub
	'解除精华帖子
	Public Sub nobest()
		LogType=3
		Dim datetimestr
		Get_RequestInfo
		Set rs=Dvbbs.Execute("Select * From "&TotalUseTable&" Where boardid="&dvbbs.boardid&" and AnnounceID="&replyID)
		If rs.eof and rs.bof Then
			Dvbbs.AddErrCode(32)
			Exit Sub
		End If
		topic=rs("topic")
		topicusername=rs("username")
		topicuserID=rs("postuserID")
		If topic="" Then topic="本帖子为回复帖子"
		Set Rs=Nothing

		Dvbbs.Execute("Update "&TotalUseTable&" set isbest=0 Where boardID="&Dvbbs.BoardID&" and announceID="&replyID)
		Dvbbs.Execute("Update Dv_topic set isbest=0 Where boardID="&Dvbbs.BoardID&" and topicID="&ID)
		Dvbbs.Execute("Delete from Dv_besttopic Where AnnounceID="&replyID)

		Insert_Forum_Log()
		Update_User_Point(",userIsBest=userisBest-1")
		Topic_Manage_Sms()
		Dvbbs.Dvbbs_Suc(SucMsgInfo(sucmsg))
	End Sub

	'删除跟贴
	Public Sub dele(md)
		Dim todaynum
		Dim isbest,IsUpload
		todaynum=0
		Set rs=Dvbbs.Execute("select topic,username,postuserID,DateAndTime,isbest,IsUpload from "&TotalUseTable&" where boardid="&dvbbs.boardid&" and AnnounceID="&replyID)
		If Not rs.eof Then
			Topic=Dvbbs.CheckStr(rs(0))
			topicusername=rs(1)
			topicuserID=rs(2)
			isbest=rs(4)
			IsUpload=rs(5)
			If topic="" Then topic="本帖子为回复帖子"
			If datediff("d",rs(3),now())=0 Then
				todaynum=1
			Else
				todaynum=0
			End If
		Else
			If md=1 Then
				Dvbbs.AddErrCode(32)
				Exit Sub
			End If
		End If
		Set Rs=Nothing
		
		'判断用户是否有删除帖子权限
		If Not CanDelTopic Then
			Dvbbs.AddErrCode(28)
			Exit Sub
		End If
		LogType=3
		Get_RequestInfo
		Dim LastPostime,istop
		'删除时自动删除精华回复帖
		If IsBest=1 Then
			Dvbbs.Execute("update dv_topic set isbest=0 where boardid="&Dvbbs.BoardID&" and topicid="&ID)
			Dvbbs.Execute("delete from dv_besttopic where Announceid="&replyID)
		End If
		Set Rs=Dvbbs.Execute("select istop from dv_topic where boardID="&Dvbbs.BoardID&" and topicID="&ID)
		istop=Rs(0)
		Rs.close
		Dvbbs.Execute("Update "&TotalUseTable&" Set BoardID=444,locktopic="&Dvbbs.BoardID&" Where BoardID="&Dvbbs.BoardID&" And AnnounceID="&replyID)
		Set Rs=Dvbbs.Execute("select Max(dateandtime) from "&TotalUseTable&" where boardID="&Dvbbs.BoardID&" and rootID="&ID)
		LastPostime=rs(0)
		Set Rs=Nothing
		isLastPost
		call LastCount(dvbbs.boardID)
		call BoardNumSub(dvbbs.boardID,0,1,todaynum)
		call AllboardNumSub(todaynum,1,0)
		If IsUpload=1 Then
			If Request.form("delupfile")<>"" and Request.form("delupfile")=1 Then
				Call Delupfiles(Dvbbs.BoardID,ID&"|"&replyID)
			Else
			'更新上传附件数据
			Dvbbs.Execute("update Dv_Upfile Set F_flag=4 Where F_BoardID="&Dvbbs.BoardID&" And F_AnnounceID LIKE  '"&ID&"|"&replyID&"' ")
			End If
		End IF

		If istop>0 Then
			sql="update dv_topic set child=child-1 where boardID="&Dvbbs.BoardID&" and topicID="&ID
		Else
			sql="update dv_topic set child=child-1,LastPostTime='"&LastPostime&"' where boardID="&Dvbbs.BoardID&" and topicID="&ID
		End If
		'Response.Write sql
		Dvbbs.Execute(sql)
		Insert_Forum_Log()
		Update_User_Point(",UserPost=UserPost-1,userDel=userDel-1")
		Topic_Manage_Sms()
		If md=1 Then
			Dvbbs.Dvbbs_Suc(SucMsgInfo(sucmsg))
		End If 
	End Sub
	'删除主贴
	Public Sub delete()
		Dim voteID,isvote,isbest,istop
		set rs=Dvbbs.Execute("select title,postusername,postuserID,PollID,isvote,isbest,istop from dv_topic where boardid="&Dvbbs.boardid&" and topicID="&ID)
		If rs.eof and rs.bof Then
			Dvbbs.AddErrCode(32)
			Exit Sub
		Else
			Topic=rs(0)
			topicusername=rs(1)
			topicuserID=rs(2)
			voteID=rs(3)
			isvote=rs(4)
			isbest=rs(5)
			istop=rs(6)
			If topic="" Then topic="本帖子为回复帖子"
		End If
		Set Rs=Nothing
		LogType=3
		Get_RequestInfo

		Dim todaynum,postnum
		set rs=Dvbbs.Execute("select count(*) from "&TotalUseTable&" where rootID="&ID)
		postNum=rs(0)
		If IsSqlDataBase=1 Then
			sql="select count(*) from "&TotalUseTable&" where rootID="&ID&" and dateandtime>'"&date()&"'"
		else
			sql="select count(*) from "&TotalUseTable&" where rootID="&ID&" and dateandtime>#"&date()&"#"
		end if
		Set Rs=Dvbbs.Execute(sql)
		todayNum=rs(0)
	
		'放入回收站,回收站boardid为444,locktopic为原版面ID
		Dvbbs.Execute("update "&TotalUseTable&" set BoardID=444,locktopic="&Dvbbs.BoardID&" where rootID="&ID)
		If isvote=1 Then
			Dvbbs.Execute("update dv_topic set BoardID=444,locktopic="&Dvbbs.BoardID&",isvote=0,VoteTotal=0 where topicID="&ID)
			Dvbbs.Execute("delete from dv_vote where voteID="&voteID)
			Dvbbs.Execute("delete from dv_voteuser where voteID="&voteID)
		'删帖时自动解除精华帖子
		ElseIf isbest=1 Then
			Dvbbs.Execute("update dv_topic set BoardID=444,locktopic="&Dvbbs.BoardID&",isbest=0 where topicid="&id)
			Dvbbs.Execute("delete from dv_besttopic where rootid="&id)
		Else
			Dvbbs.Execute("update dv_topic set BoardID=444,locktopic="&Dvbbs.BoardID&" where topicID="&ID)
		End If
		If istop>0 Then
			Dvbbs.Execute("update dv_topic set istop=0,LastPostTime="&SqlNowString&" where topicid="&ID)
			If istop=3 Then
				'将总固顶ID从总设置表去除
				Set Rs=Dvbbs.Execute("Select Forum_AllTopNum From Dv_Setup")
				Dim iForum_AllTopNum,mForum_AllTopNum
				iForum_AllTopNum = "," & Rs(0) & ","
				If Instr(iForum_AllTopNum,"," & ID & ",")>0 Then
					iForum_AllTopNum = Split(iForum_AllTopNum,",")
					For i=1 To Ubound(iForum_AllTopNum)-1
						If Cstr(Trim(iForum_AllTopNum(i)))<>Cstr(ID) Then
							If mForum_AllTopNum="" Then
								mForum_AllTopNum = iForum_AllTopNum(i)
							Else
								mForum_AllTopNum = mForum_AllTopNum & "," & iForum_AllTopNum(i)
							End If
						End If
					Next
					Dvbbs.Execute("Update Dv_Setup Set Forum_AllTopNum='"&mForum_AllTopNum&"'")
					'Dvbbs.Name="setup"
					'Dvbbs.ReloadSetup
					Dvbbs.ReloadSetupCache mForum_AllTopNum,28
				End If
				Set Rs=Nothing
			Else
				'将固顶贴ID从版面表中去除
				'查询得出原来该贴所固顶的版面
				Dim BoardTopStr,iBoardTopStr
				Set Rs=Dvbbs.Execute("Select BoardID,BoardTopStr From Dv_Board Where BoardTopStr Like '%"&ID&"%'")
				Do While Not Rs.Eof
					If Rs(1)="" Or IsNull(Rs(1)) Then
						iBoardTopStr = ""
					Else
						If InStr(","&Rs(1)&",",","&ID&",")>0 Then
							BoardTopStr = "," & Rs(1) & ","
							BoardTopStr = Split(BoardTopStr,",")
							For i = 1 To Ubound(BoardTopStr)-1
								If Cstr(Trim(BoardTopStr(i)))<>Cstr(ID) Then
									If iBoardTopStr="" Then
										iBoardTopStr = BoardTopStr(i)
									Else
										iBoardTopStr = iBoardTopStr & "," & BoardTopStr(i)
									End If
								End If								
							Next
						Else
							iBoardTopStr = Rs(1)
						End If
					End If
					Dvbbs.Execute("Update Dv_Board Set BoardTopStr='"&iBoardTopStr&"' Where BoardID="&Rs(0))
					Dvbbs.ReloadBoardInfo(Rs(0))
					BoardTopStr = ""
					iBoardTopStr = ""
				Rs.Movenext
				Loop
				Set Rs=Nothing
			End If
		End If
		If  Request.form("delupfile")="1" Then
			Call Delupfiles(Dvbbs.BoardID,ID&"|")
		Else
			'上传文件数据更新
			Dvbbs.Execute("update Dv_Upfile Set F_flag=4 Where F_BoardID="&Dvbbs.BoardID&" And F_AnnounceID LIKE  '"&ID&"|"&"%' ")
		End IF
		call LastCount(dvbbs.boardID)
		call BoardNumSub(dvbbs.boardID,1,postNum,todayNum)
		call AllboardNumSub(todayNum,postNum,1)

		Insert_Forum_Log()
		Topic_Manage_Sms()
		Dvbbs.Dvbbs_Suc(SucMsgInfo(sucmsg))
		If AllMsg<>"" Then
			Set Rs=Dvbbs.Execute("select postuserID from "&TotalUseTable&" where rootID="&ID)
			Do While Not Rs.Eof
				TopicUserID = Rs(0)
				Update_User_Point(",UserPost=UserPost-1,userDel=userDel-1")
			Rs.MoveNext
			Loop
		End If
		Set Rs=Nothing
	End Sub
	'移动帖子
	Public Sub Tmove()
		LogType=3
		Get_RequestInfo
		Dim reBoard_Setting,newboardID,newParentID,nrs,newtopic
		Set Rs=Server.CreateObject("ADODB.RecordSet")
		If Request("checked")="yes" Then
			If Request("boardID")=Request("newboardID") Then
				Dvbbs.AddErrCode(40)
				Exit Sub
			ElseIf not IsNumeric(Request("newboardID")) Then
				Dvbbs.AddErrCode(29)
				Exit Sub
			Else
				newboardID=Request("newboardID")
			End If

			'目标论坛和其上级论坛ID
			set rs=Dvbbs.Execute("select ParentStr,Board_Setting from dv_board where boardID="&newboardID)
			UpdateBoardID_1=rs(0) & "," & newboardID
			reBoard_Setting=split(rs(1),",")
			If Cint(reBoard_Setting(43))=1 Then
				Dvbbs.AddErrCode(41)
				Exit Sub
			End If
			sql="select * from dv_topic where boardID="&Dvbbs.BoardID&" and topicID="&ID
			set rs=Dvbbs.Execute(sql)
			If rs.eof and rs.bof Then
				Dvbbs.AddErrCode(32)
				Exit Sub
			Else
				If Request.form("isdispmove")="yes" Then
					newtopic=Dvbbs.CheckStr(Request.form("topic")) & "-->" & Dvbbs.MemberName & "转移"
				Else
					newtopic=Dvbbs.CheckStr(Request.form("topic"))
				End If
				If Request("leavemessage")="yes" Then
					sql="insert into dv_topic (Title,BoardID,PostUsername,PostUserID,DateAndTime,Expression,LastPost,LastPostTime,child,hits,isvote,isbest,votetotal,PostTable) values ('"&newtopic&"',"&newboardID&",'"&rs("postusername")&"',"&rs("postuserID")&",'"&rs("dateandtime")&"','"&rs("Expression")&"','"&rs("LastPost")&"','"&rs("LastPosttime")&"',"&rs("child")&","&rs("hits")&","&rs("isvote")&",0,"&rs("votetotal")&",'"&Dvbbs.NowUseBBS&"')"
					Dvbbs.Execute(sql)
				End If
			End If
	
			If Request("leavemessage")="yes" Then
				Dvbbs.Execute("update dv_topic set locktopic=1 where topicID="&ID)
				set rs=Dvbbs.Execute("select Max(topicID) from dv_topic where boardid="&newboardID)
				newparentID=rs(0)
				sql="select * from "&TotalUs

⌨️ 快捷键说明

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