<!-- #include file=../inc/BBSsetup.asp -->
<!-- #include file=../inc/Board_Popfun.asp -->
<!-- #include file=../inc/Limit_Fun.asp -->
<!-- #include file=inc/Poll_fun.asp -->
<!-- #include file=inc/MakeAnnounceTop.asp -->
<%
GBL_CHK_PWdFlag = 0
DEF_BBS_HomeUrl = "../"
Dim PollTitleID,SelectItemID,TempStr
initDatabase
CheckisBoardMaster
CheckAccessLimit
SiteHead("   ")
Dim Article_NotReplay,LMT_TopicTitleStyle
Article_NotReplay = 0
LMT_TopicTitleStyle = 0
PollTitleID = Left(Request("PollTitleID"),14)
SelectItemID = Request("SelectItemID")
CheckPollTitleID(PollTitleID)
If GBL_CHK_TempStr = "" Then
	DisplayVoteForm PollTitleID,1
Else
	Response.write GBL_CHK_TempStr
End If

CloseDatabase
SiteBottom_Spend

Sub CheckPollTitleID(AnnounceID)

	If isNumeric(PollTitleID) = 0 Then PollTitleID = 0
	PollTitleID = Fix(cCur(PollTitleID))
	Dim Rs,SQL
	SQL = "Select top 1 BoardID,NotReplay,TitleStyle from LeadBBS_Topic Where ID=" & AnnounceID
	Set Rs = Con.ExeCute(SQL)
	GBL_DBNum = GBL_DBNum + 1
	If Rs.Eof Then
		GBL_CHK_TempStr = GBL_CHK_TempStr & "错误，不存在此投票。"
		Rs.Close
		Set Rs = Nothing
		Exit Sub
	End If

	If cCur(Rs(0)) <> GBL_Board_ID Then
		GBL_CHK_TempStr = GBL_CHK_TempStr & "错误，不存在此投票。"
		Rs.Close
		Set Rs = Nothing
		Exit Sub
	End If
	If Article_NotReplay = 0 and Rs(1) = 1 Then Article_NotReplay = 1
	LMT_TopicTitleStyle = Rs(2)
	Rs.Close
	Set Rs = Nothing
	
End Sub

Sub UpdateAnnounceApplicationInfo(AncID,IndexN,Value,tp,tid)

	Dim GetDataTop,AllTopNum,N,Str
	If tid = 0 Then
		Str = ""
	Else
		Str = tid
	End if
	AllTopNum = -1
	GetDataTop = Application(DEF_MasterCookies & "TopAnc" & Str)
	If isArray(GetDataTop) = False Then
		'If GetDataTop <> "yes" Then ReloadTopAnnounceInfo(tid)
		Exit Sub
	Else
		AllTopNum = Ubound(GetDataTop,2)
	End If

	For N = 0 to AllTopNum
		If cCur(AncID) = cCur(GetDataTop(0,N)) Then
			If tp = 1 Then
				GetDataTop(IndexN,N) = cCur(GetDataTop(IndexN,N)) + Value
			Else
				GetDataTop(IndexN,N) = Value
			End If
			Application.Lock
			Application(DEF_MasterCookies & "TopAnc" & Str) = GetDataTop
			Application.UnLock
			Exit Sub
		End If
	Next

End Sub
%>