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

📄 post.asp

📁 一个asp写的论坛源代码,论坛所需要的功能都有
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!-- #include file="conn.asp" -->
<!-- #include file="INC/Const.asp" -->
<%
Dim Fid,tID,Titles,x1,x2,forumid
Public Boards,Board_Setting
fID = Cid(Request("fid")) 
tID = Cid(Request("tid"))
Select Case Request("newpage")
	Case "post"
		Call posts
	Case "reply"
		Call replays
	Case "edit"
		Call edits
	Case Else
		team.error "参数错误"
End Select

Sub posts	
	Dim tmp,ismaste
	Dim ExtCredits
	Titles = "发表新帖"
	ConfigSet()
	X1="发表新帖"
	X2 = Boards(2,0)
	Call NewUserpostTime()
	ExtCredits = Split(team.Club_Class(21),"|")
	tmp = iHtmlEncode(BlackTmp(HtmlEncode(Team.PostHtml (8)),"postaction"))
	tmp = iHtmlEncode(BlackTmp(HtmlEncode(tmp),"postinfo"))
	tmp = Replace(tmp,"{$weburl}",team.MenuTitle)
	tmp = Replace(tmp,"{$username}",TK_UserName)
	tmp = Replace(tmp,"{$posttime}",Now())
	tmp = Replace(tmp,"{$readperm}","0")
	tmp = Replace(tmp,"{$topics}","")
	tmp = Replace(tmp,"{$ischecked}","")
	tmp = Replace(tmp,"{$resubjet}","")
	tmp = Replace(tmp,"{$postmax}",Cid(team.Forum_setting(67)))
	tmp = Replace(tmp,"{$postmin}",cid(team.Forum_setting(64)))
	tmp = Replace(tmp,"{$topicmax}",cid(team.Forum_setting(89)))
	tmp = Replace(tmp,"{$display}",iif(Cid(team.Forum_setting(48))=2,"","display:none"))
	tmp = Replace(tmp,"{$pollmaxto}",cid(team.Forum_setting(68)))
	tmp = Replace(tmp,"{$msgcache}","1")
	tmp = Replace(tmp,"{$messages}","")
	tmp = Replace(tmp,"{$postcolor}","")
	tmp = Replace(tmp,"{$mycolor}",IIf(team.ManageUser,"","None"))
	tmp = Replace(tmp,"{$dispoll}","display:none")
	tmp = Replace(tmp,"{$disactivity}","display:none")
	tmp = Replace(tmp,"{$disreward}","display:none")
	tmp = Replace(tmp,"{$enddatetime}","0")
	tmp = Replace(tmp,"{$maxchoices}","10")
	tmp = Replace(tmp,"{$pollaction}","")
	tmp = Replace(tmp,"{$editpoll}","")
	tmp = Replace(tmp,"{$activityname}","")
	tmp = Replace(tmp,"{$activitycity}","")
	tmp = Replace(tmp,"{$activityplace}","")
	tmp = Replace(tmp,"{$activityclass}","")
	tmp = Replace(tmp,"{$starttimefrom}","")
	tmp = Replace(tmp,"{$starttimeto}","")
	tmp = Replace(tmp,"{$cost}","0")
	tmp = Replace(tmp,"{$activitynumber}","")
	tmp = Replace(tmp,"{$activityexpiration}","")
	tmp = Replace(tmp,"{$rewardprice}","1")
	tmp = Replace(tmp,"{$pollcheck}","")
	tmp = Replace(tmp,"{$closepoll}","")
	tmp = Replace(tmp,"{$ischenks}","display:none")
	tmp = Replace(tmp,"{$distag}","")
	tmp = Replace(tmp,"{$tags}","")
	tmp = Replace(tmp,"{$fid}",Fid)
	tmp = Replace(tmp,"{$actions}","saves")
	tmp = Replace(tmp,"{$revenue}",team.Forum_setting(11))
	tmp = Replace(tmp,"{$wrname}",IIF(Split(ExtCredits(Cid(team.Forum_setting(99))),",")(3)=1,  " ( "& Split(ExtCredits(Cid(team.Forum_setting(99))),",")(0)&" ) "," (本积分未启用) "))
	tmp = Replace(tmp,"{$setmode}",Cid(team.Forum_setting(98)))
	tmp = Replace(tmp,"{$maxsml}",iif(Request("seesmile")="yes",Cid(team.Forum_setting(87)),15))
	tmp = Replace(tmp,"{$surl}",team.ActUrl)
	Dim Special,utmp,u
	Special = ""
	If Int(Board_Setting(15))=1 and Int(Board_Setting(17))=1 Then
		If Instr(Board_Setting(19),Chr(13)&Chr(10))>0 Then
			utmp = Split(Board_Setting(19),Chr(13)&Chr(10))
			For U=0 To Ubound(utmp)
				Special = Special &" <option value="""&U&""">"& utmp(u) &"</option>" 
			Next
		Else
			Special = "<option value=""0"">"& Board_Setting(19) &"</option>"
		End if	
	End If
	tmp = Replace(tmp,"{$topiclist}",Special)
	tmp = Replace(tmp,"{$postaction}","发表新话题")
	If team.IsMaster  Then 
		ismaste = "<INPUT name=""istop"" type=""checkbox"" value=""1"" class=""checkbox"" /> 置顶主题<br/><INPUT name=""isgood"" type=""checkbox"" value=""1"" class=""checkbox"" />  加为精华<br><INPUT name=""islocks"" type=""checkbox"" value=""1"" class=""checkbox"" />  锁定主题<br>"
	End if
	If team.UserLoginED=True Then
		ismaste = ismaste & "<input class=""checkbox"" type=""checkbox"" name=""todiary"" value=""1""> 加入文集<br><input name=""createpoll"" type=""checkbox"" id=""createpoll"" onclick=""expandoptions('divPoll');"" value=""1"" class=""checkbox"" /> 发布投票</label><br/><input name=""creatactivity"" type=""checkbox"" id=""creatactivity"" onclick=""expandoptions('divactivity');"" value=""1"" class=""checkbox"" /> 发起活动</label><br/> "
		If Cid(team.Forum_setting(99)) > 0 Then
			ismaste = ismaste & "<input name=""createreward"" type=""checkbox"" id=""createreward"" onclick=""expandoptions('divreward');"" value=""1"" class=""checkbox"" /> 悬赏问题</label><br/>"
		End If
		ismaste = ismaste & "<input name=""getmsgforme"" type=""checkbox"" id=""getmsgforme"" value=""1"" class=""checkbox"" /> 订阅回复通知</label>"
	End if
	Dim PostRanNum
	Randomize
	PostRanNum = Int(900*rnd)+1000
	Session("UploadCode") = Cstr(PostRanNum)
	tmp = Replace(tmp,"{$tid}",tID)
	tmp = Replace(tmp,"{$managesif}",ismaste)
	tmp = Replace(tmp,"{$maxupfile}",team.Forum_setting(71))
	tmp = Replace(tmp,"{$filetype}",Replace(team.Forum_setting(73),"|",","))
	tmp = Replace(tmp,"{$postrannum}",PostRanNum)
	tmp = Replace(tmp,"{$oneups}",CID(team.Group_Browse(26)))
	Echo tmp
End Sub

Sub edits	
	Dim tmp,ismaste,Rs,Rs1,SQL
	Dim ExtCredits,Us
	Titles = "编辑帖子"
	ConfigSet()
	Call NewUserpostTime()
	ExtCredits = Split(team.Club_Class(21),"|")
	If IsNumEric(Request("retopicid")) Then
		tmp = iHtmlEncode(TempCode(HtmlEncode(Team.PostHtml (8)),"postaction"))
		tmp = iHtmlEncode(TempCode(HtmlEncode(tmp),"postinfo"))
	Else
		tmp = iHtmlEncode(BlackTmp(HtmlEncode(Team.PostHtml (8)),"postaction"))
		tmp = iHtmlEncode(BlackTmp(HtmlEncode(tmp),"postinfo"))
	End if
	Set Rs = team.execute( "Select Topic,UserName,Color,PostClass,Content,Createpoll,Creatdiary,Creatactivity,Createreward,Rewardprice,Readperm,Rewardpricetype,Tags,Icon,ReList,Locktopic From ["&IsForum&"Forum] Where ID="& tID )
	If Rs.Eof Then
		team.error " 您查询的帖子不存在。"
	Else
		If Int(RS(15)) = 1 Then
			team.Error "此主题帖已经被锁定,无法进行编辑操作。"
		End if
		X1="编辑帖子 &raquo; [ <a href=""thread.asp?tid="&tID&"""> "&Rs(0)&" </a>]"
		X2 = Boards(2,0)
		tmp = Replace(tmp,"{$weburl}",team.MenuTitle)
		Dim Special,utmp,u
		Special = ""
		If Int(Board_Setting(15))=1 and Int(Board_Setting(17))=1 Then
			If Instr(Board_Setting(19),Chr(13)&Chr(10))>0 Then
				utmp = Split(Board_Setting(19),Chr(13)&Chr(10))
				For U=0 To Ubound(utmp)
					Special = Special &" <option value="""&U&""" "
					If Int(Rs(3)) = u Then Special = Special &" SELECTED "
					Special = Special &">"& utmp(u) &"</option>" 
				Next
			Else
				Special = "<option value=""0"" "
				If Int(Rs(3)) = 0 Then Special = Special &" SELECTED "
				Special = Special &" >"& Board_Setting(19) &"</option>"
			End if	
		End If
		tmp = Replace(tmp,"{$topiclist}",Special)
		tmp = Replace(tmp,"{$postmax}",Cid(team.Forum_setting(67)))
		tmp = Replace(tmp,"{$postmin}",cid(team.Forum_setting(64)))
		tmp = Replace(tmp,"{$topicmax}",cid(team.Forum_setting(89)))
		tmp = Replace(tmp,"{$display}",iif(Cid(team.Forum_setting(48))=2,"","display:none"))
		tmp = Replace(tmp,"{$pollmaxto}",cid(team.Forum_setting(68)))
		tmp = Replace(tmp,"{$revenue}",team.Forum_setting(11))
		tmp = Replace(tmp,"{$msgcache}","0")
		tmp = Replace(tmp,"{$posttime}",Now())
		tmp = Replace(tmp,"{$actions}","edsaves&amp;tid="&tid&"&retopicid="&Request("retopicid")&"")
		tmp = Replace(tmp,"{$fid}",Fid)
		tmp = Replace(tmp,"{$distag}","")
		tmp = Replace(tmp,"{$wrname}",IIF(Split(ExtCredits(Cid(team.Forum_setting(99))),",")(3)=1,  " ( "& Split(ExtCredits(Cid(team.Forum_setting(99))),",")(0)&" ) "," (本积分未启用) "))
		tmp = Replace(tmp,"{$setmode}",Cid(team.Forum_setting(98)))
		tmp = Replace(tmp,"{$maxsml}",iif(Request("seesmile")="yes",Cid(team.Forum_setting(87)),15))
		tmp = Replace(tmp,"{$postaction}","编辑主题")
		tmp = Replace(tmp,"{$surl}",team.ActUrl)
		If IsNumEric(Request("retopicid")) Then
			Set Rs1=team.execute("Select UserName,ReTopic,Content,Lock From ["&IsForum & Rs(14) &"] Where ID="& Cid(Request("retopicid")) )
			If Rs1.Eof Then
				team.error " 您查询的回帖子存在。"
			Else
				If Int(RS1(3)) = 1 Then
					team.Error "此帖已经被锁定,无法进行编辑操作。"
				End if
				If Trim(Rs1(0)) <> Trim(tk_UserName) Then
					If team.Group_Manage(0) = 0 Then team.Error "您没有编辑他人帖子的权限。"
					Set us = team.execute("Select UserGroupID From ["&IsForum&"User] Where UserName='"&Rs1(0)&"'")
					If Not Us.Eof Then
						Select Case Int(Us(0))
							Case 1
								If Not team.IsMaster Then team.Error "您没有编辑管理员的帖子的权限。"
							Case 2
								If Not ( team.IsMaster Or team.SuperMaster) Then team.Error "您没有编辑超级版主帖子的权限。"
							Case 3
								If  Not (team.IsMaster Or team.SuperMaster Or team.BoardMaster) Then team.Error "您没有编辑版主帖子的权限。"
						End Select
					End If
					Us.Close:Set Us=Nothing
				End if
				tmp = Replace(tmp,"{$resubjet}","<tr><td class=""altbg1"" class=""bold""> 标题 </td><td class=""altbg2"">  <input type=""text"" name=""subject"" id=""subject"" size=""45"" value="""&Rs1(1)&""" tabindex=""103"" onBlur=""this.className='colorblur';"" onfocus=""this.className='colorfocus';"" class=""colorblur""> (选填)</td></tr>")
				tmp = Replace(tmp,"{$username}",Rs1(0))
				tmp = Replace(tmp,"{$messages}",EditConts(Rs1(2)))
				tmp = Replace(tmp,"{$maxupfile}",team.Forum_setting(71))
				tmp = Replace(tmp,"{$managesif}","")
			End If
		Else
			If Trim(Rs(1)) <> Trim(tk_UserName) Then
				If team.Group_Manage(0) = 0 Then team.Error "您没有编辑他人帖子的权限。"
				Set us = team.execute("Select UserGroupID From ["&IsForum&"User] Where UserName='"&Rs(0)&"'")
				If Not Us.Eof Then
					Select Case Int(Us(0))
						Case 1
							If Not team.IsMaster Then team.Error "您没有编辑管理员的帖子的权限。"
						Case 2
							If Not ( team.IsMaster Or team.SuperMaster) Then team.Error "您没有编辑超级版主帖子的权限。"
						Case 3
							If  Not (team.IsMaster Or team.SuperMaster Or team.BoardMaster) Then team.Error "您没有编辑版主帖子的权限。"
					End Select
				End If
				Us.Close:Set Us=Nothing
			End if
			tmp = Replace(tmp,"{$resubjet}","")
			tmp = Replace(tmp,"{$username}",Rs(1))
			tmp = Replace(tmp,"{$tags}",Rs(12)&"")
			tmp = Replace(tmp,"{$topics}",Rs(0)&"")
			tmp = Replace(tmp,"{$postcolor}",IIF(Cid(Rs(2))>0,"<OPTION value="""&Rs(2)&""" selected>改变颜色?</OPTION>",""))
			tmp = Replace(tmp,"{$ischecked}",Cid(Rs(13)))
			tmp = Replace(tmp,"{$messages}",EditConts(Rs(4)))
			tmp = Replace(tmp,"{$dispoll}",Iif(Rs(5)=1,"","display:none"))
			tmp = Replace(tmp,"{$disactivity}",Iif(Rs(7)=1,"","display:none"))
			tmp = Replace(tmp,"{$disreward}",Iif(Rs(8)=1,"","display:none"))
			tmp = Replace(tmp,"{$readperm}",Rs(10))
			If team.IsMaster Then 

⌨️ 快捷键说明

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