?? newtopic.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> » <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 + -