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

📄 bbspost.asp

📁 请认真阅读您的文件包然后写出其具体功能(至少要20个字)。尽量不要让站长把时间都花费在为您修正说明上。压缩包解压时不能有密码。
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="conn.asp"-->
<!--#include file="inc/const.asp"-->
<%
if cint(anysale.asGroups(10))=0 then call anysale.asNote("权限出错","你所在的用户组没有浏览论坛的权限!") end if

dim action,subAct,title,rs,sql,upID
dim channelID,ID,lastPost,parentID,rootID,layer,orders,toarticle
dim bbsFront,bbsTitle,bbsTags,bbsEmot,bbsDetail
if request("channelID")="" or not isnumeric(request("channelID")) then
	call anysale.asNote("访问出错","参数不正确,请返回重新访问!")
else
	channelID=request("channelID")
end if
ID=request("ID")
action=request("action")
select case action
	case "reply"
		if anysale.userID="" then call anysale.asNote("未登录或登录超时","你未登录或登录超时,请登录后再进行相关操作。") end if
		
		if request("ID")="" or not isnumeric(request("ID")) then
			call anysale.asNote("访问出错","参数不正确,请选择要回复的帖子!")
		else
			ID=request("ID")
			set rs=conn.execute("select title from as_bbslist where bbsID="&ID)
			if rs.eof or rs.bof then
				call anysale.asNote("访问出错","参数不正确,请返回重新访问!")
			else
				bbsTitle="回复:"&rs(0)
			end if
			rs.close
			set rs=nothing
		end if
		title="回复帖子"
		bbsEmot="images/emot/emot1.gif"
		subAct="Reply"
		parentID=1
		if request("quote")<>"" then
			set rs=conn.execute("select username,addtime,detail from as_bbs where islock=0 and bbsID="&request("quote"))
			if not (rs.bof or rs.eof) then
				bbsDetail="<div class=""quote""><strong>以下是引用<em>"&rs(0)&"</em>在"&rs(1)&"的发言:</strong><br />"&rs(2)&"</div><br />"
			end if
			rs.close:set rs=nothing
		end if
		if cint(anysale.asGroups(34))=0 then
			anysale.errWin("<li>你所在的用户组没有回复帖子的权限。</li>")
		elseif cint(anysale.asGroups(35))>0 and cint(anysale.userInfo(9))>=cint(anysale.asGroups(35)) then
			anysale.errWin("<li>你所在的用户组已超过回复帖子"&cint(anysale.asGroups(35))&"条的总数。</li>")		
		else
			call main()
		end if
	case "saveReply"
		anysale.chkUser()
		
		title="保存回复"
		set rs=conn.execute("select bbsID from as_bbs where parentID=0 and layer=1 and rootID="&ID)
		if not (rs.bof and rs.eof) then
			parentID=rs(0)
		else
			call anysale.asNote("访问出错","参数不正确,请返回重新访问!")
		end if
		set rs=conn.execute("select max(layer) from as_bbs where rootID="&ID)
			layer=rs(0)+1
		set rs=conn.execute("select max(orders) from as_bbs where rootID="&ID)
			orders=rs(0)+1
		rs.close:set rs=nothing

		sql="insert into as_bbs (userID,username,channelID,userIP,parentID,rootID,layer,orders,front,emot,title,detail) values ("&anysale.userID&",'"&anysale.username&"',"&channelID&",'"&anysale.userTrueIP&"',"&parentID&","&ID&","&layer&","&orders&",'"&request.form("front")&"','"&trim(request.form ("emot"))&"','"&anysale.checkStr(trim(request.form ("title")))&"','"&anysale.checkStr(trim(request.form ("detail")))&"')"
		conn.execute(sql)
		call anysale.setValue("as_user","userInfo","userID="&anysale.userID,9,clng(anysale.userInfo(9))+1)	'用户帖子加
		call anysale.setValue("as_config","siteInfo","",11,clng(anysale.siteInfo(11))+1)	'系统帖子加
		call anysale.setMoney(cint(anysale.asMoney(8)),"userID="&anysale.userID)	'用户金钱加
		
		set rs= Server.CreateObject("ADODB.Recordset")
		sql="select bbsID from as_bbs where rootID="&ID&" and channelID="&channelID&" order by bbsID desc"
		rs.open sql,conn,1
		rs.pageSize = 10
		lastPost= anysale.formatDate(now(),6)&"|"&ID&"|"&rs.pageCount&"|"&rs(0)&"|"&anysale.username&"|"&anysale.nickname
		response.write"<div class=""line25"" style=""padding:20px 50px;"">&nbsp;<div><a href=""bbs.asp"">返回论坛</a></div><div><a href=""bbslist.asp?channelID="&channelID&""">返回目录</a></div><div><a href=""bbsdetail.asp?ID="&ID&"&amp;page="&rs.pageCount&"#"&rs(0)&""">您回复的帖子</a></div></div>"
		rs.close:set rs=nothing
		conn.execute("update as_bbslist set child=child+1,lastPost='"&lastPost&"' where bbsID="&ID)
		
		upID=anysale.getValue("as_bbs","bbsID","userID="&anysale.userID&" order by bbsID desc")
		conn.execute("update as_upfile set ID="&clng(upID)&" where userID="&anysale.userID&" and [group]=8 and ID=0")
	case "edit"
		if anysale.userID="" then call anysale.asNote("未登录或登录超时","你未登录或登录超时,请登录后再进行相关操作。") end if
		
		title="编辑帖子"
		subAct="Edit"
		set rs=conn.execute("select front,title,emot,detail,parentID,rootID from as_bbs where username='"&anysale.username&"' and bbsID="&ID)
		if not (rs.bof and rs.eof) then
			bbsFront=rs(0)
			bbsTitle=rs(1)
			bbsEmot=rs(2)
			bbsDetail=rs(3)
			parentID=rs(4)
			rootID=rs(5)
		else
			call anysale.asNote("访问出错","参数不正确,请返回重新访问!")
		end if
		rs.close:set rs=nothing
		if parentID=0 then
			bbsTags=anysale.getValue("as_bbslist","tags","bbsID="&clng(rootID))
		end if
		
		call main()
	case "saveEdit"
		anysale.chkUser()
		
		conn.execute("update as_bbs set front='"&trim(request.form ("front"))&"',emot='"&trim(request.form ("emot"))&"',title='"&anysale.checkStr(trim(request.form ("title")))&"',detail='"&anysale.checkStr(trim(request.form ("detail")))&"' where bbsID="&ID)
		rootID=anysale.getValue("as_bbs","rootID","bbsID="&ID)
		if request("parentID")=0 then
			conn.execute("update as_bbslist set front='"&trim(request.form ("front"))&"',title='"&anysale.checkStr(trim(request.form ("title")))&"',tags='"&anysale.checkStr(trim(request.form ("tags")))&"',intro='"&anysale.cutStr(anysale.clearHTML(anysale.checkStr(trim(request.form ("detail")))),100)&"' where bbsID="&rootID)
		end if
		
		conn.execute("update as_upfile set ID="&clng(ID)&" where userID="&anysale.userID&" and [group]=8 and ID=0")
				
		response.write"<div class=""line25"" style=""padding:20px 50px;""><div><a href=""bbs.asp"">返回论坛</a></div><div><a href=""bbslist.asp?channelID="&channelID&""">返回目录</a></div><div><a href=""bbsdetail.asp?ID="&rootID&"&amp;page="&request("page")&"#"&ID&""">您编辑的帖子</a></div></div>"
	case "saveAdd"
		anysale.chkUser()
		
		title="保存帖子"
		if request("toarticle")=1 then toarticle=1 else toarticle=0 end if
		sql="insert into as_bbslist (userID,username,nickname,channelID,front,title,tags,intro,toarticle) values ("&anysale.userID&",'"&anysale.username&"','"&anysale.nickname&"',"&channelID&",'"&request.form("front")&"','"&anysale.checkStr(trim(request.form ("title")))&"','"&anysale.checkStr(trim(replace(request.form ("tags"),",",",")))&"','"&anysale.cutStr(anysale.clearHTML(anysale.checkStr(trim(request.form ("detail")))),100)&"',"&toarticle&")"
		conn.execute(sql)
		
		rootID=anysale.getValue("as_bbslist","top 1 bbsID","userID="&anysale.userID&" order by bbsID desc")
		sql="insert into as_bbs (userID,username,channelID,userIP,parentID,rootID,layer,orders,front,emot,title,detail) values ("&anysale.userID&",'"&anysale.username&"',"&channelID&",'"&anysale.userTrueIP&"',0,"&rootID&",1,0,'"&request.form("front")&"','"&trim(request.form ("emot"))&"','"&anysale.checkStr(trim(request.form ("title")))&"','"&anysale.checkStr(trim(request.form ("detail")))&"')"
		conn.execute(sql)
		
		call anysale.setValue("as_user","userInfo","userID="&anysale.userID,8,clng(anysale.userInfo(8))+1)'主题加
		call anysale.setValue("as_user","userInfo","userID="&anysale.userID,9,clng(anysale.userInfo(9))+1)'帖子加
		call anysale.setValue("as_config","siteInfo","",10,clng(anysale.siteInfo(10))+1)	'系统主题加
		call anysale.setValue("as_config","siteInfo","",11,clng(anysale.siteInfo(11))+1)	'系统帖子加
		call anysale.setMoney(cint(anysale.asMoney(3)),"userID="&anysale.userID)	'用户金钱加
		
		'帖子最新	
		ID=anysale.getValue("as_bbs","top 1 bbsID","userID="&anysale.userID&" order by bbsID desc")	
		lastPost= anysale.formatDate(now(),6)&"|"&rootID&"|1|"&ID&"|"&anysale.username&"|"&anysale.nickname
		conn.execute("update as_bbslist set lastPost='"&lastPost&"' where bbsID="&rootID)
	
		'版块最新
		dim rsc,rspath,parentStr,i,attribute,newAttribute
		set rsc=conn.execute("select parentStr,attribute from as_channel where channelID="&channelID)
		if not (rsc.eof and rsc.bof) then
			parentStr=rsc(0)&","&channelID
			parentStr=split(parentStr,",")
			for i=0 to UBound(parentStr)
				set rspath=conn.execute("select attribute from as_channel where channelID="&parentStr(i))
				if not (rspath.eof and rspath.bof) then
					attribute=split(rspath(0),"|||")
					newAttribute=attribute(0)&"|||"&attribute(1)&"|||"&anysale.checkStr(trim(request.form ("title")))&"|||"&rootID&"|||"&now()&"|||"&anysale.username&"|||"&anysale.nickname

⌨️ 快捷键说明

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