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

📄 bokepostings.asp

📁 公司企业网站管理系统全站源码,用于企业内部对网站的管理
💻 ASP
📖 第 1 页 / 共 2 页
字号:
		ActMsg = "回复帖子编辑成功!"
	End If

	''CatID,sType,TopicID,PostID,IsTopic,Title,FileNote,IsLock
	If HaveUpFile = 1 THen
		Sql = "Update Dv_Boke_Upfile Set CatID="&P_Catid&",sType="&P_sType&",TopicID="&RootID&",PostID="&PostID&",IsTopic="&IsTopic&",Title='"&P_Title&"',FileNote='"&P_PostTitleNote&"',IsLock="&P_Lock&" where id in ("&P_UpFileID&")"
		DvBoke.Execute Sql
	End If

	'----------------------------------------------------------------
	Dim Node
	Set Node = DvBoke.BokeCat.selectSingleNode("xml/boketopic/rs:data/z:row[@topicid='"&RootID&"']")
	If Not (Node Is Nothing) Then
		If ParentID = 0 Then
			If P_PostTitleNote="" or IsNull(P_PostTitleNote) Then
				If Len(P_PostContent) > 250 Then
					P_PostTitleNote = SplitLines(P_PostContent,DvBoke.BokeSetting(2))
				Else
					P_PostTitleNote = P_PostContent
				End If
			End If
			P_PostTitleNote = DvCode.UbbCode(P_PostTitleNote) & "...<br/>[<a href="""&DvBoke.ModHtmlLinked&DvBoke.BokeName&".showtopic."&Rootid&".html"">阅读全文</a>]"
			Node.attributes.getNamedItem("titlenote").text = P_PostTitleNote
			Node.attributes.getNamedItem("title").text = P_Title
		End If
		Node.attributes.getNamedItem("lastposttime").text = Now()
		DvBoke.Execute("Update Dv_Boke_User set XmlData = '"&Replace(DvBoke.BokeCat.documentElement.xml,"'","''")&"' where UserID="&DvBoke.BokeUserID)
	End If
	'----------------------------------------------------------------
	Set DvCode = Nothing
	Select Case DvBoke.BokeSetting(5)
	Case "0"
		DvBoke.RefreshID = 0
	Case "1"
		DvBoke.RefreshID = -1
	Case Else
		DvBoke.RefreshID = RootID
	End Select
	DvBoke.ShowCode(ActMsg)
	DvBoke.ShowMsg(0)
End Sub

Sub Admin_SaveReply()
	If Not DvBoke.ChkPost() Then DvBoke.ShowCode(2):DvBoke.ShowMsg(0)
	Dim P_Title,P_PostContent,P_PostUserName
	Dim RootID,Topic,CatID,sCatID,Stype,TopicUserID,ParentID,TopicChild
	Dim Sql,Rs
	Dim P_UpFileID,HaveUpFile,IsTopic,IsLock

	If DvBoke.System_Setting(2)<>"1" and DvBoke.UserID=0 Then
		DvBoke.ShowCode(4)
	End If
	If Not DvBoke.IsBokeOwner and Dvboke.BokeSetting(4)="0" Then
		DvBoke.ShowCode(4)
	End If
	DvBoke.ShowMsg(0)
	'-----------------------------------------------------------------------------
	'获取表单数据 ----------------------------------------------------------------
	'-----------------------------------------------------------------------------
	P_PostUserName = DvBoke.Checkstr(Trim(Request.Form("PostUserName")))
	P_Title = DvBoke.Checkstr(Trim(Request.Form("Title")))
	P_PostContent = CheckAlipay()
	If P_PostContent = "" Then P_PostContent = DvBoke.Checkstr(Request.Form("PostContent"))
	RootID =  DvBoke.CheckNumeric(Request.Form("RootID"))
	P_UpFileID = Request.Form("upfilerename")
	IsTopic = 1
	If P_UpFileID <>"" Then
		HaveUpFile = 1
		P_UpFileID = Replace(P_UpFileID,"'","")
		P_UpFileID=Replace(P_UpFileID,";","")
		P_UpFileID=Replace(P_UpFileID,"--","")
		P_UpFileID=Replace(P_UpFileID,")","")
		Dim fixid
		fixid=Replace(P_UpFileID," ","")
		fixid=Replace(fixid,",","")
		If Not IsNumeric(fixid) or fixid="" Then HaveUpFile=0
		P_UpFileID=left(P_UpFileID,Len(P_UpFileID)-1)
	Else
		HaveUpFile=0
	End If
	If DvBoke.UserID=0 Then
		If P_PostUserName="" or CheckText(P_PostUserName)=false Then
			DvBoke.ShowCode(39)
		Else
			Dim FoundUser
			FoundUser = False
			Set Rs = DvBoke.Execute("Select * From [Dv_Boke_User] Where UserName ='"&P_PostUserName&"' or NickName='"&P_PostUserName&"'")
			If Not Rs.Eof Then
				FoundUser = True
			End If
			Set Rs = Dvbbs.Execute("Select * From [Dv_User] Where UserName ='"&P_PostUserName&"'")
			If Not Rs.Eof Then
				FoundUser = True
			End If
			Rs.CLose
			If FoundUser = True Then
				DvBoke.ShowCode(40)
			End If
		End If
	Else
		If DvBoke.UserID=DvBoke.BokeUserID Then
			P_PostUserName = DvBoke.BokeUserName
		Else
			P_PostUserName = DvBoke.UserName
		End If
	End If

	If Rootid = 0 Then
		DvBoke.ShowCode(4)
	End If
	If StrLength(P_PostContent)="" Then
		DvBoke.ShowCode(35)
	Else
		P_PostContent = Replace(P_PostContent,vbNewLine,"")
	End If
	If (Not Dvbbs.CodeIsTrue()) And DvBoke.System_Setting(5) = "1" Then
		DvBoke.ShowCode(7)
	End If
	DvBoke.ShowMsg(0)
	'-------------------------------------
	Dim DvCode
	Set DvCode = New DvBoke_UbbCode
		P_PostContent = DvCode.FormatCode(P_PostContent)
	Set DvCode = Nothing
	'-------------------------------------
	Sql = "Select Title,Userid,CatID,sCatID,Stype,IsLock,Child,LastPostTime From [Dv_Boke_Topic] Where Topicid="&Rootid
	Set Rs = server.CreateObject ("adodb.recordset")
	If Dv_Boke_InDvbbsData = 1 Then
		Rs.Open Sql,Boke_Conn,1,3
	Else
		Rs.Open Sql,Conn,1,3
	End If
	DvBoke.SqlQueryNum = DvBoke.SqlQueryNum + 1
	If Rs.Eof Then
		DvBoke.ShowCode(4)
		DvBoke.ShowMsg(0)
		Exit Sub
	Else
		Select Case Rs(5)
			Case 3 '只有作者可以回复
				If Not DvBoke.IsBokeOwner Then
					DvBoke.ShowCode(38)
				End If
			Case 2	'只有管理员和作者可以回复
				If Not (DvBoke.IsMaster or DvBoke.IsBokeOwner) Then
					DvBoke.ShowCode(38)
				End If
			Case 1	'认证
				
			Case Else
		End Select
		DvBoke.ShowMsg(0)
		TopicUserID = Rs("UserID")
		Topic = Rs("Title")
		CatID = Rs("CatID")
		sCatID = Rs("sCatID")
		Stype = Rs("Stype")
		IsLock = Rs("IsLock")
		TopicChild = Rs("Child") + 1
		Rs("Child") = TopicChild
		Rs("LastPostTime") = Now()
		Rs.Update
	End If
	Rs.Close
	Set Rs = Nothing

	Dim PostID
	ParentID = DvBoke.Execute("Select PostID From [Dv_Boke_Post] Where Rootid="&Rootid&" and ParentID=0")(0)
	SQL = "INSERT INTO [Dv_Boke_Post] (ParentID,BokeUserID,CatID,sCatID,RootID,UserID,UserName,Title,Content,JoinTime,[IP],sType,IsUpfile,IsLock) Values ("&ParentID&","&TopicUserID&"," & CatID & "," & sCatID & ","& RootID &"," & DvBoke.UserID & ",'" & P_PostUserName & "','" & P_Title & "','" & P_PostContent & "',"  & bSqlNowString & ",'"& DvBoke.UserIP &"'," & Stype & "," & HaveUpFile & ","&IsLock&")"
	DvBoke.Execute Sql
	
	PostID = DvBoke.Execute("Select Top 1 PostID From [Dv_Boke_Post] order by PostID desc")(0)
	'-----------------------------------------------------------------------------------
	'用户博客 
	Sql = "Update [Dv_Boke_User] Set PostNum=PostNum+1,TodayNum=TodayNum+1,LastUpTime="&bSqlNowString&" Where UserID="&TopicUserID
	DvBoke.Execute Sql
	'博客话题
	Sql = "Update [Dv_Boke_SysCat] Set PostNum=PostNum+1,TodayNum=TodayNum+1,LastUpTime="&bSqlNowString&" Where sCatID="&sCatID
	DvBoke.Execute Sql
	'SysCatID 更新博客所属的分类
	Sql = "Update [Dv_Boke_SysCat] Set PostNum=PostNum+1,TodayNum=TodayNum+1,LastUpTime="&bSqlNowString&" Where sCatID="&DvBoke.BokeNode.getAttribute("syscatid")
	DvBoke.Execute Sql
	'用户栏目更新
	Sql = "Update [Dv_Boke_UserCat] Set PostNum=PostNum+1,TodayNum=TodayNum+1,LastUpTime="&bSqlNowString&" Where uCatID="&Catid
	DvBoke.Execute Sql
	'博客系统
	Sql = "Update [Dv_Boke_System] Set S_TodayNum=S_TodayNum+1,S_PostNum=S_PostNum+1,S_LastPostTime="&bSqlNowString
	DvBoke.Execute Sql
	'-----------------------------------------------------------------------------------

	''CatID,sType,TopicID,PostID,IsTopic,Title,FileNote,IsLock
	If HaveUpFile = 1 THen
		Sql = "Update Dv_Boke_Upfile Set CatID="&CatID&",sType="&Stype&",TopicID="&RootID&",PostID="&PostID&",IsTopic="&IsTopic&",Title='"&P_Title&"',IsLock="&IsLock&" where id in ("&P_UpFileID&")"
		DvBoke.Execute Sql
	End If
	'----------------------------------------------------------------
	Dim Node,NodeName,Nodes
	Set Node = DvBoke.BokeCat.selectSingleNode("xml/boketopic/rs:data/z:row[@topicid='"&RootID&"']")
	If Not (Node Is Nothing) Then
		Node.attributes.getNamedItem("child").text = Node.attributes.getNamedItem("child").text + 1
		Node.attributes.getNamedItem("lastposttime").text = Now()
	End If
	Set Node = DvBoke.BokeCat.selectSingleNode("xml/rs:data/z:row[@ucatid='"&Catid&"']")
	If Not (Node Is Nothing) Then
		Node.attributes.getNamedItem("postnum").text = Node.attributes.getNamedItem("postnum").text + 1
		Node.attributes.getNamedItem("lastuptime").text = Now()
	End If
	Update_PostToXml()
	'----------------------------------------------------------------
	
	'更新系统XML数据------------
	DvBoke.Update_SysCat sCatID&","&DvBoke.BokeNode.getAttribute("syscatid"),0,1,0,1,Now()
	DvBoke.Update_System 0,1,0,0,0,1,Now()
	DvBoke.SaveSystemCache()
	'更新系统XML数据------------

	ActMsg = "回复主题《"&Topic&"》成功!"
	Select Case DvBoke.BokeSetting(5)
	Case "0"
		DvBoke.RefreshID = 0
	Case "1"
		DvBoke.RefreshID = -1
	Case Else
		DvBoke.RefreshID = RootID
	End Select
	'Update_BokeTopic TopicChild,RootID,TopicUserID
	DvBoke.ShowCode(ActMsg)
	DvBoke.ShowMsg(0)
End Sub

'更新首页评论数据
Sub Update_PostToXml()
	Dim Node,XmlDoc,NodeList,ChildNode
	Set Node = DvBoke.BokeCat.selectNodes("xml/bokepost")
	If Node.Length>0 Then
		For Each NodeList in Node
			DvBoke.BokeCat.DocumentElement.RemoveChild(NodeList)
		Next
	End If
	Set Node=DvBoke.BokeCat.createNode(1,"bokepost","")
	Set XmlDoc=Server.CreateObject("Msxml2.FreeThreadedDOMDocument")
	If Not IsNumeric(DvBoke.BokeSetting(3)) Then DvBoke.BokeSetting(3) = "10"
	Dim Rs,Sql
	Sql = "Select Top "&DvBoke.BokeSetting(3)&" PostID,CatID,sCatID,ParentID,RootID,UserID,UserName,Title,Content,JoinTime,IP,sType From [Dv_Boke_Post] Where  BokeUserID="&DvBoke.BokeUserID&" and ParentID>0 and sType <>2 order by JoinTime desc"
	Set Rs = DvBoke.Execute(LCase(Sql))
	If Not Rs.Eof Then
		Rs.Save XmlDoc,1
		XmlDoc.documentElement.RemoveChild(XmlDoc.documentElement.selectSingleNode("s:Schema"))
		Set ChildNode = XmlDoc.documentElement.selectNodes("rs:data/z:row")
		For Each NodeList in ChildNode
			NodeList.attributes.getNamedItem("jointime").text = Rs("JoinTime")
			NodeList.attributes.getNamedItem("content").text = Left(Rs("content")&"",50)
			Rs.MoveNext
		Next
		Set ChildNode=XmlDoc.documentElement.selectSingleNode("rs:data")
		Node.appendChild(ChildNode)
	End If
	Rs.Close
	Set Rs = Nothing
	DvBoke.BokeCat.documentElement.appendChild(Node)
	DvBoke.Execute("Update Dv_Boke_User set XmlData = '"&Replace(DvBoke.BokeCat.documentElement.xml,"'","''")&"' where UserID="&DvBoke.BokeUserID)
End Sub

'删除操作
Sub Admin_delete()
	If DvBoke.UserID = 0 Then
		DvBoke.ShowCode(14)
	End If
	Dim Rootid,PostID,IsUpfile
	Rootid = DvBoke.CheckNumeric(Request.QueryString("Rootid"))
	PostID = DvBoke.CheckNumeric(Request.QueryString("Postid"))
	If Rootid = 0 or PostID=0 Then
		DvBoke.ShowCode(4)
	End If
	DvBoke.ShowMsg(0)
	Dim Rs,Sql
	Dim ParentID,CatID,sCatID,Title,CountNum,TopicNum,sType
	Sql = "Select PostID,CatID,sCatID,ParentID,RootID,UserID,Title,sType,IsUpfile From [Dv_Boke_Post] Where PostID="&PostID
	Set Rs = DvBoke.Execute(Sql)
	If Rs.Eof Then
		DvBoke.ShowCode(4)
		DvBoke.ShowMsg(0)
		Exit Sub
	End If
	If Not (DvBoke.IsBokeOwner or DvBoke.IsMaster) Then
		If Rs(5)<>DvBoke.UserID or Rs(5)=0 Then
			DvBoke.ShowCode(36)
			DvBoke.ShowMsg(0)
		End If
	End If

	Rootid = Rs("Rootid")
	ParentID = Rs("ParentID")
	CatID = Rs("CatID")
	sCatID = Rs("sCatID")
	sType = Rs("sType")
	IsUpfile = Rs("IsUpfile")
	Rs.Close
	Set Rs=Nothing
	Dim DTodayNum,DayStr
	DTodayNum = 0
	If Dv_Boke_DataBase = 1 Then
		DayStr = "d"
	Else
		DayStr = "'d'"
	End If
	Dim Num_T,Num_F,Num_L,Num_P
	Num_T=0
	Num_F=0
	Num_L=0
	Num_P=0
	Title = DvBoke.Execute("Select title From [Dv_Boke_Topic] Where TopicID="&Rootid)(0)
	If ParentID = 0 Then
		TopicNum = 1
		CountNum = DvBoke.Execute("Select Count(*) From [Dv_Boke_Post] Where ParentID>0 and RootID="&Rootid)(0)
		DTodayNum = DvBoke.Execute("Select Count(*) From [Dv_Boke_Post] Where RootID="&Rootid&" and datediff("&DayStr&",JoinTime,"&bSqlNowString&")=0 ")(0)
		Set Rs=DvBoke.Execute("Select * From Dv_Boke_Post Where RootID="&RootID)
		Do While Not Rs.Eof
			If Rs("IsUpfile")=1 Then DvBoke.SysDeleteFile(Rs("PostID"))
		Rs.MoveNext
		Loop
		Rs.Close:Set Rs=Nothing
		Sql = "Delete From Dv_Boke_Topic Where TopicID="&Rootid
		DvBoke.Execute(Sql)
		Sql = "Delete From [Dv_Boke_Post] Where RootID="&Rootid
		DvBoke.Execute(Sql)
		ActMsg = "主题《"& Title &"》删除成功!"
	Else
		TopicNum = 0
		CountNum = 1
		DTodayNum = DvBoke.Execute("Select Count(*) From [Dv_Boke_Post] Where PostID="&PostID&" and datediff("&DayStr&",JoinTime,"&bSqlNowString&")=0 ")(0)
		If IsUpfile=1 Then DvBoke.SysDeleteFile(PostID)
		Sql = "Delete From [Dv_Boke_Post] Where PostID="&PostID
		DvBoke.Execute(Sql)
		Sql = "Update [Dv_Boke_Topic] Set Child = Child - 1 Where TopicID="&Rootid
		DvBoke.Execute Sql
		ActMsg = "主题《"& Title &"》回复评论删除成功!"
	End If
	Select Case sType
		Case 0
			Num_T = TopicNum
		Case 1
			Num_F = TopicNum
		Case 2
			Num_L = TopicNum
		Case 4
			Num_P = TopicNum
	End Select
	Sql = "Update [Dv_Boke_User] Set TopicNum = TopicNum - "&Num_T&",FavNum=FavNum - "&Num_F&",PhotoNum=PhotoNum - "&Num_P&",PostNum= PostNum -"&CountNum&",TodayNum=TodayNum - "&DTodayNum&" Where UserID="&DvBoke.BokeUserID
	DvBoke.Execute Sql
	Sql = "Update [Dv_Boke_SysCat] Set TopicNum = TopicNum - "&TopicNum&" ,PostNum=PostNum-"&CountNum&",TodayNum=TodayNum-"&DTodayNum&" Where sCatID in ("&sCatID&","&DvBoke.BokeNode.getAttribute("syscatid")&")"
	DvBoke.Execute Sql

	Sql = "Update [Dv_Boke_UserCat] Set TopicNum = TopicNum - "&TopicNum&" ,PostNum=PostNum-"&CountNum&",TodayNum=TodayNum-"&DTodayNum&" Where uCatID="&Catid
	DvBoke.Execute Sql
	Sql = "Update [Dv_Boke_System] Set S_PostNum = S_PostNum-"&CountNum&",S_TopicNum=S_TopicNum- "&Num_T&",S_PhotoNum=S_PhotoNum-"&Num_P&",S_FavNum=S_FavNum- "&Num_F&",S_TodayNum=S_TodayNum-"&DTodayNum
	DvBoke.Execute Sql
	Update_PostToXml()
	DvBoke.LoadSetup(1)
	DvBoke.ShowCode(ActMsg)
	DvBoke.ShowMsg(0)
End Sub

'精华管理
Sub Admin_isbest()
	If DvBoke.UserID = 0 Then
		DvBoke.ShowCode(14)
	End If
	Dim Rootid
	Rootid = DvBoke.CheckNumeric(Request.QueryString("Rootid"))
	If Rootid = 0 Then
		DvBoke.ShowCode(4)
	End If
	DvBoke.ShowMsg(0)
	Dim Rs,Sql
	Sql = "Select UserID,IsBest,Title From Dv_Boke_Topic Where Topicid="&Rootid
	Set Rs = server.CreateObject ("adodb.recordset")
	If Dv_Boke_InDvbbsData = 1 Then
		Rs.Open Sql,Boke_Conn,1,3
	Else
		Rs.Open Sql,Conn,1,3
	End If
	DvBoke.SqlQueryNum = DvBoke.SqlQueryNum + 1
	If Rs.Eof Then
		DvBoke.ShowCode(4)
		DvBoke.ShowMsg(0)
		Exit Sub
	Else
		If Rs(0)<>DvBoke.UserID and Not DvBoke.IsMaster Then
			DvBoke.ShowCode(36)
			DvBoke.ShowMsg(0)
		End If
		If Rs("IsBest")=0 Then
			Rs("IsBest")=1
			ActMsg = "主题《"&Rs(2)&"》添加为精华成功!"
		Else
			Rs("IsBest")=0
			ActMsg = "精华主题《"&Rs(2)&"》解除成功!"
		End If
		Rs.Update
	End If
	Rs.Close
	Set Rs = Nothing
	DvBoke.ShowCode(ActMsg)
	DvBoke.ShowMsg(0)
End Sub
%>

⌨️ 快捷键说明

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