📄 forumpost.asp
字号:
Sub ForumPostSave(Action,ForumID,ThreadID)
Dim post_Title,post_Icon,post_Content,post_DisUBB,post_DisSM,post_DisIMG,post_AutoKEY,post_AutoURL,post_IsTop,post_IsDigest,post_IsClose,TitleFontColor
post_Title=CheckWordFilter(Request.Form("post_Title"))
TitleFontColor=CheckStr(Request.Form("TitleFontColor"))
post_Content=CheckWordFilter(CheckStr(Request.Form("message")))
post_Icon=CheckStr(Request.Form("post_Icon"))
If Request.Form("post_IsTop")="1" Then
post_IsTop=True
Else
post_IsTop=False
End If
If Request.Form("post_IsDigest")="1" Then
post_IsDigest=True
Else
post_IsDigest=False
End If
If Request.Form("post_IsClose")="1" Then
post_IsClose=True
Else
post_IsClose=False
End If
If Request.Form("post_DisSM")="1" Then
post_DisSM=True
Else
post_DisSM=False
End If
If Request.Form("post_DisUBB")="1" Then
post_DisUBB=True
Else
post_DisUBB=False
End If
If Request.Form("post_DisIMG")="1" Then
post_DisIMG=True
Else
post_DisIMG=False
End If
If Request.Form("post_AutoURL")="1" Then
post_AutoURL=True
Else
post_AutoURL=False
End If
If Request.Form("post_AutoKEY")="1" Then
post_AutoKEY=True
Else
post_AutoKEY=False
End If
If Action="thread" Then
If post_Title<>Empty And post_Content<>Empty Then
Dim newThreadRS,newThreadID
Set newThreadRS=Server.CreateObject("ADODB.RecordSet")
SQL="SELECT * FROM blog_Threads WHERE thread_ID IS NULL"
newThreadRS.Open SQL,znwl,1,3
newThreadRS.AddNew
newThreadRS("thread_ForumID")=ForumID
newThreadRS("thread_Title")=post_Title
newThreadRS("TitleFontColor")=TitleFontColor
newThreadRS("thread_Icon")=post_Icon
newThreadRS("thread_Author")=memName
newThreadRS("thread_IsTop")=post_IsTop
newThreadRS("thread_IsDigest")=post_IsDigest
newThreadRS("thread_IsClose")=post_IsClose
newThreadRS("thread_MagicFace")=CheckStr(Request.Form("post_MagicFace"))
newThreadRS("thread_LastPost")=Now()
newThreadRS("thread_LastPoster")=memName
newThreadRS("thread_PostNums")=1
newThreadRS.Update
newThreadID=newThreadRS("thread_ID")
newThreadRS.Close
Set newThreadRS=Nothing
znwl.ExeCute("INSERT INTO blog_Posts(post_ThreadID,post_ForumID,post_IsTop,post_Content,post_Author,post_PostIP,post_DisSM,post_DisUBB,post_DisIMG,post_AutoURL,post_AutoKEY) VALUES ("&newThreadID&","&ForumID&",True,'"&post_Content&"','"&memName&"','"&Guest_IP&"',"&post_DisSM&","&post_DisUBB&","&post_DisIMG&","&post_AutoURL&","&post_AutoKEY&")")
znwl.ExeCute("UPDATE blog_Forums SET forum_ThreadNums=forum_ThreadNums+1,forum_PostNums=forum_PostNums+1 WHERE forum_ID="&ForumID&"")
znwl.ExeCute("UPDATE blog_Member SET mem_PostThreads=mem_PostThreads+1,mem_PostPosts=mem_PostPosts+1 WHERE mem_Name='"&memName&"'")
znwl.ExeCute("UPDATE blog_Info SET blog_PostNums=blog_PostNums+1,blog_ThreadNums=blog_ThreadNums+1")
Response.Cookies(CookieName)("memLastpost")=Now()
SQLQueryNums=SQLQueryNums+5
Application.Lock
Application(CookieName&"_blog_Forums")=""
Application.UnLock
Response.Write("<meta http-equiv=""refresh"" content=""3;url=threadview.asp?forumID="&ForumID&"&threadID="&newThreadID&"""><div class=""msg_head"">发表主题成功</div><div class=""msg_main""><br><br><a href=""threadview.asp?forumID="&ForumID&"&threadID="&newThreadID&""">点击返回所发主题,或者3秒后自动返回</a><br><br><a href=""forumview.asp?forumID="&ForumID&""">点击返回论坛列表</a><br><br><a href=""forumview.asp"">点击返回论坛首页</a><br><br></div>")
Else
Response.Write("<div class=""msg_head"">出现错误</div><div class=""msg_main""><br><br><a href=""javascript:history.go(-1);"">信息不完整,请点击返回重新填写!</a><br><br><br></div>")
End If
ElseIf Action="reply" Then
If post_Content<>Empty Then
znwl.ExeCute("INSERT INTO blog_Posts(post_ThreadID,post_ForumID,post_IsTop,post_Content,post_Author,post_PostIP,post_DisSM,post_DisUBB,post_DisIMG,post_AutoURL,post_AutoKEY) VALUES ("&ThreadID&","&ForumID&",False,'"&post_Content&"','"&memName&"','"&Guest_IP&"',"&post_DisSM&","&post_DisUBB&","&post_DisIMG&","&post_AutoURL&","&post_AutoKEY&")")
Dim newpostRS,newpostID,newpostPage
Set newpostRS=znwl.Execute("SELECT TOP 1 post_ID FROM blog_Posts ORDER BY post_ID DESC")
newpostID=newpostRS("post_ID")
Set newpostRS=Nothing
znwl.ExeCute("UPDATE blog_Threads SET thread_LastPost='"&Now()&"',thread_LastPoster='"&memName&"',thread_PostNums=thread_PostNums+1 WHERE thread_ID="&ThreadID&"")
znwl.ExeCute("UPDATE blog_Forums SET forum_PostNums=forum_PostNums+1 WHERE forum_ID="&ForumID&"")
znwl.ExeCute("UPDATE blog_Member SET mem_PostPosts=mem_PostPosts+1 WHERE mem_Name='"&memName&"'")
znwl.ExeCute("UPDATE blog_Info SET blog_PostNums=blog_PostNums+1")
Set newpostRS=znwl.Execute("SELECT thread_PostNums FROM blog_Threads WHERE thread_ID="&threadID)
newpostPage=newpostRS("thread_PostNums")
If newpostPage Mod Cint(postPerPage)=0 Then
newpostPage=Int(newpostPage/postPerPage)
Else
newpostPage=Int(newpostPage/postPerPage)+1
End If
Set newpostRS=Nothing
Response.Cookies(CookieName)("memLastpost")=Now()
SQLQueryNums=SQLQueryNums+7
Response.Write("<meta http-equiv=""refresh"" content=""3;url=threadview.asp?forumID="&ForumID&"&threadID="&ThreadID&"&page="&newpostPage&"#post_"&newpostID&"""><div class=""msg_head"">发表回复成功</div><div class=""msg_main""><br><br><a href=""threadview.asp?forumID="&ForumID&"&threadID="&ThreadID&"&page="&newpostPage&"#post_"&newpostID&""">点击返回所回复主题,或者3秒后自动返回</a><br><br><a href=""forumview.asp?forumID="&ForumID&""">点击返回论坛列表</a><br><br><a href=""forumview.asp"">点击返回论坛首页</a><br><br></div>")
Else
Response.Write("<div class=""msg_head"">出现错误</div><div class=""msg_main""><br><br><a href=""javascript:history.go(-1);"">信息不完整,请点击返回重新填写!</a><br><br><br></div>")
End If
End If
End Sub
Sub SelectForum
Response.Write("<table width=""90%"" border=""0"" align=""center"" cellpadding=""4"" cellspacing=""1"" bgcolor=""#CCCCCC""><tr align=""center""><td colspan=""2"" class=""msg_head"">选择论坛</td></tr><form name=""form_F"" method=""post"" action=""?action=thread""><tr bgcolor=""#FFFFFF""><td width=""19%"" align=""right""><b>论坛:</b></td><td width=""81%""><select name=""forumID"" id=""forumID""><option value="""">请选择论坛</option>")
Dim log_ForumNums,log_ForumNumI
log_ForumNums=Ubound(Arr_Forums,2)
For log_ForumNumI=0 To log_ForumNums
Response.Write("<option value="""&Arr_Forums(0,log_ForumNumI)&""">"&Arr_Forums(1,log_ForumNumI)&"</option>")
Next
Response.Write("</select></td></tr><tr align=""center"" bgcolor=""#FFFFFF""><td colspan=""2""><input name=""F_Submit"" type=""submit"" id=""F_Submit"" value="" 确 定 ""></td></tr></form></table>")
End Sub
%></td></tr></table>
<!--#include file="footer.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -