<!-- #include file=../inc/BBSsetup.asp -->
<!-- #include file=../inc/User_Setup.ASP -->
<!-- #include file=../inc/Board_Popfun.asp -->
<!-- #include file=../inc/Constellation.asp -->
<!-- #include file=../inc/Limit_Fun.asp -->
<!-- #include file=inc/Poll_fun.asp -->
<%
Const LMT_RefreshEnable = 1

DEF_BBS_HomeUrl = "../"
Dim Article_NotReplay,Page
Article_NotReplay = 0
Dim Form_ParentID
Dim Form_RootMinID,Form_RootMaxID,Form_ChildNum

Form_RootMaxID = 0
Form_RootMinID = 0
Form_ChildNum = 0

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

Dim LMT_BoardUrl,LMT_BoardString



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 GetUserName(UserID)

	Dim Rs,SQL
	SQL = "Select top 1 UserName from LeadBBS_User Where ID=" & UserID
	Set Rs = Con.ExeCute(SQL)
	If Rs.Eof Then
		GetUserName = ""
	Else
		SQL = Rs(0)
		If isNull(SQL) Then SQL = 0
		GetUserName = SQL
	End If
	Rs.Close
	Set Rs = Nothing

End Function

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

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,Hits
	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 max(RootID) from LeadBBS_Topic where boardid=" & GBL_board_ID & " and RootID<" & rd
					Set Rs = Con.ExeCute(SQL)
					GBL_DBNum = GBL_DBNum + 1
					If Not Rs.Eof Then
						SQL = Rs(0)
						If isNull(SQL) Then SQL = 0
						SQL = cCur(SQL)
						If SQL >0 Then
							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=" & SQL
						Else
							SQL = ""
						End If
					Else
						SQL = ""
					End If
					Rs.Close
					Set Rs = Nothing
			Case Else: SQL = ""
		End Select
	End If

	If SQL <> "" Then
		'Response.Write "<p>spend1:" & FormatNumber(cCur(Timer - DEF_PageExeTime1),4,True)
		Set Rs = Con.ExeCute(SQL)
		'Response.Write "<p>spend2:" & FormatNumber(cCur(Timer - DEF_PageExeTime1),4,True)
		'Response.Write "<p>sql:" & sql
		GBL_DBNum = GBL_DBNum + 1
		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))
			Hits = cCur(Rs(7)) + 1
			Rs.Close
			Set Rs = Nothing
			If ac <> GBL_IPAddress or LMT_RefreshEnable = 1 Then
				Con.ExeCute("Update LeadBBS_Announce Set hits=" & Hits & ",VisitIP='" & GBL_IPAddress & "' where ID=" & Form_ParentID)
				Con.ExeCute("Update LeadBBS_Topic Set hits=" & Hits & ",VisitIP='" & GBL_IPAddress & "' where ID=" & Form_ParentID)
				GBL_DBNum = GBL_DBNum + 2
				If inStr(application(DEF_MasterCookies & "TopAncList"),"," & Form_ParentID & ",") Then
					UpdateAnnounceApplicationInfo Form_ParentID,5,Hits,0,0
				Else
					If inStr(application(DEF_MasterCookies & "TopAncList" & GBL_Board_BoardAssort),"," & Form_ParentID & ",") Then UpdateAnnounceApplicationInfo Form_ParentID,5,Hits,0,GBL_Board_BoardAssort
				End If
			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)
		GBL_DBNum = GBL_DBNum + 1
		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))
				LMT_TopicTitleStyle = Rs(11)
				ac = Trim(Rs(13))
				Hits = cCur(Rs(5)) + 1
				Rs.Close
				Set Rs = Nothing
				If ac <> GBL_IPAddress or LMT_RefreshEnable = 1 Then
					Con.ExeCute("Update LeadBBS_Announce Set hits=" & Hits & ",VisitIP='" & GBL_IPAddress & "' where ID=" & Form_ParentID)
					Con.ExeCute("Update LeadBBS_Topic Set hits=" & Hits & ",VisitIP='" & GBL_IPAddress & "' where ID=" & Form_ParentID)
					GBL_DBNum = GBL_DBNum + 2
					If TParentID = 0 and inStr(application(DEF_MasterCookies & "TopAncList"),"," & Form_ParentID & ",") Then
						UpdateAnnounceApplicationInfo Form_ParentID,5,Hits,0,0
					Else
						If TParentID = 0 and inStr(application(DEF_MasterCookies & "TopAncList" & GBL_Board_BoardAssort),"," & Form_ParentID & ",") Then UpdateAnnounceApplicationInfo Form_ParentID,5,Hits,0,GBL_Board_BoardAssort
					End If
				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)
		GBL_DBNum = GBL_DBNum + 1
		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))
			Hits = cCur(Rs(3)) + 1
			Rs.Close
			Set Rs = Nothing
			If ac <> GBL_IPAddress or LMT_RefreshEnable = 1 Then
				Con.ExeCute("Update LeadBBS_Announce Set hits=" & Hits & ",VisitIP='" & GBL_IPAddress & "' where ID=" & LMT_RootIDBak)
				Con.ExeCute("Update LeadBBS_Topic Set hits=" & Hits & ",VisitIP='" & GBL_IPAddress & "' where ID=" & LMT_RootIDBak)
				GBL_DBNum = GBL_DBNum + 2
				If inStr(application(DEF_MasterCookies & "TopAncList"),"," & LMT_RootIDBak & ",") Then
					UpdateAnnounceApplicationInfo LMT_RootIDBak,5,Hits,0,0
				Else
					If inStr(application(DEF_MasterCookies & "TopAncList" & GBL_Board_BoardAssort),"," & LMT_RootIDBak & ",") Then UpdateAnnounceApplicationInfo LMT_RootIDBak,5,Hits,0,GBL_Board_BoardAssort
				End If
			End If
		End If
	End If

	If Form_TopicType > 0 and Article_NotReplay = 0 Then
		If GBL_CheckPassDoneFlag = 0 and GBL_UserID = 0 Then
			GBL_UserID = cCur(CheckPass)
			CheckisBoardMaster
			GBL_CHK_TempStr = ""
		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("AFirst"),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("AUpflag")
	If Upflag<>"1" and Upflag<>"0" Then Upflag="0"
	If Upflag = "1" Then
		LastNum = Request("ANum")
		If LastNum <> "" Then
			LastNum = LastNumBak
		End If
	End If

	Dim MaxPage
	Page = Left(Request("Ap"),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("Aq"),14)
	If isNumeric(JMPage) = 0 Then JMPage = 0
	JMPage = Fix(cCur(JMPage))
	If JMPage > DEF_MaxJumpPageNum Then JMPage = 0
	
	Dim JMPRootID
	JMPRootID = Left(Request("Ar"),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.AnnounceNum2,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,T2.CharmPoint from LeadBBS_Announce as T1 left join LeadBBS_User as T2 on T2.Id=T1.Userid " & SQLEndString
		Set Rs = Con.ExeCute(SQL)
		GBL_DBNum = GBL_DBNum + 1
		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=" & DEF_BBS_ScreenWidth & " border=0 cellspacing=1 cellpadding=0 align=center 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=textview.asp" & SQL & LMT_BoardUrl & "><font face=webdings title=首页>9</font></a>"
		PageSplitString = PageSplitString & " <a href=textview.asp" & SQL & "&AFirst=" & LastID & "&AUpflag=1&Ap=" & Page-1 & LMT_BoardUrl & "><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=textview.asp" & SQL & "&Ar=" & FirstID & "&AUpflag=0&Ap=" & page & "&Aq=" & N-Page & LMT_BoardUrl & ">" & N + 1 & "</a>"
				Else
					PageSplitString = PageSplitString & "<a href=textview.asp" & SQL & "&Ar=" & LastID & "&AUpflag=1&Ap=" & page & "&Aq=" & Page-N & LMT_BoardUrl & ">" & 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=textview.asp" & SQL & "&AFirst=" & FirstID & "&Ap=" & Page+1 & LMT_BoardUrl & "><font face=webdings title=下页>8</font></a>"
		PageSplitString = PageSplitString & " <a href=textview.asp" & SQL & "&AUpflag=1&ANum=1&Ap=" & MaxPage & LMT_BoardUrl & "><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 "<table width=" & DEF_BBS_ScreenWidth & " border=0 cellspacing=0 cellpadding=0 align=center><tr><td>"
			Response.Write GBL_TableHeadString
			Response.Write "</td></tr></table>"
		End If%>
		<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>
		<%
 		If MaxPage > 0 then
 		Response.Write PageSplitString
		Response.Write PageSplitString2
		End if
		%>

		<table width="<%=DEF_BBS_ScreenWidth%>" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor=<%=DEF_BBS_DarkColor%> class=TBone>
		<tr bgcolor=<%=DEF_BBS_LightDarkColor%>><td colspan=2 class=TBHead2>
			<table width=100% border="0" cellspacing="0" cellpadding="0">
			<tr><td>
			<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+10 Then
				SQL = LeftTrue(SQL,DEF_BBS_DisplayTopicLength+7) & "..."
			End if
			Response.Write htmlencode(SQL)
			Response.Write "</font></b></td><td align=right>"
			'退出文本方式
			Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href=Announce.asp?BoardID=" & GBL_board_ID & "&ID=" & LMT_RootIDBak & " ><img src=../images/" & GBL_DefineImage & "normal.GIF border=0 title=普通方式 align=absmiddle width=16 height=16></a>"
			If GBL_CHK_User <> "" Then Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href='javascript:opw(""Collectannounce.asp"",""CollectID""," & LMT_RootIDBak & ");'><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
				Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href='javascript:opw(""Topannounce.asp"",""TopID""," & LMT_RootIDBak & ");'><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""," & LMT_RootIDBak & ");'><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""," & LMT_RootIDBak & ");'><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""," & LMT_RootIDBak & ");'><img src=../images/" & GBL_DefineImage & "maketop.GIF border=0 title=主题固顶或取消固顶 align=absmiddle width=16 height=16></a>"
				If GBL_BoardMasterFlag >= 6 Then Response.Write "<img src=../images/null.gif width=5 height=3 align=absmiddle><a href='javascript:opw(""MakeAlltopAnc.asp"",""TopID"",""" & LMT_RootIDBak & "&part=1"");'><img src=../images/" & GBL_DefineImage & "makeparttop.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""," & LMT_RootIDBak & ");'><img src=../images/" & GBL_DefineImage & "makealltop.GIF border=0 title=主题总固顶或取消总固顶 align=absmiddle width=16 height=16></a>"
			End If
			%>&nbsp;</td></tr></table>
			</td></tr>
		</table>
	<%
	Else
		If GBL_ShowBottomSure = 0 Then GBL_SiteBottomString = ""
	End If
	
	If HaveIDFlag = 1 Then
		If Upflag="0" Then
			For1 = 0
			For2 = Temp2
			StepValue = 1
		Else
			For1 = Temp2
			For2 = 0
			StepValue = -1
		End If
		If Rs > 4 Then
			If GetData_2(38,For1) > 0 and cCur(GetData_2(1,For1)) = 0 Then
				DisplayDataPage For1,For1,StepValue,GetData_2
				DisplayJsAnnounce For1+StepValue,For2,StepValue,GetData_2
			Else
				DisplayJsAnnounce For1,For2,StepValue,GetData_2
			End If
		Else
			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
		%><table width=<%=DEF_BBS_ScreenWidth%> border=0 cellspacing=0 cellpadding=0 align=center><tr><td><%=GBL_TableBottomString%></td></tr></table><%
	End If

End Function

Function DisplayDataPage(For1,For2,StepValue,GetData)

	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
			GetData(48,n) = 0
		End If
	%><table width="<%=DEF_BBS_ScreenWidth%>" border="0" cellspacing="1" cellpadding="5" align="center"   style="table-layout:fixed; word-break:break-all">
	<tr>
		<td  bgcolor= <%=DEF_BBS_LightColor%>  class=TBBG9 valign=top>
			<%
			If cCur(GetData(1,n)) = 0 Then
				Response.Write "<font color=888888><b>楼主</b></font>  "
			Else
				Response.Write "<font color=888888>第<b>" & page*DEF_TopicContentMaxListNum+i & "</b>楼</font>  "
			End If
			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;"
			Response.Write "发表于: " & RestoreTime(GetData(10,n))
			If Article_NotReplay <> 1 Then Response.Write "&nbsp;<a href=""Announce2.asp?BoardID=" & GBL_board_ID & "&ID=" & GetData(0,n) & "&submitflag=first&repost=1"">引用回复</a>" & "<BR>"
			If cCur(GetData(1,n)) = 0 Then Response.Write " 人气:" & GetData(12,n) & "<BR>"
			Response.Write "-----<BR><BR>&nbsp;"

			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 GBL_CheckPassDoneFlag = 0 and GBL_UserID = 0 Then
					GBL_UserID = cCur(CheckPass)
					CheckisBoardMaster
					GBL_CHK_TempStr = ""
				End If
				GetData(15,n) = cCur(GetData(15,n))
				Select case GetData(38,n)
					Case 1,2:
						If GetData(38,n) = 1 Then
							Rs = "查看"
						Else
							Rs = "回复"
						End If
						If GBL_CHK_User <> "" Then
							If GBL_BoardMasterFlag < 5 and GetData(15,n) <> GBL_UserID and GetData(38,n) = 1 Then
								GetData(8,n) = GetFobStr("此帖只有本版版主才能" & Rs)
							Else
								GetData(40,N) = GetData(40,N) & " 此帖只有本版版主才能" & Rs
							End If
						Else
							GetData(8,n) = GetFobStr("此帖只有本版版主才能" & Rs)
						End If
					Case 3,4:
						If GetData(38,n) = 3 Then
							Rs = "查看"
						Else
							Rs = "回复"
						End If
						If GBL_BoardMasterFlag < 4 and GetData(15,n) <> GBL_UserID and GetData(38,n) = 3 Then
							GetData(8,n) = GetFobStr("此帖只有版主才能" & Rs)
						Else
							GetData(40,N) = GetData(40,N) & " 此帖只有版主才能" & Rs
						End If
					Case 7:
						If GBL_UserID > 0 Then
							If GBL_UserID <> GetData(15,n) Then
								Set Rs = Con.ExeCute("Select top 1 ID from LeadBBS_Announce where UserID=" & GBL_UserID & " and ParentID=" & GetData(0,N))
								GBL_DBNum = GBL_DBNum + 1
								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 <> 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,"'","''") & "'")
								GBL_DBNum = GBL_DBNum + 1
								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,6:
						If GetData(38,n) = 5 Then
							Rs = "查看"
						Else
							Rs = "回复"
						End If
						If (GBL_CHK_User = "" or (GetBinarybit(GBL_CHK_UserLimit,2) <> 1 and GetData(15,n) <> GBL_UserID) or GBL_UserID = 0) and GetData(38,n) = 5 Then
							GetData(8,n) = GetFobStr("此帖只有认证会员才能" & Rs)
						Else
							GetData(40,N) = GetData(40,N) & " 此帖只有认证会员才能" & Rs
						End If
					Case 50,51:
						If GetData(38,n) = 50 Then
							Rs = "查看"
						Else
							Rs = "回复"
						End If
						If GBL_CHK_Points < GetData(39,n) and GetData(15,n) <> GBL_UserID and GetData(38,n) = 50 Then
							GetData(8,n) = GetFobStr("此帖需要" & DEF_PointsName & "" & GetData(39,n) & "才能" & Rs)
						Else
							GetData(40,N) = GetData(40,N) & " 此帖需要" & DEF_PointsName & "" & GetData(39,n) & "才能" & Rs
						End If
					Case 52,53:
						If GetData(38,n) = 52 Then
							Rs = "查看"
						Else
							Rs = "回复"
						End If
						If GBL_CHK_OnlineTime < GetData(39,n)*60 and GetData(15,n) <> GBL_UserID and GetData(38,n) = 52 Then
							GetData(8,n) = GetFobStr("此帖需要经验" & GetData(39,n) & "才能" & Rs)
						Else
							GetData(40,N) = GetData(40,N) & " 此帖需要经验" & GetData(39,n) & "才能" & Rs
						End If
					Case 55:
						If GetData(39,n) > 0 Then
							GetData(39,n) = GetUserName(GetData(39,n))
							If GetData(39,n) <> "" Then
								If GetData(39,n) <> GBL_CHK_User and GBL_UserID <> GetData(15,n) Then
									GetData(8,n) = GetFobStr("此帖只限用户<font color=Green class=GreenFont>" & GetData(39,n) & "</font>才能查看")
								Else
									GetData(40,N) = GetData(40,N) & " 此帖只限用户<font color=Green class=GreenFont>" & GetData(39,n) & "</font>才能查看"
								End If
							End If
						End If
				End Select
			End If
			If GetData(45,n) >=60 Then GetData(8,n) = GetFobStr("此帖有待管理人员审核才能查看")
			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 Lcase(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
				Response.Write "<table width=100%  border=0 cellspacing=0 cellpadding=0 style=""line-height:15pt;""><tr><td>"
				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 "</td></tr></table></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;"

			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

Function DisplayJsAnnounce(For1,For2,StepValue,GetData)


Dim SupervisorFlag
SupervisorFlag = CheckSupervisorUserName
%>
<script language=javascript>
<!--
var i=0;
var page=<%=page%>;
var Flag=0;
var CSUN=<%=SupervisorFlag%>;
var GBL_UserID=<%=cCur(GBL_UserID)%>;
var now=<%=GetTimeValue(DEF_Now)%>;
var DEFUOTO=<%=DEF_UserOnlineTimeOut%>;
var HU="<%=DEF_BBS_HomeUrl%>";
var GDI="<%=GBL_DefineImage%>";
var GBLBD=<%=GBL_board_ID%>;
var GBL_CHK_User="<%=GBL_CHK_User%>";
var GMF=<%=GBL_BoardMasterFlag%>;
var DEF_PointsName="<%=DEF_PointsName%>";
var GCU=<%=cCur(GBL_CHK_UserLimit)%>;
var bimg="<img src=../images/null.gif width=5 height=3 align=absmiddle>"
var DEF_UserOfficerString=new Array(<%
	Dim N
	Response.Write """" & DEF_UserOfficerString(0) & """"
	for n = 1 to DEF_UserOfficerNum
		Response.Write ",""" & DEF_UserOfficerString(n) & """"
	Next
	%>);

var DEF_UserLevelString=new Array(<%
	Response.Write """" & DEF_UserLevelString(0) & """"
	for n = 1 to DEF_UserLevelNum
		Response.Write ",""" & DEF_UserLevelString(n) & """"
	Next
%>);

function opw(f,r,id)
{
	window.open(f+'?BoardID=<%=GBL_board_ID%>&'+r+'='+id,'','width=450,height=37,scrollbars=auto,status=no');
}
function ds(G0,G1,G9,G10,G12,G14,G15,G19,G22,G23,G24,G26,G27,G28,G29,G30,G31,G32,G33,G34,G35,G36,G37,G41,G42,G44,G45,G47,G48)
{
	i+=1;
	if(G15==null||G15=="")
	{
G22=0;G23=0;G24="";G26=0;G27=0;G28=0;G29=0;G30=0;G31="密";G32=0;G33=0;G34="";G35=0;G36=0;G37=0;G42=1;G44="";G47=0;
	}
	document.write("<table width=<%=DEF_BBS_ScreenWidth%> border=0 cellspacing=1 cellpadding=5 align=center bgcolor=<%=DEF_BBS_DarkColor%> class=TBone  style=\"table-layout:fixed; word-break:break-all\"><tr");
	document.write("><td  width=<%=DEF_BBS_ScreenWidth%> bgcolor= <%=DEF_BBS_LightColor%>  class=TBBG9 valign=top>");
		if(G1 == 0)
	{	document.write("<font color=000000><b>楼主</b></font>  ");
	}
	else
	{	document.write("<font color=000000>第<b>" + (page*<%=DEF_TopicContentMaxListNum%>+i) + "</b>楼</font>  ");
	}
	
	if(G15 > 0)
	{	document.write("<a href=" + HU + "User/LookUserInfo.asp?ID=" + G15 + ">" + htmlencode(G14) + "</a>");
	}
	else
	{	document.write(htmlencode(G14));
	}
	document.write("&nbsp;");
	document.write("发表于: " + G10.substr(0,4) + "-" + G10.substr(4,2) + "-" + G10.substr(6,2) + " " + G10.substr(8,2) + ":" + G10.substr(10,2) + ":" + G10.substr(12,2) );
	if(<%=Article_NotReplay%> != 1)document.write("&nbsp;<a href=\"Announce2.asp?BoardID=" + GBLBD + "&ID=" + G0 + "&submitflag=first&repost=1\">引用回复</a><BR>");
	if(G1 == 0)document.write(" 人气:" + G12 + "<BR>");
	document.write("-----<BR><BR>&nbsp;");


}

function facenum(num)
{
	var n = 4-((num+"").length),str="",p;
	for(p=1;p<=n;p++)str+="0";
	return(str+num);
}

function JsDateDiffSecond(d1,d2)
{
	d1 = new Date(d1.substr(0,4),d1.substr(4,2),d1.substr(6,2),d1.substr(8,2),d1.substr(10,2),d1.substr(12,2));
	d2 = new Date(d2.substr(0,4),d2.substr(4,2),d2.substr(6,2),d2.substr(8,2),d2.substr(10,2),d2.substr(12,2));
	var s, t,t2;
	t = Date.parse(d1);
	t2 = Date.parse(d2);
	s = Math.round(Math.abs(t2 / 1000)) - Math.round(Math.abs(t / 1000));
	return(s);
}




function htmlencode(str)
{
	var re = /(<)/gi;
	var rv = str.replace(re,"&lt;");
	re = /(>)/gi;
	rv = rv.replace(re,"&gt;");
	re = /(\")/gi;
	rv = rv.replace(re,"&quot;");
	return(rv);
}
//-->
</script>
<%
For N = For1 to For2 Step StepValue
	%><script language=javascript><%
	If SupervisorFlag = 0 Then GetData(19,n) = ""
	GetData(24,n) = Replace(Replace(Replace(GetData(24,n) & "","\","\\"),"""","\"""),"<","&lt;")
	GetData(34,n) = Replace(Replace(Replace(GetData(34,n) & "","\","\\"),"""","\"""),"<","&lt;")
	GetData(44,n) = Replace(Replace(Replace(GetData(44,n) & "","\","\\"),"""","\"""),"<","&lt;")
	If GetData(42,n) = 1 or GetData(42,n) = True Then
		GetData(42,n) = 1
	Else
		GetData(42,n) = 0
	End If

	If isNull(GetData(23,n)) Then
		GetData(21,n) = 0
		GetData(22,n) = 0
		GetData(23,n) = 0
		GetData(26,n) = 0
		GetData(27,n) = 0
		GetData(28,n) = 0
		GetData(29,n) = 0
		GetData(30,n) = 0
		GetData(32,n) = 0
		GetData(33,n) = 0
		GetData(35,n) = 0
		GetData(36,n) = 0
		GetData(37,n) = 0
		GetData(42,n) = 1
		GetData(47,n) = 0
		GetData(48,n) = 0
	End If
	Response.Write "ds(" & GetData(0,n) & "," & GetData(1,n) & "," & GetData(9,n) & ",""" & GetData(10,n) & """," & GetData(12,n) & ",""" & GetData(14,n) & """," & GetData(15,n) & ",""" & GetData(19,n) & """," & GetData(22,n) & "," & GetData(23,n) & ",""" & GetData(24,n) & """," & GetData(26,n) & ",""" & GetData(27,n) & """," & GetData(28,n) & ",""" & GetData(29,n) & """,""" & GetData(30,n) & """,""" & GetData(31,n) & """,""" & GetData(32,n) & """," & GetData(33,n) & ",""" & GetData(34,n) & """," & GetData(35,n) & "," & GetData(36,n) & "," & GetData(37,n) & ",""" & GetData(41,n) & """," & GetData(42,n) & ",""" & GetData(44,n) & """," & GetData(45,n) & "," & GetData(47,n) & "," & cCur(GetData(48,n)) & ");" & VbCrLf
	Response.Write "</script>" & VbCrLf
	If GetData(45,n) >=60 Then GetData(8,n) = GetFobStr("此帖有待管理人员审核才能查看")
			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 Lcase(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
				Response.Write "<table width=100%  border=0 cellspacing=0 cellpadding=0 style=""line-height:15pt;""><tr><td>"
				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 "</td></tr></table></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;"

			End If
			%>
			</td></tr></table>


	<%
Next
%>
</script>

<%

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
	
	GetBoardUrlString

	Dim Temp
	If LMT_TopicTitleStyle >= 60 Then
		LMT_TopicNameNoHTML = "帖子等待审核中..."
		LMT_TopicName = "<font color=gray class=GrayFont>帖子等待审核中...</font>"
		Article_NotReplay = 1
	Else
		If LMT_TopicTitleStyle = 1 Then
			LMT_TopicNameNoHTML = KillHTMLLabel(LMT_TopicName)
		Else
			LMT_TopicNameNoHTML = htmlencode(LMT_TopicName)
		End If
	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
	
	GetBoardNavigateString
	BBS_SiteHead DEF_SiteNameString & " " & DEF_BBS_Name & " " & htmlencode(LMT_TopicNameNoHTML) & " [文本方式]",0,GetBoardNavigateString & " &gt;&gt; 文本方式查看帖子"
	CheckAccessLimit

	If GBL_CHK_TempStr = "" Then
		jointool
	End If
	If GBL_CHK_TempStr = "" Then
		UpdateOnlineUserAtInfo GBL_board_ID,GBL_Board_BoardName & "→" & Temp
		DisplayTopic
	If GBL_CHK_TempStr = "" Then
		jointool
	End If
		GetRequestValue
		'DisplayAnnounceForm
		GBL_CHK_TempStr = ""
	Else
		If GBL_ShowBottomSure = 0 Then GBL_SiteBottomString = ""
		Response.Write "<table width=" & DEF_BBS_ScreenWidth & " border=0 cellspacing=0 cellpadding=0 align=center><tr><td><br><font color=ff0000 class=RedFont><b>" & GBL_CHK_TempStr & "</b></font><br></td></tr></table>"
	End If
	If GBL_CHK_TempStr <> "" Then
		Response.Write "<hr size=1 align=center width=" & DEF_BBS_ScreenWidth & ">"
	End If
	CloseDatabase
	SiteBottom
	If GBL_SiteBottomString <> "" Then Response.Write GBL_SiteBottomString

End Sub
   Sub jointool
%>
	<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=../Announce/Announce2.asp?BoardID=<%=GBL_board_ID%>><img src=../images/<%=GBL_DefineImage%>newanc.gif width=60 height=17 border=0 align=absmiddle alt=新帖></a>
			<a href=../Announce/Announce2.asp?BoardID=<%=GBL_board_ID%>&VoteFlag=yes><img src=../images/<%=GBL_DefineImage%>newpoll.gif width=60 height=17 border=0 align=absmiddle alt=新投票></a><%If Article_NotReplay = 1 Then
				Response.Write " <img src=../images/" & GBL_DefineImage & "reanc.gif width=60 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=60 height=17 border=0 align=absmiddle alt=回复帖子></a><%End If%>
		</td>
		<td align=right>
			<a href=textview.asp?BoardID=<%=GBL_board_ID%>&ID=<%=Form_parentID%>&ac=pre&rd=<%=LMT_RootID & LMT_BoardUrl%>>上篇</a>
			<a href="javascript:this.location.reload();">刷新</a>
			<a href="announce2.asp?BoardID=<%=GBL_board_ID%>&ID=<%=Form_parentID%>">树型</a>
			<a href=textview.asp?BoardID=<%=GBL_board_ID%>&ID=<%=Form_parentID%>&ac=nxt&rd=<%=LMT_RootID & LMT_BoardUrl%>>下篇</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 Sub
Sub GetBoardUrlString

	Dim Tmp,Tmp2
	
	Tmp = Left(Request.QueryString("r"),14)
	If isNumeric(Tmp) = 0 Then Tmp = 0
	Tmp = Fix(cCur(Tmp))
	If Tmp > 0 Then LMT_BoardUrl = "&r=" & Tmp
	
	Tmp = Left(Request.QueryString("p"),14)
	If isNumeric(Tmp) = 0 Then Tmp = 0
	Tmp = Fix(cCur(Tmp))
	If Tmp > 0 Then LMT_BoardUrl = LMT_BoardUrl & "&p=" & Tmp
	
	Tmp = Left(Request.QueryString("Upflag"),14)
	If Tmp = "0" or Tmp = "1" Then LMT_BoardUrl = LMT_BoardUrl & "&Upflag=" & Tmp
	
	Tmp = Left(Request.QueryString("Num"),14)
	If Tmp <> "" Then Tmp = "1"
	If Tmp = "1" Then LMT_BoardUrl = LMT_BoardUrl & "&Num=1"
	
	Tmp = Left(Request.QueryString("q"),14)
	If isNumeric(Tmp) = 0 Then Tmp = 0
	Tmp = Fix(cCur(Tmp))
	If Tmp > 0 Then LMT_BoardUrl = LMT_BoardUrl & "&q=" & Tmp
	
	Tmp = Left(Request.QueryString("RootID"),14)
	If isNumeric(Tmp) = 0 Then Tmp = 0
	Tmp = Fix(cCur(Tmp))
	If Tmp > 0 Then LMT_BoardUrl = LMT_BoardUrl & "&RootID=" & Tmp
	
	Tmp = Request.QueryString("E")
	If Tmp = "1" Then
		LMT_BoardString = " &gt;&gt; <a href=../Board/EBoard.asp?BoardID=" & GBL_Board_ID & "&E=1><font class=NavColor>专题区</font></a>"
		Tmp = Left(Request.QueryString("EID"),14)
		If isNumeric(Tmp) = 0 Then Tmp = 0
		Tmp = Fix(cCur(Tmp))
		If Tmp < 1 Then Tmp = 0
		Tmp2 = ""
		If Tmp > 0 Then Tmp2 = GetEName(Tmp)
		If Tmp2 = "" Then Tmp = 0
		LMT_BoardUrl = LMT_BoardUrl & "&E=1"
		If Tmp > 0 Then
			LMT_BoardString = LMT_BoardString & " &gt;&gt; <a href=../Board/EBoard.asp?BoardID=" & GBL_Board_ID & "&E=1&EID=" & tmp & "><font class=NavColor>" & Tmp2 & "</font></a>"
			LMT_BoardUrl = LMT_BoardUrl & "&EID=" & Tmp
		End If
	ElseIf Tmp <> "" Then
		LMT_BoardString = " &gt;&gt; <a href=../Board/EBoard.asp?BoardID=" & GBL_Board_ID & LMT_BoardUrl & "><font class=NavColor>精华区</font></a>"
		'LMT_BoardUrl = ""
		LMT_BoardUrl = LMT_BoardUrl & "&E=0"
	End If

End Sub

Function GetBoardNavigateString

	Dim Temp,TempStr,N
	Temp = cCur(Application(DEF_MasterCookies & "BoardInfo" & GBL_board_ID)(26,0))
	Do While Temp > 0
		If isArray(Application(DEF_MasterCookies & "BoardInfo" & Temp)) = False Then
			ReloadBoardInfo(Temp)
			If isArray(Application(DEF_MasterCookies & "BoardInfo" & Temp)) = False Then Exit Do
		End If
		TempStr = " &gt;&gt; <a href=" & DEF_BBS_HomeUrl & "Board/Board_txt.asp?BoardID=" & Temp & LMT_BoardUrl & "><font class=NavColor>" & Application(DEF_MasterCookies & "BoardInfo" & Temp)(0,0) & "</font></a>" & TempStr
		Temp = cCur(Application(DEF_MasterCookies & "BoardInfo" & Temp)(26,0))
		N = N + 1
		If N > 10 Then Exit Do
	Loop
	TempStr = TempStr & " &gt;&gt; <a href=""" & DEF_BBS_HomeUrl & "Board/Board_txt.asp?BoardID=" & GBL_Board_ID & LMT_BoardUrl & """><font class=NavColor>" & GBL_Board_BoardName & "</font></a>"
	GetBoardNavigateString = TempStr & LMT_BoardString

End Function

Function GetEName(ID)

	Dim TArray,N,Num
	TArray = Application(DEF_MasterCookies & "BoardInfo" & GBL_Board_ID & "_TI")
	If isArray(TArray) = False Then Exit Function
	Num = Ubound(TArray,2)
	For N = 0 To Num
		If ID = cCur(TArray(0,N)) Then
			GetEName = TArray(1,n)
			Exit Function
		End If
	Next
	GetEName = ""

End Function

Main
%>