<!-- #include file=../inc/BBSsetup.asp -->
<!-- #include file=../inc/Board_Popfun.asp -->
<!-- #include file=../inc/Limit_fun.asp -->
<!-- #include file=inc/MakeAnnounceTop.asp -->
<%
DEF_BBS_HomeUrl = "../"
initDatabase
GBL_CHK_TempStr = ""
siteHead("   提帖子")

Dim TopID
%>
<script language=javascript>
	window.moveTo(window.screen.width/2-225,window.screen.height/2-18);
</script>
<%
UpdateOnlineUserAtInfo GBL_board_ID,"提帖子"

If GBL_CHK_Flag=1 Then
	If CheckIsCanDellSure = 1 Then
		DisplayMakeGoodAnnounce
	End If
Else
	If Request("submitflag")="" Then
		Response.Write "<br><b>请先登录</b>"
	Else
		Response.Write "<br><p align=left><font color=ff0000 class=RedFont><b>" & GBL_CHK_TempStr & "</b></font>"
	End If
	Response.Write "</p>"
End If

closeDataBase
SiteBottom_Spend

Function CheckIsCanDellSure

	TopID = Left(Request("TopID"),14)
	If isNumeric(TopID) = 0 or inStr(TopID,",") > 0 or TopID = "" Then
		Response.Write "错误,要提升的帖子不存在!<br>" & VbCrLf
		CheckIsCanDellSure = 0
		Exit Function
	End if

	If GBL_CHK_LastWriteTime < DEF_WriteEventSpace Then
		Response.Write "<b><font color=Red Class=RedFont>您的操作太频，请稍候再作提交!</font></b> <br>" & VbCrLf
		CheckIsCanDellSure = 0
		Exit Function
	End If

	TopID = cCur(TopID)
	Dim Rs,SQL
	SQL = "Select top 1 BoardID from LeadBBS_Topic where id=" & TopID
	Set Rs = con.ExeCute(SQL)
	GBL_DBNum = GBL_DBNum + 1
	If Rs.Eof Then
		Response.Write "错误,要提升的帖子不存在!<br>" & VbCrLf
		Rs.Close
		Set Rs = Nothing
		CheckIsCanDellSure = 0
		Exit Function
	End if

	GBL_Board_ID = Rs(0)
	Rs.Close
	Set Rs = Nothing

	Dim Temp
	Temp = Application(DEF_MasterCookies & "BoardInfo" & GBL_Board_ID)
	If isArray(Temp) = False Then
		ReloadBoardInfo(GBL_Board_ID)
		Temp = Application(DEF_MasterCookies & "BoardInfo" & GBL_Board_ID)
	End If
	If isArray(Temp) = False Then
		Response.Write "社区发生错误，请联系管理员!<br>" & VbCrLf
		CheckIsCanDellSure = 0
		Set Rs = Nothing
	End If
	GBL_Board_MasterList = Temp(10,0)
	
	CheckisBoardMaster
	If GBL_UserID >= 1 and (GBL_BoardMasterFlag >= 5 and GetBinarybit(GBL_CHK_UserLimit,4) = 0) Then
		CheckIsCanDellSure = 1
	Else
		CheckIsCanDellSure = 0
		Response.Write "错误,权限不足."
	End If

End Function


Function DisplayMakeGoodAnnounce

	If Request.Form("DeleteSureFlag")="dk9@dl9s92lw_SWxl" Then
		MakeAnnounceTop(TopID)
		If CheckSupervisorUserName = 0 Then
			Con.ExeCute("Update LeadBBS_User Set LastWriteTime=" & GetTimeValue(DEF_Now) & " where ID=" & GBL_UserID)
			GBL_DBNum = GBL_DBNum + 1
			UpdateSessionValue 13,GetTimeValue(DEF_Now),0
		End If
		Response.Write "成功提升社区帖子，请按ESC键退出。"
	Else
		%>
		<form name=DellClientForm action=TopAnnounce.asp method=post>
			<input type=hidden name=DeleteSureFlag value="dk9@dl9s92lw_SWxl">
			<input type=hidden name=TopID value="<%=TopID%>">
			<input type=hidden name=BoardID value="<%=GBL_Board_ID%>">
			<b>确认要提升编号为<font color=ff0000 class=RedFont><%=TopID%></font>的帖子吗？</b>
			<p><input type=submit value=确定 class=fmbtn>
			<input type=button value=取消此操作 onclick="javascript:window.close();" class=fmbtn>
		</form>
		<%
	End If

End Function%>