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

📄 admin_postings.asp

📁 公司企业网站管理系统全站源码,用于企业内部对网站的管理
💻 ASP
📖 第 1 页 / 共 5 页
字号:
		Dim msginfo
		If newincept(username)>0 Then
			msginfo=newincept(username) & "||" & inceptid(1,username) & "||" & inceptid(2,username)
		Else
			msginfo="0||0||null"
		End If
		Dvbbs.Execute("Update [Dv_User] Set UserMsg='"&dvbbs.CheckStr(msginfo)&"' Where username='"&dvbbs.CheckStr(username)&"'")
	End Function
	'统计留言
	Public Function newincept(iusername)
		Dim rs
		Rs=Dvbbs.Execute("Select Count(id) From Dv_Message Where flag=0 and issend=1 and delR=0 And incept='"& iusername &"'")
		newincept=Rs(0)
		Set Rs=Nothing
		If IsNull(newincept) Then newincept=0
	End Function
	Public Function inceptid(stype,iusername)
		Dim ars
		set ars=Dvbbs.Execute("Select top 1 id,sender From Dv_Message Where flag=0 and issend=1 and delR=0 And incept ='"& iusername &"'")
		if stype=1 then
			inceptid=ars(0)
		else
			inceptid=ars(1)
		end if
		set ars=nothing
	End Function
	'判断是否为帖子最后回复
	Public Function isLastPost()
		Dim LastTopic,body,LastRootID,LastPostTime,LastPostUser
		Dim LastPost,uploadpic_n,LastPostUserID,LastID
		isLastPost=False
		'取得当前主题最后回复ID
		Set Rs=Dvbbs.Execute("select LastPost from Dv_topic where topicID="&ID)
		If not (rs.eof and rs.bof) Then
			If not isnull(rs(0)) and rs(0)<>"" Then
				If Clng(split(rs(0),"$")(1))=Clng(replyID) Then isLastPost=True
			End If
		End If
		If isLastPost Then
			Set Rs=Dvbbs.Execute("select top 1 topic,body,AnnounceID,dateandtime,username,PostUserID,rootID,boardID from "&TotalUseTable&" where BoardID="&Dvbbs.BoardID&" And rootID="&ID&" order by AnnounceID desc")
			If not(rs.eof and rs.bof) Then
				body=rs(1)
				LastRootID=rs(2)
				LastPostTime=rs(3)
				LastPostUser=replace(rs(4),"$","")
				LastTopic=left(replace(body,"$",""),20)
				LastPostUserID=rs(5)
				LastID=rs(6)
				Dvbbs.BoardID=rs(7)
			Else
				LastTopic="无"
				LastRootID=0
				LastPostTime=now()
				LastPostUser="无"
				LastPostUserID=0
				LastID=0
				Dvbbs.BoardID=0
			End If
			set rs=nothing
			LastPost=LastPostUser & "$" & LastRootID & "$" & LastPostTime & "$" & replace(left(Dvbbs.Replacehtml(LastTopic),20),"$","") & "$" & uploadpic_n & "$" & LastPostUserID & "$" & LastID & "$" & Dvbbs.BoardID
			Dvbbs.Execute("update Dv_topic set LastPost='"&LastPost&"' where topicID="&ID)
		End If
	End Function
	'更新帖子最后回复信息 2005-1-12 Dv.Yz
	Public Function FixLastPost()
		Dim LastTopic,body,LastRootID,LastPostTime,LastPostUser
		Dim LastPost,uploadpic_n,LastPostUserID,LastID
		Set Rs = Dvbbs.Execute("SELECT TOP 1 Topic, Body, AnnounceID, Dateandtime, Username, PostUserID, RootID, BoardID ,signflag FROM " & TotalUseTable & " WHERE BoardID = " & Dvbbs.BoardID & " AND RootID = " & ID & " ORDER BY AnnounceID DESC")
		If Not(Rs.Eof And Rs.Bof) Then
			Body = Rs(1)
			LastRootID = Rs(2)
			LastPostTime = Rs(3)
			If Rs(8)=2 Then
				LastPostUser = "匿名用户"
			Else
				LastPostUser = Replace(Rs(4),"$","")
			End If
			LastTopic = Left(Replace(Body,"$",""),20)
			LastPostUserID = Rs(5)
			LastID = Rs(6)
			Dvbbs.BoardID = Rs(7)
		Else
			LastTopic = "无"
			LastRootID = 0
			LastPostTime = Now()
			LastPostUser = "无"
			LastPostUserID = 0
			LastID = 0
			Dvbbs.BoardID = 0
		End If
		Set Rs = Nothing
		LastPost = LastPostUser & "$" & LastRootID & "$" & LastPostTime & "$" & Replace(left(Dvbbs.Replacehtml(LastTopic),20),"$","") & "$" & Uploadpic_n & "$" & LastPostUserID & "$" & LastID & "$" & Dvbbs.BoardID
		Dvbbs.Execute("UPDATE Dv_Topic SET LastPost = '" & LastPost & "' WHERE TopicID = " & ID)
	End Function
	'更新指定论坛信息
	Public Function LastCount(boardID)
		Dim LastTopic,body,LastRootID,LastPostTime,LastPostUser
		Dim LastPost,uploadpic_n,LastpostuserID,LastID
		set rs=Dvbbs.Execute("select top 1 T.title,b.AnnounceID,b.dateandtime,b.username,b.postuserID,b.rootID from "&dvbbs.NowUseBBS&" b inner join dv_Topic T on b.rootID=T.TopicID where b.boardID="&boardID&" order by b.announceID desc")
		If not(rs.eof and rs.bof) Then
			Lasttopic=replace(left(Dvbbs.Replacehtml(rs(0)),15),"$","")
			LastRootID=rs(1)
			LastPostTime=rs(2)
			LastPostUser=rs(3)
			LastPostUserID=rs(4)
			LastID=rs(5)
		Else
			LastTopic="无"
			LastRootID=0
			LastPostTime=now()
			LastPostUser="无"
			LastPostUserID=0
			LastID=0
		End If
		set rs=nothing

		LastPost=LastPostUser & "$" & LastRootID & "$" & LastPostTime & "$" & LastTopic & "$" & uploadpic_n & "$" & LastPostUserID & "$" & LastID & "$" & BoardID
		Dim SplitUpBoardID,SplitLastPost
		SplitUpBoardID=split(UpdateBoardID,",")
		For i=0 to ubound(SplitUpBoardID)
			set rs=Dvbbs.Execute("select LastPost from dv_board where boardID="&SplitUpBoardID(i))
			If not (rs.eof and rs.bof) Then
				SplitLastPost=split(rs(0),"$")
				If IsNumeric(LastRootID) and IsNumeric(SplitLastPost(1)) Then
					If ubound(SplitLastPost)=7 and clng(LastRootID)<>clng(SplitLastPost(1)) Then
						Dvbbs.Execute("update dv_board set LastPost='"&LastPost&"' where boardID="&SplitUpBoardID(i))
						If  IsObject(Application(Dvbbs.CacheName &"_information_" & SplitUpBoardID(i))) Then
							Application(Dvbbs.CacheName &"_information_" & SplitUpBoardID(i)).documentElement.selectSingleNode("information/@lastpost_0").text=LastPostUser
							Application(Dvbbs.CacheName &"_information_" & SplitUpBoardID(i)).documentElement.selectSingleNode("information/@lastpost_1").text=LastRootID
							Application(Dvbbs.CacheName &"_information_" & SplitUpBoardID(i)).documentElement.selectSingleNode("information/@lastpost_2").text=LastPostTime
							Application(Dvbbs.CacheName &"_information_" & SplitUpBoardID(i)).documentElement.selectSingleNode("information/@lastpost_3").text=LastTopic
							Application(Dvbbs.CacheName &"_information_" & SplitUpBoardID(i)).documentElement.selectSingleNode("information/@lastpost_4").text=uploadpic_n 
							Application(Dvbbs.CacheName &"_information_" & SplitUpBoardID(i)).documentElement.selectSingleNode("information/@lastpost_5").text=LastPostUserID
							Application(Dvbbs.CacheName &"_information_" & SplitUpBoardID(i)).documentElement.selectSingleNode("information/@lastpost_6").text=LastID
							Application(Dvbbs.CacheName &"_information_" & SplitUpBoardID(i)).documentElement.selectSingleNode("information/@lastpost_7").text=BoardID
						End If
					End If
				End If
			End If
		Next
		Set Rs=Nothing
	End Function

	'版面发帖数增加
	Public Sub BoardNumAdd(boardID,topicNum,postNum,todayNum)
		Dvbbs.Execute("update dv_board set postnum=postnum+"&postNum&",topicNum=topicNum+"&topicNum&",todayNum=todayNum+"&todayNum&" where boardID in ("&UpdateBoardID&")")
		'Dvbbs.ReloadBoardInfo(UpdateBoardID)
	End Sub
	
	'版面发帖数减少
	Public Sub BoardNumSub(boardID,topicNum,postNum,todayNum)
		Dvbbs.Execute("update dv_board set postnum=postnum-"&postNum&",topicNum=topicNum-"&topicNum&",todayNum=todayNum-"&todayNum&" where boardID in ("&UpdateBoardID&")")
		Dim trs,LastPostTime,LastpostuserID,Lastid,uploadpic_n
		Set trs=Dvbbs.Execute("select top 1 T.title,b.Announceid,b.dateandtime,b.username,b.postuserid,b.rootid from "&Dvbbs.NowUseBBS&" b inner join dv_Topic T on b.rootid=T.TopicID where b.boardid="&boardid&" order by b.Announceid desc")
		If not(trs.eof and trs.bof) Then
			Lasttopic=replace(left(Dvbbs.Replacehtml(trs(0)),15),"$","")
			LastRootid=trs(1)
			LastPostTime=trs(2)
			LastPostUser=trs(3)
			LastPostUserid=trs(4)
			Lastid=trs(5)
		else
			LastTopic="无"
			LastRootid=0
			LastPostTime=now()
			LastPostUser="无"
			LastPostUserid=0
			Lastid=0
		End If
		trs.close
		Set trs=nothing	
		LastPost=LastPostUser & "$" & LastRootid & "$" & LastPostTime & "$" & LastTopic & "$" & uploadpic_n & "$" & LastPostUserID & "$" & LastID & "$" & BoardID
	End Sub
	
	'所有论坛发帖数增加
	Public Function AllboardNumAdd(todayNum,postNum,topicNum)
		Dvbbs.Execute("Update dv_Setup Set Forum_TodayNum=Forum_todayNum+"&todaynum&",Forum_PostNum=Forum_PostNum+"&postNum&",Forum_TopicNum=Forum_topicNum+"&TopicNum)
		Dvbbs.ReloadSetupCache CLng(Dvbbs.CacheData(7,0))+TopicNum,7
		Dvbbs.ReloadSetupCache CLng(Dvbbs.CacheData(8,0))+postNum,8
		Dvbbs.ReloadSetupCache CLng(Dvbbs.CacheData(9,0))+todaynum,9
	End Function

	'所有论坛发帖数减少
	Public Function AllboardNumSub(todayNum,postNum,topicNum)
		Dvbbs.Execute("Update dv_Setup Set Forum_TodayNum=Forum_TodayNum-"&todaynum&",Forum_PostNum=Forum_PostNum-"&postNum&",Forum_TopicNum=Forum_TopicNum-"&TopicNum)
		Dvbbs.ReloadSetupCache CLng(Dvbbs.CacheData(7,0))-TopicNum,7
		Dvbbs.ReloadSetupCache CLng(Dvbbs.CacheData(8,0))-postNum,8
		Dvbbs.ReloadSetupCache CLng(Dvbbs.CacheData(9,0))-todaynum,9
	End Function

	Public Sub Get_RequestInfo()
		sucmsg=""
		title=Dvbbs.htmlencode(Request.form("title"))
		content=Dvbbs.htmlencode(Request.form("content"))
		content="理由:" & title & content
		If Request.form("title")="" and Request.form("content")="" Then
			Dvbbs.AddErrCode(39)
			Dvbbs.ShowErr()
		End If
		sucmsg=ActionInfo&"《"&server.htmlencode(topic)&"》,"&server.htmlencode(content)& ","&allmsg&""
	End Sub

	Private Function SucMsgInfo(GetMsg)
		SucMsgInfo="<li>"+GetMsg
		SucMsgInfo=SucMsgInfo+"<li>"+"<a href=index.asp?boardid="&Dvbbs.boardid&">返回论坛列表</a>"
		SucMsgInfo=SucMsgInfo+"<li>"+"<a href=dispbbs.asp?boardid="&Dvbbs.boardid&"&id="&ID&" >返回主题:《"&server.htmlencode(Topic)&"》</a>"
	End Function

	'专题管理操作
	Public Sub TopicMode()
	Dim ModeID
	ModeID=Request.Form("mode")
	If Request.form("title")="" and Request.form("content")="" Then
		Dvbbs.AddErrCode(39)
		Exit Sub
	End If

	If ModeID<>"" And IsNumeric(ModeID) Then
	LogType=5
	Get_RequestInfo
	ModeID=Cint(ModeID)
	DVbbs.Execute("Update Dv_Topic Set Mode="&ModeID&" Where BoardID="&Dvbbs.BoardID&" And TopicID=" & ID)
	Insert_Forum_Log()
	Update_User_Point("")
	Topic_Manage_Sms()
	Dvbbs.Dvbbs_Suc(SucMsgInfo(sucmsg))
	Else
		title=Dvbbs.htmlencode(Request.form("title"))
		content=Dvbbs.htmlencode(Request.form("content"))
		content=title & content
		Dim BoardTopic,SelectBoardTopic,TempStr
		BoardTopic=Split(Dvbbs.Board_Setting(48),"$$")
		If Ubound(BoardTopic)>0 Then
			For i=0 to Ubound(BoardTopic)-1
				SelectBoardTopic=SelectBoardTopic+"<option value="&(i+1)
				SelectBoardTopic=SelectBoardTopic+" >"&BoardTopic(i)&"</option>"
			Next
		End If
		TempStr = template.html(4)
		TempStr = Replace(TempStr,"{$reaction}",request("action"))
		TempStr = Replace(TempStr,"{$boardid}",Request("boardID"))
		TempStr = Replace(TempStr,"{$id}",Request("ID"))
		TempStr = Replace(TempStr,"{$title}",content)
		TempStr = Replace(TempStr,"{$doWealth}",doWealth)
		TempStr = Replace(TempStr,"{$dousercp}",dousercp)
		TempStr = Replace(TempStr,"{$douserep}",douserep)
		TempStr = Replace(TempStr,"{$msg}",Request.form("msg"))
		TempStr = Replace(TempStr,"{$ismsg}",Request.form("ismsg"))
		TempStr = Replace(TempStr,"{$TopicMode}",SelectBoardTopic)
		Response.Write TempStr
	End If
	End Sub

	'锁定帖子
	Public Sub lock()
		LogType=5
		Get_RequestInfo
		Dvbbs.Execute("Update Dv_topic Set locktopic=1 where boardID="&Dvbbs.boardID&" and topicID="&ID)
		Insert_Forum_Log()
		Update_User_Point("")
		Topic_Manage_Sms()
		Dvbbs.Dvbbs_Suc(SucMsgInfo(sucmsg))
	End Sub
	'解除锁定帖子
	Public Sub unlock()
		LogType=3
		Get_RequestInfo
		Dvbbs.Execute("Update Dv_topic Set locktopic=0 where boardID="&Dvbbs.boardID&" and topicID="&ID)
		Insert_Forum_Log()
		Update_User_Point("")
		Topic_Manage_Sms()
		Dvbbs.Dvbbs_Suc(SucMsgInfo(sucmsg))
	End Sub

	'提升帖子
	Public Sub uptopic()
		LogType=3
		Get_RequestInfo
		Dvbbs.Execute("Update dv_topic set LastPostTime="&SqlNowString&" where boardID="&Dvbbs.BoardID&" and IsTop=0 and topicID="&ID)
		Insert_Forum_Log()
		Update_User_Point("")
		Topic_Manage_Sms()
		Dvbbs.Dvbbs_Suc(SucMsgInfo(sucmsg))
	End Sub
	'沉底帖子
	Public Sub downtopic()
		LogType=3
		Get_RequestInfo
		If IsSqlDataBase=1 Then
			Dvbbs.Execute("Update dv_topic set LastPostTime=dateadd(day,-100,LastPostTime) where boardID="&Dvbbs.BoardID&" and IsTop=0 and topicID="&ID)
		Else
			Dvbbs.Execute("Update dv_topic set LastPostTime=dateadd('d',-100,LastPostTime) where boardID="&Dvbbs.BoardID&" and IsTop=0 and topicID="&ID)
		End If
		Insert_Forum_Log()
		Update_User_Point("")
		Topic_Manage_Sms()
		Dvbbs.Dvbbs_Suc(SucMsgInfo(sucmsg))
	End Sub
	'固顶帖子,包括总固顶、区固顶和固顶
	Public Sub Getistop()
		Dim IsTop
		Dim iForum_AllTopNum,mForum_AllTopNum
		Dim getBoard,BoardTopStr,iBoardTopStr,UpBoardID
		Dim Bn
		LogType=4
		Get_RequestInfo
		If Request("getboard")<>"" Then	'防止注入 by Dv.ADRX
			If Not IsNumeric(Replace(Request("getboard")," ","")) Then
				Dvbbs.AddErrCode(18)
				Exit Sub
			End If
		End If
		If Request("istopaction")="1" Then
			'------------------------------------------------------------------------------------
			'如果等级是斑主,需要判断是否有该版的管理权限 Fssunwin
			If Dvbbs.UserGroupID = 3 and Trim(Request("getboard"))<>"" Then
				Dim CanMsterBoardID
				CanMsterBoardID = GetBoardMsterID(Dvbbs.MemberName)
				If CanMsterBoardID="" Then
					Dvbbs.AddErrCode(28)
					Exit Sub
				End If
				GetBoard = Split(Replace(Request("getboard")," ",""),",")
				For i=0 To Ubound(GetBoard)
					If InStr("," & CanMsterBoardID & ",", "," & GetBoard(i) & ",")=0 Then
						Dvbbs.AddErrCode(28)
						Exit Sub
					End If
				Next
			End If
			'------------------------------------------------------------------------------------
			'如果原来是固顶、区域固顶或总固顶,判断其是否有需要清理数据
			Set Rs=Dvbbs.Execute("Select IsTop From Dv_Topic Where TopicID="& ID)
			IsTop = Rs(0)
			'如果有总固顶需要清理
			If IsTop = 3 And Request("alltop")="" And CanTopTopic_a Then

⌨️ 快捷键说明

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