<!-- #include file=../inc/BBSsetup.asp -->
<!-- #include file=../inc/Board_Popfun.asp -->
<!-- #include file=../inc/Constellation.asp -->
<!-- #include file=../inc/Limit_Fun.asp -->
<!-- #include file=inc/Poll_fun.asp -->
<%
DEF_BBS_HomeUrl = "../"
Dim Article_NotReplay,Page
Article_NotReplay = 0
Dim Form_ID,Form_ParentID
Dim Form_RootMinID,Form_RootMaxID,Form_ChildNum

Form_RootMaxID = 0
Form_RootMinID = 0
Form_ChildNum = 0

Dim LMT_CheckFlag
LMT_CheckFlag = 0
Dim LMT_TopicName,LMT_TopicTitleStyle,LMT_TopicNameNoHTML,LMT_RootID,LMT_RootIDBak
LMT_RootID = 0
LMT_RootIDBak = 0

Function DisplayAnnounceForm

	GBL_CHK_TempStr = ""
	If Form_ParentID = 0 Then
		CheckBoardAnnounceLimit
	Else
		CheckBoardReAnnounceLimit
	End If
	CheckUserAnnounceLimit
	If GBL_CHK_TempStr <> "" Then Exit Function
	If Article_NotReplay = 1 Then Exit Function
%>
<script language=javascript>
<!--
	function submitonce(theform)
	{
		if (document.all||document.getElementById)
		{
			for (i=0;i<theform.length;i++)
			{
				var tempobj=theform.elements[i];
				if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
				tempobj.disabled=true;
			}
		}
	}
	function ctlkey()
	{
		if(event.ctrlKey && window.event.keyCode==13){submitonce(document.form1);document.form1.submit();}
		if(event.altKey && (window.event.keyCode==83 || window.event.keyCode==115)){submitonce(document.form1);document.form1.submit();}
	}
	var ie = (document.all)? true:false
	if (ie)
	{
		window.document.onkeydown=ctlkey;
	}
//-->
</script>

<table border=0 cellpadding=0 cellspacing=0 width="<%=DEF_BBS_ScreenWidth%>" align="center">
<tbody>
<tr>
<td>
<table border=0 cellpadding=0 cellspacing=0 width="100%">
<tbody>
<tr>
	<td>
		<table border=0 cellpadding=5 cellspacing=1 width="100%" bgcolor=<%=DEF_BBS_DarkColor%> class=TBone>
		<tr>
			<td bgcolor=<%=DEF_BBS_LightDarkColor%> colspan="2" class=TBHead>
			<img src=../images/null.gif width=2 height=3><br><b><font color="#ffffff" class=HeadFont><%
			If cCur(Form_ParentID)=0 Then
				Response.Write "发表新帖子"
			Else
				Response.Write "回复帖子"
			End If%> 注意: *为必填项</font></b></td>
		</tr>
		<form action=announce2.asp method=post name=form1 onSubmit="submitonce(this);">
		<tr>
			<td bgcolor=<%=DEF_BBS_LightColor%> width="<%=DEF_BBS_LeftTDWidth%>" class=TBBG1>*用户名和密码<br><img src=<%=DEF_BBS_HomeUrl%>images/blank.gif width=<%=DEF_BBS_LeftTDWidth%> height=2></td>
			<td bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
				用户名 <input maxlength=20 name=User value="<%=htmlencode(GBL_CHK_User)%>" size="20" class=fminpt>
				密码 <input maxlength=20 type=password name=Pass value="<%=htmlencode(GBL_CHK_Pass)%>" size="20" class=fminpt> <a href=<%=DEF_BBS_HomeUrl%>User/UserJoin.asp>注册</a>新用户
				</td>
				<input name=submitflag value="true" type=hidden>
				<input name=BoardID value="<%=GBL_board_ID%>" type=hidden>
				<input name=ID value="<%=Form_ParentID%>" type=hidden>
                </tr>
		<tr>
			<td bgcolor=<%=DEF_BBS_LightColor%> width="<%=DEF_BBS_LeftTDWidth%>" class=TBBG1>*帖子名称</td>
			<td bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
				<input maxlength=255 name=Form_Title size="55" Value="<%
				If Left(LMT_TopicName,3) <> "Re:" Then 
					Response.Write "Re:" & htmlencode(LMT_TopicNameNoHTML)
				Else
					Response.Write htmlencode(LMT_TopicNameNoHTML)
				End If%>" class=fminpt> 长度不得超过255字</td>
		</tr>
		<tr>
			<td bgcolor=<%=DEF_BBS_LightColor%> valign="middle" width="<%=DEF_BBS_LeftTDWidth%>" class=TBBG1>
				<table border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td>
						<table border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td colspan="2">内容(最大<%=Fix(DEF_MaxTextLength/1024)%>K)<br><img src=../images/null.gif width=2 height=5><br>
							</td>
						</tr>
						<tr>
							<td valign="middle">是否是UBB代码</td>
							<td valign="middle">
								<input class=fmchkbox type="checkbox" name="Form_HTMLFlag" value="2" checked>
							</td>
						</tr>
						</table><img src=../images/null.gif width=2 height=5><br>
						<a href="<%=DEF_BBS_HomeUrl%>User/Help/Ubb.asp" target=_blank>内容支持插入UBB标签<br>使用方法请参考帮助</a></td>
				</tr>
				</table>
			</td>
			<td bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
				<textarea cols=80 name=Form_Content rows=6 class=fmtxtra></textarea>
			</td>
		</tr>
		<tr bgcolor="<%=DEF_BBS_LightColor%>" class=TBBG1> 
			<td colspan="2">
				<table border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td>&nbsp;其它选项:&nbsp; </td>
					<td>
						<input class=fmchkbox type="checkbox" name="Form_NoUserUnderWriteFlag" value="checkbox" checked>
					</td>
					<td>显示签名</td>
					<td>
						&nbsp;<input class=fmchkbox type="checkbox" name="Form_NotReplay" value="checkbox">
					</td>
					<td>锁定帖子</td>
					<td>&nbsp;- <a href="<%=DEF_BBS_HomeUrl%>User/Help/Color.asp" target=_blank>颜色表</a>
					&nbsp; Alt+S或Ctrl+Enter快速提交</td>
				</tr>
				</table>
			</td>
		</tr>
		<tr bgcolor="<%=DEF_BBS_LightestColor%>" class=TBBG9>
			<td colspan="2" align="center">
				<input name=submit2 type=submit value=" 完 成 " class=fmbtn>
				<input name=b12 type=reset value=" 重 写 " class=fmbtn>
			</td>
		</tr>
		</tbody>
		</form>
		</table>
	</td>
</tr>
</tbody> 
</table>
<%

End Function

Function GetRequestValue

	If cStr(Form_ParentID) = "" Then Form_ParentID = Left(Request("ID"),14)
	If isNumeric(Form_ParentID) = 0 Then Form_ParentID = 0
	Form_ParentID = cCur(Form_ParentID)

	If Article_NotReplay = 1 Then Exit Function

End Function

Function DisplayOfficerString(Officer)

	Dim Officer_Temp,Temp_N,dotFlag
	dotFlag = 0
	Officer_Temp = split(Officer,",")
	For Temp_N = 0 to Ubound(Officer_Temp,1)
		If isNumeric(Officer_Temp(Temp_N)) Then
			Officer_Temp(Temp_N) = cCur(Officer_Temp(Temp_N))
			If Officer_Temp(Temp_N)>=0 and Officer_Temp(Temp_N)<=DEF_UserOfficerNum Then
				If dotFlag = 0 Then
					dotFlag = 1
					DisplayOfficerString = DisplayOfficerString & DEF_UserOfficerString(Officer_Temp(Temp_N))
				Else
					DisplayOfficerString = DisplayOfficerString & "," & DEF_UserOfficerString(Officer_Temp(Temp_N))
				End If
			End If
		End If
	Next

End Function


Function GetTopicInfo

	If Form_ParentID = 0 Then Exit Function
	Dim Rs,SQL,submitflag,Form_TopicType,Form_NeedValue,TParentID
	submitflag = Request("submitflag")
	TParentID = -1

	Dim ac,rd
	ac = Request("ac")
	rd = Left(Request("rd"),14)
	If isNumeric(rd) = 0 or inStr(rd,".") then rd = 0
	rd = cCur(rd)
	If rd = 0 Then
		SQL = ""
	Else
		Select Case ac
			Case "pre": SQL = "Select top 1 ID,RootID,TopicType,NeedValue,0,ChildNum,Title,hits,RootMaxID,RootMinID,NotReplay,ID,TitleStyle,VisitIP from LeadBBS_Topic where boardid=" & GBL_board_ID & " and RootID>" & rd & " order by RootID ASC"
			Case "nxt": SQL = "Select top 1 ID,RootID,TopicType,NeedValue,0,ChildNum,Title,hits,RootMaxID,RootMinID,NotReplay,ID,TitleStyle,VisitIP from LeadBBS_Topic where boardid=" & GBL_board_ID & " and RootID<" & rd & " order by RootID DESC"
			Case Else: SQL = ""
		End Select
	End If

	If SQL <> "" Then
		Set Rs = Con.ExeCute(SQL)
		If Not Rs.Eof Then
			Form_ParentID = cCur(Rs(0))
			LMT_RootID = cCur(Rs(1))
			Form_TopicType = Rs(2)
			Form_NeedValue = Rs(3)
			TParentID = cCur(Rs(4))
			Form_ChildNum = cCur(Rs(5))
			LMT_TopicName = Rs(6)
			Form_RootMaxID = cCur(Rs(8))
			Form_RootMinID = cCur(Rs(9))
			Article_NotReplay = Rs(10)
			LMT_RootIDBak = cCur(Rs(11))
			LMT_TopicTitleStyle = Rs(12)
			ac = Trim(Rs(13))
			Rs.Close
			Set Rs = Nothing
			If ac <> GBL_IPAddress Then
				Con.ExeCute("Update LeadBBS_Topic Set hits=hits+1,VisitIP='" & GBL_IPAddress & "' where ID=" & Form_ParentID)
				Con.ExeCute("Update LeadBBS_Announce Set hits=hits+1,VisitIP='" & GBL_IPAddress & "' where ID=" & Form_ParentID)
			End If
		Else
			Rs.Close
			Set Rs = Nothing
		End If
	End If

	If TParentID = -1 Then
		SQL = "Select RootID,TopicType,NeedValue,ParentID,ChildNum,Hits,RootMaxID,RootMinID,title,NotReplay,RootIDBak,TitleStyle,BoardID,VisitIP from LeadBBS_Announce where ID=" & Form_ParentID
		Set Rs = Con.ExeCute(SQL)
		If Rs.Eof Then
			Rs.Close
			Set Rs = Nothing
			GBL_CHK_TempStr = "错误,该主题不存在!<br>" & VbCrLf
			Exit Function
		Else
			If cCur(Rs(12)) <> GBL_Board_ID Then
				Rs.Close
				Set Rs = Nothing
				GBL_CHK_TempStr = "错误,该主题不存在!<br>" & VbCrLf
				Exit Function
			Else
				LMT_RootID = Rs(0)
				Form_TopicType = Rs(1)
				Form_NeedValue = Rs(2)
				TParentID = cCur(Rs(3))
				Form_ChildNum = cCur(Rs(4))
				Form_RootMaxID = cCur(Rs(6))
				Form_RootMinID = cCur(Rs(7))
				LMT_TopicName = Rs(8)
				Article_NotReplay = Rs(9)
				LMT_RootIDBak = cCur(Rs(10))
				Form_ParentID = LMT_RootIDBak
				LMT_TopicTitleStyle = Rs(11)
				ac = Trim(Rs(13))
				Rs.Close
				Set Rs = Nothing
				If ac <> GBL_IPAddress Then
					Con.ExeCute("Update LeadBBS_Topic Set hits=hits+1,VisitIP='" & GBL_IPAddress & "' where ID=" & Form_ParentID)
					Con.ExeCute("Update LeadBBS_Announce Set hits=hits+1,VisitIP='" & GBL_IPAddress & "' where ID=" & Form_ParentID)
				End If
			End If
		End If
	End If

	If TParentID > 0 Then
		SQL = "Select top 1 Title,RootMaxID,RootMinID,Hits,ChildNum,ID,TitleStyle,VisitIP,RootID from LeadBBS_Topic where ID=" & LMT_RootIDBak
		Set Rs = Con.ExeCute(SQL)
		If Rs.Eof Then
			Rs.Close
			Set Rs = Nothing
			'GBL_CHK_TempStr = "错误,该主题已经删除!<br>" & VbCrLf
		Else
			LMT_TopicName = Rs(0)
			Form_RootMaxID = cCur(Rs(1))
			Form_RootMinID = cCur(Rs(2))
			Form_ChildNum = cCur(Rs(4))
			LMT_RootIDBak = cCur(Rs(5))
			LMT_TopicTitleStyle = Rs(6)
			ac = Trim(Rs(7))
			LMT_RootID = cCur(Rs(8))
			Rs.Close
			Set Rs = Nothing
			If ac <> GBL_IPAddress Then
				Con.ExeCute("Update LeadBBS_Topic Set hits=hits+1,VisitIP='" & GBL_IPAddress & "' where ID=" & LMT_RootIDBak)
				Con.ExeCute("Update LeadBBS_Announce Set hits=hits+1,VisitIP='" & GBL_IPAddress & "' where ID=" & LMT_RootIDBak)
			End If
		End If
	End If

	If Form_TopicType > 0 and Article_NotReplay = 0 Then
		If LMT_CheckFlag = 0 and GBL_UserID = 0 Then
			GBL_UserID = cCur(CheckPass)
			LMT_CheckFlag = 1
		End If
		Form_NeedValue = cCur(Form_NeedValue)
		Select case Form_TopicType
			Case 2: '仅本版版主
				If GBL_CHK_User <> "" Then
					If GBL_BoardMasterFlag <5 Then
						Article_NotReplay = 1
					End If
				Else
					Article_NotReplay = 1
				End If
			Case 4: '仅版主
				If GBL_BoardMasterFlag <4 Then
					Article_NotReplay = 1
				End If
			Case 6:
				If GBL_CHK_User = "" or GetBinarybit(GBL_CHK_UserLimit,2) <> 1 Then
					Article_NotReplay = 1
				End If
			Case 51:
				If GBL_CHK_Points < Form_NeedValue Then
					Article_NotReplay = 1
				End If
			Case 53:
				If GBL_CHK_OnlineTime < Form_NeedValue*60 Then
					Article_NotReplay = 1
				End If
		End Select
	End If

End Function

Function DisplayTopic

	Dim Rs,SQL
	Dim ALL_FirstID,ALL_LastID
	ALL_FirstID = Form_RootMaxID
	ALL_LastID = Form_RootMinID

	Dim ALL_Count
	ALL_Count = Form_ChildNum + 1

	Dim LMT_First,Temp1,Temp2
	Dim SQLEndString,Upflag,WhereFlag
	WhereFlag = 0

	LMT_First = Left(Request("First"),14)
	If isNumeric(LMT_First)=0 Then LMT_First=0
	LMT_First = cCur(LMT_First)
	
	Dim LastNum,LastNumBak
	LastNum = 0
	
	LastNumBak = (ALL_Count mod DEF_TopicContentMaxListNum)
	If LastNumBak = 0 Then LastNumBak = DEF_TopicContentMaxListNum
	
	Upflag = Request("Upflag")
	If Upflag<>"1" and Upflag<>"0" Then Upflag="0"
	If Upflag = "1" Then
		LastNum = Request("Num")
		If LastNum <> "" Then
			LastNum = LastNumBak
		End If
	End If

	Dim MaxPage
	Page = Left(Request("p"),14)
	If isNumeric(Page) = 0 or inStr(Page,".") > 0 Then Page = 0
	Page = cCur(Page)
	MaxPage = Fix(All_Count / DEF_TopicContentMaxListNum)
	If (All_Count mod DEF_TopicContentMaxListNum)<>0 Then MaxPage = MaxPage + 1
	MaxPage = MaxPage - 1
	If Page > MaxPage or LastNum > 0 Then
		Page = MaxPage
	End If

	Dim JMPage
	JMPage = Left(Request("q"),14)
	If isNumeric(JMPage) = 0 Then JMPage = 0
	JMPage = Fix(cCur(JMPage))
	If JMPage > DEF_MaxJumpPageNum Then JMPage = 0
	
	Dim JMPRootID
	JMPRootID = Left(Request("r"),14)
	If isNumeric(JMPRootID)=0 Then JMPRootID=0
	JMPRootID = Fix(cCur(JMPRootID))
	
	If JMPage > Maxpage or Maxpage < 0 Then JMPage = 0
	If Upflag="0" and JMPage+Page > MaxPage Then JMPage = 0
	If Upflag="1" and JMPage+Page < 0 Then JMPage = 0
	If JMPRootID > ALL_FirstID Then JMPage = 0
	If JMPRootID < ALL_LastID Then JMPage = 0
	
	If Upflag="1" Then
		Page = Page - JMPage
	Else
		Page = Page + JMPage
	End If
	
	If Page = 0 Then '开启此项则当页数为0时即忽略一切信息的返回首页
		JMPage = 0
		JMPRootID = 0
		LastNum = 0
		Upflag = "0"
		LMT_First = 0
	End If

	Dim HaveIDFlag
	Dim LastID,FirstID

	If Temp1+1<DEF_TopicContentMaxListNum Then

		SQLEndString = " where T1.RootIDBak=" & LMT_RootIDBak
		WhereFlag = 1
		If Upflag="0" Then
			If JMPage > 0 Then
				If JMPRootID<>0 Then
					If WhereFlag = 1 Then
						SQLEndString = SQLEndString & " And T1.ID>" & JMPRootID
					Else
						SQLEndString = SQLEndString & " Where T1.ID>" & JMPRootID
						WhereFlag = 1
					End If
				End If
			Else
				If LMT_First<>0 Then
					If WhereFlag = 1 Then
						SQLEndString = SQLEndString & " And T1.ID>" & LMT_First
					Else
						SQLEndString = SQLEndString & " Where T1.ID>" & LMT_First
						WhereFlag = 1
					End If
				End If
			End If
		Else
			If JMPage > 0 Then
				If WhereFlag = 1 Then
					SQLEndString = SQLEndString & " And T1.ID<" & JMPRootID
				Else
					SQLEndString = SQLEndString & " Where T1.ID<" & JMPRootID
					WhereFlag = 1
				End If
			Else
				If LMT_First>=ALL_FirstID Then
					If LMT_First<>0 Then
						If WhereFlag = 1 Then
							SQLEndString = SQLEndString & " And T1.ID<" & LMT_First
						Else
							SQLEndString = SQLEndString & " Where T1.ID<" & LMT_First
							WhereFlag = 1
						End If
					End If
				Else
					If LMT_First<>0 Then
						If WhereFlag = 1 Then
							SQLEndString = SQLEndString & " And T1.ID<" & LMT_First
						Else
							SQLEndString = SQLEndString & " Where T1.ID<" & LMT_First
							WhereFlag = 1
						End If
					End If
				End If
			End If
		End If

		Dim NoPage
		NoPage = 0
		
		If Page < 0 or (Page > MaxPage and MaxPage>=(DEF_MaxJumpPageNum-1)) or (Page > (DEF_MaxJumpPageNum-1) and Page<(MaxPage-DEF_MaxJumpPageNum+1)) Then NoPage = 1
		If (LMT_First > 0 or LastNum>0 or NoPage = 1) and JMPage < 1 Then
			If Upflag="0" Then
				SQLEndString = SQLEndString & " order by T1.ID ASC"
			Else
				SQLEndString = SQLEndString & " order by T1.ID DESC"
			End If
			If LastNum > 0 Then
				SQL = LastNum
			Else
				SQL = DEF_TopicContentMaxListNum
			End If
		Else
			If JMPage > 0 Then
				If Upflag="0" Then
					SQLEndString = SQLEndString & " order by T1.ID ASC"
					Upflag="0"
					SQL = (JMPage-1) * DEF_TopicContentMaxListNum + DEF_TopicContentMaxListNum
				Else
					SQLEndString = SQLEndString & " order by T1.ID DESC"
					Upflag="1"
					SQL = (JMPage-1) * DEF_TopicContentMaxListNum + DEF_TopicContentMaxListNum
				End If
			Else
				If Page < DEF_MaxJumpPageNum Then
					SQLEndString = SQLEndString & " order by T1.ID ASC"
					Upflag="0"
					SQL = Page * DEF_TopicContentMaxListNum + DEF_TopicContentMaxListNum
				Else
					SQLEndString = SQLEndString & " order by T1.ID DESC"
					Upflag="1"
					SQL = (MaxPage-Page) * DEF_TopicContentMaxListNum + LastNumBak
				End If
			End If
		End If

		Dim FirstID_2,LastID_2
		Dim GetData_2

		SQL = "Select top " & SQL & " T1.ID,T1.ParentID,T1.TopicSortID,T1.BoardID,T1.RootID,T1.ChildNum,T1.Layer,T1.Title,T1.PrintContent,T1.FaceIcon,T1.ndatetime,T1.LastTime,T1.Hits,T1.Length,T1.UserName,T1.UserID,T1.HTMLFlag,T1.UnderWriteFlag,T1.NotReplay,T1.IPAddress,T2.Mail,T2.OICQ,T2.Userphoto,T2.UserLevel,T2.Homepage,T2.PrintUnderwrite,T2.Points,T2.Officer,T2.OnlineTime,T2.Birthday,T2.ApplyTime,T2.Sex,T2.LastDoingTime,T2.AnnounceNum,T2.FaceUrl,T2.FaceWidth,T2.FaceHeight,T2.UserLimit,T1.TopicType,T1.NeedValue,T1.OtherInfo,T2.NongLiBirth,T2.ShowFlag,T2.NotSecret,T2.UserTitle,T1.TitleStyle,T1.PollNum,T2.CachetValue from LeadBBS_Announce as T1 left join LeadBBS_User as T2 on T2.Id=T1.Userid " & SQLEndString
		Set Rs = Con.ExeCute(SQL)
		If (LMT_First = 0 and LastNum = 0 and Page >= 1 and NoPage = 0) or JMPage > 0 Then
			If Not Rs.Eof Then
				If JMPage > 0 Then
					If Upflag="0" Then
						Rs.Move (JMPage-1)* DEF_TopicContentMaxListNum
					Else
						If Page < MaxPage Then
							Rs.Move (JMPage-2) * DEF_TopicContentMaxListNum + DEF_TopicContentMaxListNum
						End If
					End If
				Else
					If Page < DEF_MaxJumpPageNum Then
						Rs.Move Page * DEF_TopicContentMaxListNum
					Else
						If Page < MaxPage Then
							Rs.Move (MaxPage-Page-1) * DEF_TopicContentMaxListNum + LastNumBak
						End If
					End If
				End If
			End If
		End If

		If Not Rs.Eof Then
			HaveIDFlag = 1
			GetData_2 = Rs.GetRows(DEF_TopicContentMaxListNum)
		Else
			HaveIDFlag = 0
		End If
		Rs.Close
		Set Rs = Nothing

		If HaveIDFlag = 1 Then
			Temp2 = Ubound(GetData_2,2)
			FirstID_2 = cCur(GetData_2(0,0))
			LastID_2 = cCur(GetData_2(0,Temp2))
	
			If FirstID_2<LastID_2 Then
				SQL = FirstID_2
				FirstID_2 = LastID_2
				LastID_2 = SQL
			End If
	
			LastID = LastID_2
			FirstID = FirstID_2
		Else
			Temp2 = 0
		End If
	Else
		HaveIDFlag = 0
	End If

	SQL = "?BoardID=" & GBL_board_ID & "&ID=" & Form_parentID
	Dim PageSplitString,PageSplitString2
	PageSplitString = "<table width=100% border=0 cellspacing=1 cellpadding=0 bgcolor=" & DEF_BBS_DarkColor & " class=TBone><tr bgcolor=" & DEF_BBS_LightestColor & " height=25 class=TBBG9><td><table width=100% border=0 cellspacing=0 cellpadding=0><tr><td><img src=" & DEF_BBS_HomeUrl & "images/null.gif width=2 height=3><br>&nbsp;"
	If LastID <= All_LastID Then
		PageSplitString = PageSplitString & "<font color=888888><font face=webdings title=首页>9</font></font>"
		PageSplitString = PageSplitString & " <font color=888888><font face=webdings title=上页>7</font></font>"
	Else
		PageSplitString = PageSplitString & "<a href=announce.asp" & SQL & "><font face=webdings title=首页>9</font></a>"
		PageSplitString = PageSplitString & " <a href=announce.asp" & SQL & "&First=" & LastID & "&Upflag=1&p=" & Page-1 & "><font face=webdings title=上页>7</font></a>"
	End If


	Dim DN,N
	DN = DEF_DisplayJumpPageNum
	Dim For1,For2,StepValue,DotFlag
	DotFlag = 0
	PageSplitString = PageSplitString & " "

	If MaxPage > 0 Then
		For1 = Page - DN
		For2 = Page + DN
		If For1 < 0 Then
			For1 = 0
		ElseIf For1 > 0 Then
			PageSplitString = PageSplitString & " ..."
		End If
		If For2 >= MaxPage Then
			For2 = MaxPage
		End If
		If For2 > MaxPage Then For2 = MaxPage
		For N = For1 to For2
			If N <> For1 Then PageSplitString = PageSplitString & " "
			If N = Page Then
				PageSplitString = PageSplitString & "<font color=Red class=RedFont>" & N + 1 & "</font>"
			Else
				If (N-Page) > 0 Then
					PageSplitString = PageSplitString & "<a href=announce.asp" & SQL & "&r=" & FirstID & "&Upflag=0&p=" & page & "&q=" & N-Page & ">" & N + 1 & "</a>"
				Else
					PageSplitString = PageSplitString & "<a href=announce.asp" & SQL & "&r=" & LastID & "&Upflag=1&p=" & page & "&q=" & Page-N & ">" & N + 1 & "</a>"
				End If
				'PageSplitString = PageSplitString & "<a href=" & BoardUrlString & SQL & "&p=" & N & ">" & N + 1 & "</a>"
			End If
			DotFlag = 2
		Next
		If For2 < MaxPage Then
			PageSplitString = PageSplitString & "..."
			DotFlag = 1
		End If
	Else
		PageSplitString = PageSplitString & " <font color=888888 class=GrayFont>1</font> "
	End If

	PageSplitString = PageSplitString & " "
	
	If FirstID >= All_FirstID Then
		PageSplitString = PageSplitString & " <font color=888888><font face=webdings title=下页>8</font></font>"
		PageSplitString = PageSplitString & " <font color=888888><font face=webdings title=尾页>:</font></font>"
	Else
		PageSplitString = PageSplitString & " <a href=announce.asp" & SQL & "&First=" & FirstID & "&p=" & Page+1 & "><font face=webdings title=下页>8</font></a>"
		PageSplitString = PageSplitString & " <a href=announce.asp" & SQL & "&Upflag=1&Num=1&p=" & MaxPage & "><font face=webdings title=尾页>:</font></a>"
	End If
	Rs = Temp1
	Rs = Temp2+Rs

	If HaveIDFlag = 1 Then Rs = Rs+1
	If Rs < 3 and GBL_ShowBottomSure = 0 then GBL_SiteBottomString = ""
	PageSplitString = PageSplitString & " 此主题共有<b>" & ALL_Count &"</b>帖 此页<b>" & Rs & "</b>帖 每页<b>" & DEF_TopicContentMaxListNum & "</b>帖<td align=right><img src=" & DEF_BBS_HomeUrl & "images/null.gif width=2 height=2><br>"
	PageSplitString2 = "</td></tr></table></td></tr></table>"

	For1 = 0
	For2 = 0
	If HaveIDFlag = 1 Then
		If GBL_TableHeadString <> "" Then Response.Write GBL_TableHeadString%>
	<table width="100%" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor=<%=DEF_BBS_DarkColor%> class=TBone>
	<tr bgcolor=<%=DEF_BBS_LightDarkColor%>><td colspan=2 class=TBHead2>
		<img src=../images/null.gif width=2 height=2><br>
		&nbsp;<b><font color=ffffff class=HeadFont>帖子主题: <%
		SQL = LMT_TopicNameNoHTML
		If strLength(SQL)>DEF_BBS_DisplayTopicLength+30 Then
			SQL = LeftTrue(SQL,DEF_BBS_DisplayTopicLength+27) & "..."
		End if
		Response.Write htmlencode(SQL)%></font></b></td></tr>
	</table>
	<%
	Else
		If GBL_ShowBottomSure = 0 Then GBL_SiteBottomString = ""
	End If
	
	If Upflag="0" Then
		If HaveIDFlag = 1 Then
			If Upflag="0" Then
				For1 = 0
				For2 = Temp2
				StepValue = 1
			Else
				For1 = Temp2
				For2 = 0
				StepValue = -1
			End If
			DisplayDataPage For1,For2,StepValue,GetData_2
		End If
	Else
		If HaveIDFlag = 1 Then
			If Upflag="0" Then
				For1 = 0
				For2 = Temp2
				StepValue = 1
			Else
				For1 = Temp2
				For2 = 0
				StepValue = -1
			End If
			DisplayDataPage For1,For2,StepValue,GetData_2
		End If
	End If
	Response.Write PageSplitString%>
	<!-- #include file=../inc/IncHtm/BoardJump.asp -->
	<%
	Response.Write PageSplitString2
	If GBL_TableBottomString <> "" Then Response.Write GBL_TableBottomString
	Response.Write "</td></tr></table>"

End Function

Function DisplayDataPage(For1,For2,StepValue,GetData)

			%>
			<script language=javascript>
				function opw(f,r,id)
				{
					window.open(f+'?BoardID=<%=GBL_board_ID%>&'+r+'='+id,'','width=450,height=37,scrollbars=auto,status=no');
				}
			</script>
			<%
	Dim N,Flag,i,Rs
	Flag = 0
	i = 0
	For N = For1 to For2 Step StepValue
		i = i + 1
		If isNull(GetData(23,n)) Then
			GetData(20,n) = ""
			GetData(21,n) = 0
			GetData(22,n) = 0
			GetData(23,n) = 0
			GetData(24,n) = ""
			GetData(25,n) = ""
			GetData(26,n) = 0
			GetData(27,n) = 0
			GetData(28,n) = 0
			GetData(29,n) = 0
			GetData(30,n) = 0
			GetData(31,n) = "密"
			GetData(32,n) = 0
			GetData(33,n) = 0
			GetData(34,n) = ""
			GetData(35,n) = 0
			GetData(36,n) = 0
			GetData(37,n) = 0
			GetData(40,n) = ""
			GetData(42,n) = 1
			GetData(44,n) = ""
			GetData(47,n) = 0
		End If
	%><table width="100%" border="0" cellspacing="1" cellpadding="5" align="center" bgcolor=<%=DEF_BBS_DarkColor%> class=TBone>
	<tr<%
	If Flag = 0 Then
		Response.Write " bgcolor=" & DEF_BBS_LightestColor & " class=TBBG9"
		Flag = 1
	Else
		Response.Write " bgcolor=" & DEF_BBS_LightColor & " class=TBBG1"
		Flag = 0
	End If%>>
		<td height=20 width=<%=DEF_BBS_LeftTDWidth%> align=center valign=top>
			<img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=<%=DEF_BBS_LeftTDWidth%> height=2><table align=center width=90% cellspacing="0" cellpadding="0"><tr><td>
			<%
			If (Not isNull(GetData(44,n))) and GetData(44,n) <> "" Then Response.write "<table style=""filter:glow(color=#ffffff, strength=1)"" width=100% border=0 cellspacing=0 cellpadding=0><tr><td><font style=""line-height:18px"">头衔：" & htmlencode(GetData(44,n)) & "<br><img src=../images/blank.gif height=4 width=2><br></table>"
			Response.Write "<table border=0 width=100% cellspacing=0 cellpadding=0><tr><td>"
			GetData(15,n) = cCur(GetData(15,n))
			If GetData(15,n) > 0 Then
				Response.write "<a href=" & DEF_BBS_HomeUrl & "User/LookUserInfo.asp?ID=" & GetData(15,n)
				If CheckSupervisorUserName = 1 and GBL_UserID > 0 Then Response.Write " title=""IP地址:" & GetData(19,n) & """ "
				Response.Write ">"
			End If
			Response.Write "<img src="
			If GetData(35,n) > DEF_AllFaceMaxWidth Then GetData(35,n) = DEF_AllFaceMaxWidth
			If GetData(36,n) > DEF_AllFaceMaxWidth*2 Then GetData(36,n) = DEF_AllFaceMaxWidth
			If DEF_AllDefineFace = 1 and GetData(34,n) <> "" Then
				Response.Write chr(34) & htmlencode(GetData(34,n)) & chr(34) & " width=" & GetData(35,n) & " height=" & GetData(36,n) & " border=0>"
			Else
				Response.Write DEF_BBS_HomeUrl & "images/face/" & string(4-len(cstr(GetData(22,n))),"0")&GetData(22,n) & ".gif border=0 width=62 height=62>"
			End If
			If GetData(15,n) > 0 Then Response.Write "</a>"
			Response.write "</td><td valign=top align=right>"

			Dim OnlineFlag
			If (GetData(42,n) = 1 or GetData(42,n) = True) and DEF_EnableUserHidden = 1 Then
				OnlineFlag = 0
			Else
				OnlineFlag = DateDiff("s",RestoreTime(GetData(32,n)), now)
				If OnlineFlag < 0 or OnlineFlag > DEF_UserOnlineTimeOut Then
					OnlineFlag = 0
				Else
					OnlineFlag = 1
				End If
			End If

			If GetData(14,n) = "游客" and GetData(15,n) = 0 Then OnlineFlag = 1

			Select Case GetData(31,n)
			Case "女"
				If OnlineFlag = 1 Then
					Response.Write "<img src=" & DEF_BBS_HomeUrl & "images/" & GBL_DefineImage & "sxmg/FeMale.gif align=absmiddle Alt=美女，在线 width=23 height=21>"
				Else
					Response.Write "<img src=" & DEF_BBS_HomeUrl & "images/" & GBL_DefineImage & "sxmg/OfFeMale.gif align=absmiddle Alt=美女，离线 width=23 height=21>"
				End If
			Case "男"
				If OnlineFlag = 1 Then
					Response.Write "<img src=" & DEF_BBS_HomeUrl & "images/" & GBL_DefineImage & "sxmg/Male.gif align=absmiddle Alt=帅哥，在线 width=23 height=21>"
				Else
					Response.Write "<img src=" & DEF_BBS_HomeUrl & "images/" & GBL_DefineImage & "sxmg/OfMale.gif align=absmiddle Alt=帅哥，离线 width=23 height=21>"
				End If
			Case Else
				If OnlineFlag = 1 Then
					Response.Write "<img src=" & DEF_BBS_HomeUrl & "images/" & GBL_DefineImage & "sxmg/Male.gif align=absmiddle Alt=在线 width=23 height=21>"
				Else
					Response.Write "<img src=" & DEF_BBS_HomeUrl & "images/" & GBL_DefineImage & "sxmg/OfMale.gif align=absmiddle Alt=离线 width=23 height=21>"
				End If
			End Select

			Response.Write "</td>"
			Response.Write "</tr></table>"
			Response.Write "<img src=" & DEF_BBS_HomeUrl & "images/null.gif width=2 height=5 border=0><br>"
			If GetData(15,n) > 0 Then
				Response.Write "<a href=" & DEF_BBS_HomeUrl & "User/LookUserInfo.asp?ID=" & GetData(15,n) & ">" & htmlencode(GetData(14,n)) & "</a>"
			Else
				Response.Write htmlencode(GetData(14,n))
			End If
			Response.Write "&nbsp;"
			If len(GetData(29,n))=14 Then
				GetData(29,n) = RestoreTime(Left(GetData(29,n),8))
				If isTrueDate(GetData(29,n)) Then
					Response.Write " " & Constellation(GetData(29,n))
				End If
				If Len(GetData(41,n)) = 14 Then
					Response.Write " " & DisplayBirthAnimal(year(ReStoreTime(GetData(41,n))))
				End If
			End If

			Response.Write "</td></tr><tr><td>"
			Form_ID = GetData(23,n)
			If Form_ID > 10 Then Form_ID = 10

			Response.Write "<img src=" & DEF_BBS_HomeUrl & "images/null.gif width=2 height=5 border=0><br><img src=" & DEF_BBS_HomeUrl & "images/" & GBL_DefineImage & "lvstar/level" & GetData(23,N) & ".gif align=absmiddle width=110 height=11><br>"
			Response.Write "<img src=" & DEF_BBS_HomeUrl & "images/null.gif width=2 height=5 border=0><br>"
			If GetData(27,n)<>"0" and GetData(27,n) <> "" Then
				Response.write "荣誉：" & Replace(DisplayOfficerString(GetData(27,n)),",","<br>&nbsp; &nbsp; &nbsp; ") & "<br>"
			End If
			If GetBinarybit(GetData(37,n),10) = 1 Then
				Response.write "职务：总版主<br>"
			ElseIf GetBinarybit(GetData(37,n),8) = 1 Then
				Response.write "职务：论坛版主<br>"
			ElseIf GetBinarybit(GetData(37,n),2) = 1 Then
				Response.write "认证：认证会员<br>"
			End If

			If GetData(47,n) <> 0 Then
				If GetData(47,n) > 127 Then
					GetData(47,n) = 127-GetData(47,n)
				Else
					GetData(47,n) = "<font color=blue class=BlueFont>＋" & GetData(47,n) & "</font>"
				End If
				Response.write "威望：" & GetData(47,n) & "<br>"
			End If
			Response.write "级别：" & DEF_UserLevelString(GetData(23,N)) & "<br>"

			If GetData(15,n) > 0 Then
				Response.Write "" & DEF_PointsName & "：" & GetData(26,n) & "<br>"
				Response.Write "经验：" & CLng(cCur(GetData(28,n))/60) & "<br>"
				Response.Write "文章：" & GetData(33,n) & "<br>"
				Response.Write "注册：" & Mid(RestoreTime(GetData(30,n)),3,14)
			End If
			%>
			<br>
			</td></tr></table>
		</td>
		<td height=20 valign=top><table width=100% height=100% style="table-layout:fixed; word-break:break-all"><tr><td width=2><img src=<%=DEF_BBS_HomeUrl%>images/blank.gif width=2 height=2></td><td valign=top>
			<table align=center width=100% border="0" cellspacing="0" cellpadding="0"><tr><td>
			<%
			Response.Write "<img src=" & DEF_BBS_HomeUrl & "images/" & GBL_DefineImage & "bf/face" & GetData(9,n) & ".gif align=absbottom width=20 height=20>"
			Response.Write "发表: " & RestoreTime(GetData(10,n))
			If cCur(GetData(1,n)) = 0 Then Response.Write " 人气:" & GetData(12,n)
			'If GetData(15,n) > 0 Then Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href=" & DEF_BBS_HomeUrl & "User/LookUserInfo.asp?ID=" & GetData(15,n) & "><img src=../images/" & GBL_DefineImage & "userinfo.gif border=0 title=查看此用户资料 align=absmiddle width=16 height=16></a>"
			If isNull(GetData(21,n)) or GetData(21,n)="" Then GetData(21,n)=0
			'If cCur(GetData(21,n))>=10000 Then Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href=http://search.tencent.com/cgi-bin/friend/user_show_info?ln=" & GetData(21,n) & " target=_blank><img src=../images/" & GBL_DefineImage & "oicq.gif border=0 title=查看OICQ资料 align=absmiddle width=16 height=16></a>"
			If trim(GetData(24,n))<>"" Then
				If Left(lcase(GetData(24,n)),4)<>"http" Then GetData(24,n) = "http://" & GetData(24,n)
				Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href=""" & htmlencode(GetData(24,n)) & """ target=_blank><img src=../images/" & GBL_DefineImage & "home.gif border=0 title=此用户主页 align=absmiddle width=16 height=16></a>"
			End if

			'If GetData(20,n)<>"" and (GetData(43,n) = 1 or GetData(43,n) = True) Then
			'	Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href=""mailto:" & htmlencode(GetData(20,n)) & """ target=_blank><img src=../images/" & GBL_DefineImage & "mail.gif border=0 title=给此用户发邮件 align=absmiddle width=16 height=15></a>"
			'End if

			If Article_NotReplay <> 1 Then Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href=""Announce2.asp?BoardID=" & GBL_board_ID & "&ID=" & GetData(0,n) & "&submitflag=first&repost=1""><img src=../images/" & GBL_DefineImage & "re.gif border=0 title=引用回复 align=absmiddle width=16 height=16></a>"

			If GetData(15,n) > 0 Then Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href=""" & DEF_BBS_HomeUrl & "User/SendMessage.asp?SdM_ToUser=" & urlencode(GetData(14,n)) & """><img src=../images/" & GBL_DefineImage & "message.GIF border=0 title=给" & htmlencode(GetData(14,n)) & "发消息 align=absmiddle width=16 height=16></a>"

			If GBL_CHK_User <> "" and (GBL_BoardMasterFlag >= 5 or GetData(14,n) = GBL_CHK_User) Then
				Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href=""Editannounce.asp?BoardID=" & GBL_board_ID & "&ID=" & GetData(0,n) & """><img src=../images/" & GBL_DefineImage & "edit.gif border=0 title=修改帖子内容 align=absmiddle width=16 height=16></a>"
				Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href='javascript:opw(""TypeSetAnnounce.asp"",""RepairID""," & GetData(0,n) & ");'><img src=../images/" & GBL_DefineImage & "ts.gif border=0 title=自动排版消除多余换行 align=absmiddle width=16 height=16></a>"
			End If

			If GBL_CHK_User <> "" and GetData(15,n) > 0 Then Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href='javascript:opw(""AddFriend.asp"",""AddSureFlag=yes&FriendName"",""" & htmlencode(GetData(14,n)) & """);'><img src=../images/" & GBL_DefineImage & "friend.gif border=0 title=加此用户为好友 align=absmiddle width=16 height=16></a>"
			If cCur(GetData(1,n)) = 0 and GBL_CHK_User <> "" Then Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href='javascript:opw(""Collectannounce.asp"",""CollectID""," & GetData(0,n) & ");'><img src=../images/" & GBL_DefineImage & "collect.GIF border=0 title=收藏此主题 align=absmiddle width=16 height=16></a>"
			If GBL_CHK_User <> "" and GBL_BoardMasterFlag >= 5 Then
				If GetBinarybit(GBL_Board_BoardLimit,5) = 0 and GetBinarybit(GBL_CHK_UserLimit,5) = 0 Then
					Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href='javascript:opw("""
					If DEF_EnableDelAnnounce = 0 and cCur(GetData(1,n)) = 0 Then
						Response.Write "MoveAnnounce.asp"",""MoveID"",""" & GetData(0,n) & "&BoardID2=444"""
					Else
						Response.Write "DelAnnounce.asp"",""DelID"",""" & GetData(0,n) & """"
					End If
					Response.Write ");'><img src=../images/" & GBL_DefineImage & "Del.GIF border=0 title=删除此帖子 align=absmiddle width=16 height=16></a>"
				End If
				If cCur(GetData(1,n)) = 0 Then
					If GetBinarybit(GBL_CHK_UserLimit,6) = 0 Then Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href='javascript:opw(""MakeGood.asp"",""GoodID""," & GetData(0,n) & ");'><img src=../images/" & GBL_DefineImage & "jh.GIF border=0 title=精华或取消精华此帖子 align=absmiddle width=16 height=16></a>"
					Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href='javascript:opw(""Topannounce.asp"",""TopID""," & GetData(0,n) & ");'><img src=../images/" & GBL_DefineImage & "ti.GIF border=0 title=提取主题到最首位置 align=absmiddle width=16 height=16></a>"
					Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href='javascript:opw(""RepairAnnounce.asp"",""RepairID""," & GetData(0,n) & ");'><img src=../images/" & GBL_DefineImage & "repair.GIF border=0 title=修复此主题帖子 align=absmiddle width=16 height=16></a>"
					If GetBinarybit(GBL_CHK_UserLimit,9) = 0 Then Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href='javascript:opw(""Moveannounce.asp"",""MoveID""," & GetData(0,n) & ");'><img src=../images/" & GBL_DefineImage & "move.GIF border=0 title=转移此主题到其它版面 align=absmiddle width=16 height=16></a>"
					Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href='javascript:opw(""MakeTopAnc.asp"",""TopID""," & GetData(0,n) & ");'><img src=../images/" & GBL_DefineImage & "maketop.GIF border=0 title=主题固顶或取消固顶 align=absmiddle width=16 height=16></a>"
					If GBL_BoardMasterFlag >= 7 Then Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href='javascript:opw(""MakeAlltopAnc.asp"",""TopID""," & GetData(0,n) & ");'><img src=../images/" & GBL_DefineImage & "makealltop.GIF border=0 title=主题总固顶或取消总固顶 align=absmiddle width=16 height=16></a>"
				End If
			End If

			If cCur(GetData(1,n)) = 0 Then
				Response.Write "</td><td align=right><font color=888888><b>楼主</b></font></td></tr></table>"
			Else
				Response.Write "</td><td align=right><font color=888888>第<b>" & page*DEF_TopicContentMaxListNum+i & "</b>楼</font></td></tr></table>"
			End If

			If GetData(38,n) > 0 and cCur(GetData(1,n)) = 0 and GetData(38,n) <> 80 Then
				GetData(39,n) = cCur(GetData(39,n))
				If LMT_CheckFlag = 0 and GBL_UserID = 0 Then
					GBL_UserID = cCur(CheckPass)
					LMT_CheckFlag = 1
				End If
				Select case GetData(38,n)
					Case 1:
						If GBL_CHK_User <> "" Then
							If GBL_BoardMasterFlag < 5 Then
								GetData(8,n) = GetFobStr("此帖只有本版版主才能查看")
							Else
								GetData(40,N) = GetData(40,N) & " 此帖只有本版版主才能查看"
							End If
						Else
							GetData(8,n) = GetFobStr("此帖只有本版版主才能查看")
						End If
					Case 3:
						If GBL_BoardMasterFlag < 4 Then
							GetData(8,n) = GetFobStr("此帖只有版主才能查看")
						Else
							GetData(40,N) = GetData(40,N) & " 此帖只有版主才能查看"
						End If
					Case 7:
						If GBL_UserID > 0 Then
							If GBL_UserID <> cCur(GetData(15,n)) Then
								Set Rs = Con.ExeCute("Select top 1 ID from LeadBBS_Announce where UserID=" & GBL_UserID & " and ParentID=" & GetData(0,N))
								If Rs.Eof Then
									GetData(8,n) = GetFobStr("回复此帖才能查看内容")
								Else
									GetData(40,N) = GetData(40,N) & " 回复此帖才能查看内容"
								End If
								Rs.Close
								Set Rs = Nothing
							Else
								GetData(40,N) = GetData(40,N) & " 回复此帖才能查看内容"
							End If
						Else
							GetData(8,n) = GetFobStr("回复此帖才能查看内容")
						End If
					Case 54:
						If GBL_UserID > 0 Then
							If GBL_UserID <> cCur(GetData(15,n)) and GetData(39,n) > 0 Then
								Set Rs = Con.ExeCute("Select top 1 ID from LeadBBS_VoteUser where AnnounceID=" & GetData(0,N) & " and UserName='" & Replace(GBL_CHK_User,"'","''") & "'")
								If Rs.Eof Then
									If GBL_CHK_Points < GetData(39,n) Then
										GetData(8,n) = GetFobStr("购买此帖需要花费" & GetData(39,n) & "" & DEF_PointsName & "，可惜你的" & DEF_PointsName & "不够，不能购买")
									Else
										GetData(8,n) = GetFobStr("购买此帖需要花费" & GetData(39,n) & "" & DEF_PointsName & "，<a href='javascript:opw(""BuyAnnounce.asp"",""BoardID=" & GBL_board_ID & "&AnnounceID"",""" & GetData(0,N) & """);'>点击购买帖子</a>")
									End If
								End If
								Rs.Close
								Set Rs = Nothing
							End If
						Else
							GetData(8,n) = GetFobStr("游客无权浏览限制帖子")
						End If
					Case 5:
						If GBL_CHK_User = "" or GetBinarybit(GBL_CHK_UserLimit,2) <> 1 or GBL_UserID = 0 Then
							GetData(8,n) = GetFobStr("此帖只有认证会员才能查看")
						Else
							GetData(40,N) = GetData(40,N) & " 此帖只有认证会员才能查看"
						End If
					Case 50:
						If GBL_CHK_Points < GetData(39,n) Then
							GetData(8,n) = GetFobStr("此帖需要" & DEF_PointsName & "" & GetData(39,n) & "才能查看")
						Else
							GetData(40,N) = GetData(40,N) & " 此帖需要" & DEF_PointsName & "" & GetData(39,n) & "才能查看"
						End If
					Case 52:
						If GBL_CHK_OnlineTime < GetData(39,n)*60 Then
							GetData(8,n) = GetFobStr("此帖需要经验" & GetData(39,n) & "才能查看")
						Else
							GetData(40,N) = GetData(40,N) & " 此帖需要经验" & GetData(39,n) & "才能查看"
						End If
				End Select
			End If
			If GetBinarybit(GetData(37,n),7) = 1 Then
				Response.Write "<br><span style=""line-height:15pt;"">" & GetFobStr("该用户发言已经被屏蔽") & "</span><br>"
			Else
				Response.Write "<br><span style=""line-height:15pt;"">"
				'If "Re:" & LMT_TopicNameNoHTML <> htmlencode(GetData(7,n)) Then Response.Write "<b>" & DisplayAnnounceTitle(GetData(7,n),GetData(45,n)) & "</b><br><br>" & VbCrLf
				If Left(GetData(7,n),3) <> "Re:" or cCur(GetData(1,n)) = 0 Then Response.Write "<b>" & DisplayAnnounceTitle(GetData(7,n),GetData(45,n)) & "</b><br><br>" & VbCrLf
				If GetData(38,n) = 80 Then DisplayVoteForm GetData(0,n),0
				If DEF_AnnounceFontSize <> "0" then Response.Write "<span style=font-size:" & DEF_AnnounceFontSize & ">"
				Response.Write GetData(8,n)
				If DEF_AnnounceFontSize <> "0" then Response.Write "</span>"
				Response.Write "</span>"

				If GetData(38,n) = 54 Then
					If cCur(GetData(46,n)) = 0 Then
						Response.Write "<p>[<font color=888888 class=GrayFont>此帖为出售帖，目前还没有人购买。</font>]"
					Else
						Response.Write "<p>[<font color=888888 class=GrayFont>此帖为出售帖，已经有<a href=#438 onclick='javascript:window.open(" & chr(34) & "BuyUser.asp?BoardID=" & GBL_board_ID & "&AnnounceID=" & GetData(0,n) & chr(34) & "," & chr(34) & chr(34) & "," & chr(34) & "width=450,height=400 scrollbars=yes" & chr(34) & ");'><b>" & GetData(46,n) & "</b></a>人购买了此帖</font>]"
					End If
				End If
				If GetData(40,N) <> "" Then Response.Write "<br><br>[ <font color=888888 class=GrayFont>" & GetData(40,N) & "</font> ]&nbsp; &nbsp;"

				If DEF_EnableUnderWrite = 0 Then GetData(25,n) = DEF_SiteNameString & "感谢您的参与"
				If GetData(17,n) = 1 And trim(GetData(25,n)&" ")<>"" Then
					Response.Write "</td></tr><tr><td width=8><img src=../images/blank.gif width=8 height=2></td><td valign=bottom><br>"
					Response.Write "<table width=319 border=0 cellspacing=0 cellpadding=0 style='table-layout:fixed; word-break:break-all'><tr><td><img src=../images/" & GBL_DefineImage & "signature.gif width=420 height=17 border=0><br>"
					Response.Write GetData(25,n)
					Response.Write "<br><img src=../images/blank.gif width=2 height=6>"
					Response.Write "</td></tr></table>"
				Else
					Response.Write "<br><img src=../images/blank.gif width=2 height=2>"
				End If
			End If
			%>
			</td></tr></table>
		</td>
	</tr>
	</table>
	
<%
	Next

End Function

Function GetFobStr(Str)

	GetFobStr = "<font color=888888 class=GrayFont>-----------------------------------------------------<br>" & _
				"<font color=blue class=BlueFont>" & Str & "</font>[<a href=../User/help/help.asp#lmt>说明</a>]<br>" & _
				"-----------------------------------------------------</font><br>"

End Function


sub Main

	GBL_CHK_PWdFlag = 0
	GBL_UserID = 0
	If CheckSupervisorUserName = 1 Then
		'GBL_CHK_PWdFlag = 1
	End If
	initDatabase
	CheckisBoardMaster
	GBL_CHK_TempStr = ""
	GetRequestValue
	GetTopicInfo

	Dim Temp
	If LMT_TopicTitleStyle = 1 Then
		LMT_TopicNameNoHTML = KillHTMLLabel(LMT_TopicName)
	Else
		LMT_TopicNameNoHTML = htmlencode(LMT_TopicName)
	End If
	Temp = LMT_TopicNameNoHTML
	If strLength(Temp)>DEF_BBS_DisplayTopicLength-6 Then
		Temp = LeftTrue(Temp,DEF_BBS_DisplayTopicLength-9) & "..."
	Else
		Temp = Temp
	End if
	BBS_SiteHead DEF_SiteNameString & " " & DEF_BBS_Name,GBL_board_ID," &gt;&gt; 查看帖子"
	CheckAccessLimit

	If GBL_CHK_TempStr = "" Then
		UpdateOnlineUserAtInfo GBL_board_ID,GBL_Board_BoardName & "→" & Temp
	%>
	
	<table width=<%=DEF_BBS_ScreenWidth%> border=0 cellspacing=1 cellpadding=0 align="center" bgcolor=<%=DEF_BBS_DarkColor%> class=<%If GBL_TableHeadString = "" Then
		Response.Write "TBone"
	Else
		Response.Write "TBthree"
	End If%>><tr><td>
	<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr bgcolor=<%=DEF_BBS_Color%> class=TBthree><td colspan=2><img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=2 height=2></td></tr>
	<tr bgcolor=<%=DEF_BBS_Color%> class=TBthree>
		<td height=20><%If GBL_TableHeadString = "" Then Response.Write "&nbsp;"%><a href=Announce2.asp?BoardID=<%=GBL_board_ID%>><img src=../images/<%=GBL_DefineImage%>newanc.gif width=72 height=17 border=0 align=absmiddle alt=新帖></a>
			<a href=Announce2.asp?BoardID=<%=GBL_board_ID%>&VoteFlag=yes><img src=../images/<%=GBL_DefineImage%>newpoll.gif width=72 height=17 border=0 align=absmiddle alt=新投票></a><%If Article_NotReplay = 1 Then
				Response.Write " <img src=../images/" & GBL_DefineImage & "reanc.gif width=72 height=17 border=0 align=absmiddle alt=回复帖子>"
			Else%>
			<a href=Announce2.asp?BoardID=<%=GBL_board_ID%>&ID=<%=Form_parentID%>&submitflag=first><img src=../images/<%=GBL_DefineImage%>reanc.gif width=72 height=17 border=0 align=absmiddle alt=回复帖子></a><%End If%>
		</td>
		<td align=right>
			<a href=announce.asp?BoardID=<%=GBL_board_ID%>&ID=<%=Form_parentID%>&ac=pre&rd=<%=LMT_RootID%>>上篇</a>
			<a href="javascript:this.location.reload();">刷新</a>
			<a href="announce2.asp?BoardID=<%=GBL_board_ID%>&ID=<%=Form_parentID%>">树型</a>
			<a href=announce.asp?BoardID=<%=GBL_board_ID%>&ID=<%=Form_parentID%>&ac=nxt&rd=<%=LMT_RootID%>>下篇</a>
			<%If GBL_TableHeadString = "" Then Response.Write "&nbsp;"%>
		</td>
	</tr>
	</table>
	</td></tr></table>
	<img src=../images/null.gif width=2 height=4><br><%End If%>
	<table width="<%=DEF_BBS_ScreenWidth%>" border="0" cellspacing="0" cellpadding="0" align="center"><tr><td><%
	If GBL_CHK_TempStr = "" Then
		DisplayTopic
		GetRequestValue
		DisplayAnnounceForm
		GBL_CHK_TempStr = ""
	Else
		If GBL_ShowBottomSure = 0 Then GBL_SiteBottomString = ""
		Response.Write "<br><font color=ff0000 class=RedFont><b>" & GBL_CHK_TempStr & "</b></font><br>"
	End If
	%></td></tr></table>
	<%
	If GBL_CHK_TempStr <> "" Then
		Response.Write "<hr size=1 align=center width=" & DEF_BBS_ScreenWidth & " class=TBtwofont>"
	End If
	CloseDatabase%>
	<p align=center class=NavColor>
	<a name=bottom></a>Copyright <font size=2>&copy;</font> 2000-<%=year(date)%>&nbsp;<%=DEF_SiteNameString%> 版权所有<br>
	<br><a href=http://www.leadbbs.com target=_blank><b><font color=ff0000>LeadBBS</font></b></a> v2.77<%
	DEF_PageExeTime1 = FormatNumber(cCur(Timer - DEF_PageExeTime1),3,True)
	
	Response.Write " <font class=NavColor>耗时" & DEF_PageExeTime1*1000 & "毫秒</font>"
	%><br><%
	If GBL_SiteBottomString <> "" Then Response.Write GBL_SiteBottomString%>
	</BODY>
	</HTML>
    <%

End Sub

Main
%>
    <script language=javascript>
suspendcode="<DIV id=backi style='right:0px;POSITION:absolute;TOP:200px;'><a href='javascript:history.back()' title='返回'><img border=0 src=/bbs/pic/lw.gif ></a><br><a href='#top' title='顶部'><img border=0 src=/bbs/pic/uw.gif ></a><br><a href='#bottom' title='底部'><img border=0 src=/bbs/pic/dw.gif ></a></div>"
document.write(suspendcode);

lastScrollY=0;
function heartBeat(){
diffY=document.body.scrollTop;
percent=.1*(diffY-lastScrollY);
if(percent>0)percent=Math.ceil(percent);
else percent=Math.floor(percent);

document.all.backi.style.pixelTop+=percent;
lastScrollY=lastScrollY+percent;
}
window.setInterval("heartBeat()",1);
</script>
