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

📄 newtopic.asp

📁 程序网络论坛HigroupBBS v4.00 默认管理员帐号密码都是Marcos
💻 ASP
字号:
<!--#include file="MarcosCB.asp"-->
<%
	getConn()
	isIn()
	
	dim str,pageCode,pageTitle,pageOther
	dim boardId,boardName

	str=getMainCode(mySkinId)
	theAct=getPost("theAct")
	boardId=getPost("boardId")
	boardName=getPost("boardName")

	if not isNumeric(boardId) then
		echo "错误的版面参数!"
		closeConn()
		response.End()
	end if

	nowWhere "发表新主题","javascript:;"

	if theAct="new" then
		dim topicTitle,topicContent,topicMood
		topicMood=getPost("mood")
		topicTitle=rtrim(getPost("title"))
		topicContent=rtrim(getPost("content"))
		
		if topicTitle="" or topicContent="" then
			echo "<script>alert('请完整填写帖子标题和内容!');history.back();</script>"
			closeConn()
			response.end
		end if
		
		sql="select boardId from Marcos_Board where boardId=" & boardId & " and topBoardId<>0"
		set rs_sys=conn.execute(sql)
		if rs_sys.eof then
			echo "错误的版面参数!(版块已被删除或者此版块不允许发帖)"
			closeConn()
			response.end
		end if
		
		if request.cookies("topicTitlePosted")=topicTitle or request.cookies("topicContentPosted")=topicContent then
			echo "<script>alert('发一样内容的帖子你不会累吗?');history.back();</script>"
			closeConn()
			response.end
		end if
		
		sql="Marcos_Topic"
		rs.open sql,conn,1,3
		rs.addNew
			rs("boardId")=boardId
			rs("topicTitle")=topicTitle
			rs("topicContent")=topicContent
			rs("topicMood")=topicMood
			rs("userName")=getValue("userName")
			rs("addTime")=now()
			rs("lastReplyTime")=now()
			rs("lastPostInfo")="回复者:@@暂无回复$$$回复时间:@@无$$$回复内容:@@无"
			on error resume next
		rs.update
		rs.close
		delPageIndex()
		sql="select top 1 topicId from Marcos_Topic order by lastReplyTime desc"
		set rs_sys=conn.execute(sql)
		lastPostInfo="标题:<a href=""topicShow.asp?boardName="&boardName&"&boardId="&boardId&"&topicId="&rs_sys(0)&""">"&left(topicTitle,5)&"..</a><br>作者:<a href=""userInfo.asp?userName="&getValue("userName")&""" target=_blank>"&getValue("userName")&"</a><br>时间:"&mid(now(),6,len(mid(now(),6))-3)
		conn.execute("update Marcos_Board set topicCount=topicCount+1,lastPostInfo='"&lastPostInfo&"' where boardId=" & boardId)
		conn.execute("update Marcos_User set userWealth=userWealth+"&newTopicFen&",userArticle=userArticle+1 where userId="&getValue("userId"))
		response.cookies("topicTitlePosted")=topicTitle
		response.cookies("topicContentPosted")=topicContent
		locate "topicList.asp?boardId=" & boardId & "&boardName=" & boardName
	end if
	
	pageTitle="<a href=""topicList.asp?boardId=" & boardId & "&boardName=" & boardName & """>" & boardName & "</a> &raquo; <a href=javascript:location.reload();>发表新贴</a>"
	pageOther="<script>document.title+=' - 发表新贴';</script>"
	
	showHead str,pageTitle,pageOther
	showBody()
	showFoot(str)

	sub showBody()
		
		pageCode=getPageCode(mySkinId,"PageFormX")
		PageFormX=split(pageCode,"$$$")
		body=PageFormX(0)
		body=body & PageFormX(2)
		body=replace(body,"{$title}","")
		body=replace(body,"{$content}","")
		body=replace(body,"{$moodSelected}","")
		body=replace(body,"{$formTitle}","发表新帖")
		body=replace(body,"{$theAct}","new")
		body=replace(body,"{$boardId}",boardId)
		body=replace(body,"{$boardName}",boardName)
'		body=replace(body,"{$}","")
		echo body
		
	end sub

	closeConn()
%>

⌨️ 快捷键说明

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