<!-- #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 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>
<!--
	var ValidationPassed = true;
	function submitonce(theform)
	{	<%If DEF_EnableAttestNumber > 2 Then%>
		
		if(theform.ForumNumber.value=="")
		{
			alert("请输入验证码!\n");
			ValidationPassed = false;
			theform.ForumNumber.focus();
			return;
		}
		else
		{ValidationPassed = true;
		}<%End If%>
		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.LeadBBSFm);if(ValidationPassed)document.LeadBBSFm.submit();}
		if(event.altKey && (window.event.keyCode==83 || window.event.keyCode==115)){submitonce(document.LeadBBSFm);if(ValidationPassed)document.LeadBBSFm.submit();}
	}
	var ie = (document.all)? true:false
	if (ie)
	{
		window.document.onkeydown=ctlkey;
	}
//-->
</script>
<br>
		<%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%>
<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=LeadBBSFm onSubmit="submitonce(this);return ValidationPassed;">
		<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>
				<%If DEF_EnableAttestNumber > 2 Then%>
				<TABLE border=0 cellpadding="0" cellspacing="0"><TR><TD>
				<input maxlength=20 name=User value="<%=htmlencode(GBL_CHK_User)%>" size="14" class=fminpt>
				&nbsp;密码&nbsp;<input maxlength=20 type=password name=Pass value="<%'=htmlencode(GBL_CHK_Pass)%>" size="14" class=fminpt>
				验证码
				<input name=ForumNumber maxlength=4 size=4 value="<%=htmlencode(Request("RndNumber"))%>" class=fminpt></td>
				<td>&nbsp;请在框中输入<img src=<%=DEF_BBS_HomeUrl%>User/number.asp?n=<%=timer%> align=absmiddle></td></tr></table>
				<%Else%>
				用户名 <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>新用户
				<%End If%>
				</td>
				<input name=submitflag value="true" type=hidden>
				<input name=LMT_DefaultEdit value="1" 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>
</td>
</tr>
</tbody>
</table><%

	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 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=announce.asp" & SQL & LMT_BoardUrl & "><font face=webdings title=首页>9</font></a>"
		PageSplitString = PageSplitString & " <a href=announce.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=announce.asp" & SQL & "&Ar=" & FirstID & "&AUpflag=0&Ap=" & page & "&Aq=" & N-Page & LMT_BoardUrl & ">" & N + 1 & "</a>"
				Else
					PageSplitString = PageSplitString & "<a href=announce.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=announce.asp" & SQL & "&AFirst=" & FirstID & "&Ap=" & Page+1 & LMT_BoardUrl & "><font face=webdings title=下页>8</font></a>"
		PageSplitString = PageSplitString & " <a href=announce.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>
		<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>"
			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" 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)), DEF_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>"

			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 title=""级别：" & DEF_UserLevelString(GetData(23,N)) & """><br>"
			Response.Write "<img src=" & DEF_BBS_HomeUrl & "images/null.gif width=2 height=5 border=0><br>"
			
			If GetData(15,n) > 0 Then
				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 "职务：<font color=blue class=BlueFont>总版主</font><br>"
				ElseIf GetBinarybit(GetData(37,n),14) = 1 Then
					Response.write "职务：<font color=blue class=BlueFont>区版主</font><br>"
				ElseIf GetBinarybit(GetData(37,n),8) = 1 Then
					Response.write "职务：<font color=blue class=BlueFont>论坛版主</font><br>"
				ElseIf GetBinarybit(GetData(37,n),2) = 1 Then
					Response.write "认证：<font color=Green class=GreenFont>认证会员</font><br>"
				End If
				Response.write "级别：" & DEF_UserLevelString(GetData(23,N)) & "<br>"
	
				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
				If cCur(GetData(48,n)) <> 0 Then Response.write "魅力：" & GetData(48,n) & "<br>"

				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 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:" & GetData(20,n) & """ target=_blank><img src=../images/" & GBL_DefineImage & "mail.gif border=0 title=给此用户发邮件 align=absmiddle width=15 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 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(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 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 GBL_Board_ID <> 444 and 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 and 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>"
			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 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;"

				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=332 border=0 cellspacing=0 cellpadding=0 style='table-layout:fixed; word-break:break-all'><tr><td><img src=../images/" & GBL_DefineImage & "signature.gif width=500 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

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><tr");
	if(Flag == 0)
	{	document.write(" bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9");
		Flag=1;
	}
	else
	{	document.write(" bgcolor=<%=DEF_BBS_LightColor%> class=TBBG1");
		Flag=0;
	}
	document.write("><td height=20 width=<%=DEF_BBS_LeftTDWidth%> align=center valign=top>");
	document.write("		<img src=" + HU + "images/null.gif width=<%=DEF_BBS_LeftTDWidth%> height=2><table align=center width=90% cellspacing=0 cellpadding=0><tr><td>");
	if(G44!=null && G44!=""){document.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(G44) + "<br><img src=../images/blank.gif height=4 width=2><br></table>");}
	document.write("<table border=0 width=100% cellspacing=0 cellpadding=0><tr><td>");
	if(G15 > 0)
	{	document.write("<a href=\"" + HU + "User/LookUserInfo.asp?ID=" + G15 + "\"");
		if(CSUN==1 && GBL_UserID > 0 && G19!=""){document.write(" title=\"IP地址:" + G19 & "\" ");}
		document.write(">");
	}
	document.write("<img src=");
	if(G35 > <%=DEF_AllFaceMaxWidth%>){G35=<%=DEF_AllFaceMaxWidth%>;}
	if(G36 > <%=DEF_AllFaceMaxWidth%>*2){G36=<%=DEF_AllFaceMaxWidth%>;}
	if(<%=DEF_AllDefineFace%> == 1 && G34 != "")
	{	document.write("\"" + htmlencode(G34) + "\" width=" + G35 + " height=" + G36 + " border=0>");
	}
	else
	{	document.write(HU + "images/face/" + facenum(G22) + ".gif border=0 width=62 height=62>");
	}
	if(G15 > 0){document.write("</a>");}
	document.write("</td><td valign=top align=right>");

	var OlF;
	if(G42 == 1)
	{	OlF=0;
	}
	else
	{	OlF=JsDateDiffSecond(G32+"", now+"");
		if(OlF < 0 || OlF > DEFUOTO)
		{OlF=0;}
		else
		{	OlF=1;
		}
	}
	if(G14 == "游客" && G15 == 0)OlF=1;
	if(G31 == "女")
	{	if(OlF == 1)
		{	document.write("<img src=" + HU + "images/" + GDI + "sxmg/FeMale.gif align=absmiddle Alt=美女，在线 width=23 height=21>");
		}
		else
		{	document.write("<img src=" + HU + "images/" + GDI + "sxmg/OfFeMale.gif align=absmiddle Alt=美女，离线 width=23 height=21>");
		}
	}
	else
	{	if(G31 == "男")
		{	if(OlF == 1)
			{	document.write("<img src=" + HU + "images/" + GDI + "sxmg/Male.gif align=absmiddle Alt=帅哥，在线 width=23 height=21>");
			}
			else
			{	document.write("<img src=" + HU + "images/" + GDI + "sxmg/OfMale.gif align=absmiddle Alt=帅哥，离线 width=23 height=21>");
			}
		}
		else
		{	if(OlF == 1)
			{	document.write("<img src=" + HU + "images/" + GDI + "sxmg/Male.gif align=absmiddle Alt=在线 width=23 height=21>");
			}
			else
			{	document.write("<img src=" + HU + "images/" + GDI + "sxmg/OfMale.gif align=absmiddle Alt=离线 width=23 height=21>");
			}
		}
	}
	document.write("</td>");
	document.write("</tr></table>");
	document.write("<img src=" + HU + "images/null.gif width=2 height=5 border=0><br>");
	if(G15 > 0)
	{	document.write("<a href=" + HU + "User/LookUserInfo.asp?ID=" + G15 + ">" + htmlencode(G14) + "</a>");
	}
	else
	{	document.write(htmlencode(G14));
	}
	document.write("&nbsp;");
	if((G29+"").length ==14)
	{
		document.write(Constellation((G29.substr(4,2).substr(0,1)=="0")?parseInt(G29.substr(4,2).substr(1,1)):parseInt(G29.substr(4,2)),(G29.substr(6,2).substr(0,1)=="0")?parseInt(G29.substr(6,2).substr(1,1)):parseInt(G29.substr(6,2))));
		if((G41+"").length ==14)
		{
			document.write(" " + DisplayBirthAnimal(parseInt(G41.substr(0,4))));
		}
	}

	document.write("</td></tr><tr><td>");
	if(G23 > <%=DEF_UserLevelNum%>)G23=<%=DEF_UserLevelNum%>;
	document.write("<img src=" + HU + "images/null.gif width=2 height=5 border=0><br><img src=" + HU + "images/" + GDI + "lvstar/level" + G23 + ".gif align=absmiddle width=110 height=11 title=\"级别：" + DEF_UserLevelString[G23] + "\"><br>");
	document.write("<img src=" + HU + "images/null.gif width=2 height=5 border=0><br>");
	if(G15 > 0)
	{
		if(G27!="0" && G27!="")
		{	document.write("荣誉：" + DisplayOfficerString(G27) + "<br>");
		}
		if(G37&(1<<(10-1)))
		{	document.write("职务：<font color=blue class=BlueFont>总版主</font><br>");
		}
		else
		{	if(G37&(1<<(14-1)))
			{	document.write("职务：<font color=blue class=BlueFont>区版主</font><br>");		
			}
			else
			{	if(G37&(1<<(8-1)))
				{	document.write("职务：<font color=blue class=BlueFont>论坛版主</font><br>");
				}
				else
				{	if(G37&(1<<(2-1))){document.write("认证：<font color=Green class=GreenFont>认证会员</font><br>");}
				}
			}
		}
		document.write("级别：" + DEF_UserLevelString[G23] + "<br>");
		if(G47 != 0)
		{	if(G47 > 127)
			{	G47=127-G47;
			}
			else
			{	G47="<font color=blue class=BlueFont>＋" + G47 + "</font>";
			}
			document.write("威望：" + G47 + "<br>");
		}
		if(G48 != 0)document.write("魅力：" + G48 + "<br>");
		document.write("" + DEF_PointsName + "：" + G26 + "<br>");
		document.write("经验：" + parseInt(G28/60) + "<br>");
		document.write("文章：" + G33 + "<br>");
		if(G30>0)document.write("注册：" + G30.substr(2,2) + "-" + G30.substr(4,2) + "-" + G30.substr(6,2) + " " + G30.substr(8,2) + ":" + G30.substr(10,2));
	}
	document.write("<br></td></tr></table></td>");
	document.write("<td height=20 valign=top><table width=100% height=100% style=\"table-layout:fixed; word-break:break-all\"><tr><td width=2><img src=" + HU + "images/blank.gif width=2 height=2></td><td valign=top>");
	document.write("<table align=center width=100% border=0 cellspacing=0 cellpadding=0><tr><td>");
	document.write("<img src=" + HU + "images/" + GDI + "bf/face" + G9 + ".gif align=absbottom width=20 height=20>");
	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(G1 == 0)document.write(" 人气:" + G12);

	if(<%=Article_NotReplay%> != 1)document.write(bimg + "<a href=\"Announce2.asp?BoardID=" + GBLBD + "&ID=" + G0 + "&submitflag=first&repost=1\"><img src=../images/" + GDI + "re.gif border=0 title=引用回复 align=absmiddle width=16 height=16></a>");

	if(G15 > 0)document.write(bimg + "<a href=\"" + HU + "User/SendMessage.asp?SdM_ToUser=" + htmlencode(G14) + "\"><img src=../images/" + GDI + "message.GIF border=0 title=给" + htmlencode(G14) + "发消息 align=absmiddle width=16 height=16></a>");
	if(G24!="")
	{	if((G24.substr(0,4)).toUpperCase() != "HTTP")G24="http://" + G24;
		document.write(bimg + "<a href=\"" + htmlencode(G24) + "\" target=_blank><img src=../images/" + GDI + "home.gif border=0 title=此用户主页 align=absmiddle width=16 height=16></a>");
	}

	if(GBL_CHK_User != "" && (GMF >= 5 || G14 == GBL_CHK_User))
	{	document.write(bimg + "<a href=\"Editannounce.asp?BoardID=" + GBLBD + "&ID=" + G0 + "\"><img src=../images/" + GDI + "edit.gif border=0 title=修改帖子内容 align=absmiddle width=16 height=16></a>");
		document.write(bimg + "<a href='javascript:opw(\"TypeSetAnnounce.asp\",\"RepairID\"," + G0 + ");'><img src=../images/" + GDI + "ts.gif border=0 title=自动排版消除多余换行，锁帖，审核帖等功能 align=absmiddle width=16 height=16></a>");
	}

	if(GBL_CHK_User != "" && G15 > 0)document.write(bimg + "<a href='javascript:opw(\"AddFriend.asp\",\"AddSureFlag=yes&FriendName\",\"" + htmlencode(G14) + "\");'><img src=../images/" + GDI + "friend.gif border=0 title=加此用户为好友 align=absmiddle width=16 height=16></a>");
	
	if(GBL_CHK_User != "" && GMF >= 5)
	{	if((!(<%=GBL_Board_BoardLimit%>&(1<<(5-1)))) && (!(GCU&(1<<(5-1)))))
		{	document.write(bimg + "<a href='javascript:opw(\"");
			if(<%=GBL_Board_ID%> != 444 && <%=DEF_EnableDelAnnounce%> == 0 && G1 == 0)
			{	document.write("MoveAnnounce.asp\",\"MoveID\",\"" + G0 + "&BoardID2=444\"");
			}
			else
			{	document.write("DelAnnounce.asp\",\"DelID\",\"" + G0 + "\"");
			}
			document.write(");'><img src=../images/" + GDI + "Del.GIF border=0 title=删除此帖子 align=absmiddle width=16 height=16></a>");
		}
		if(G1 == 0 && (!(GCU&(1<<(6-1))))){document.write(bimg + "<a href='javascript:opw(\"MakeGood.asp\",\"GoodID\"," + G0 + ");'><img src=../images/" + GDI + "jh.GIF border=0 title=精华或取消精华此帖子，奖惩发帖用户 align=absmiddle width=16 height=16></a>");}
	}

	if(G1 == 0)
	{	document.write("</td><td align=right><font color=888888><b>楼主</b></font></td></tr></table>");
	}
	else
	{	document.write("</td><td align=right><font color=888888>第<b>" + (page*<%=DEF_TopicContentMaxListNum%>+i) + "</b>楼</font></td></tr></table>");
	}
}

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 Constellation(Births,B)
{
	//alert(Births.substring(0,1));
	var s = "<img width=15 height=15 src=" + HU + "images/" + GDI + "cnstl/z";
	switch(Births)
	{
	case 1:
		if(B>=21)
		{s+="11.gif alt=水瓶座";}
		else{s+="10.gif alt=魔羯座";}
		break;
	case 2:
		if(B>=20)
		{s+="12.gif alt=双鱼座";}
		else
		{s+="11.gif alt=水瓶座";}
		break;
	case 3:
		if(B>=21)
		{s+="1.gif alt=白羊座";}
		else
		{s+="12.gif alt=双鱼座";}
		break;
	case 4:
		if(B>=21)
		{s+="2.gif alt=金牛座";}
		else
		{s+="1.gif alt=白羊座";}
		break;
	case 5:
		if(B>=22)
		{s+="3.gif alt=双子座";}
		else
		{s+="2.gif alt=金牛座";}
		break;
	case 6:
		if(B>=22)
		{s+="4.gif alt=巨蟹座";}
		else
		{s+="3.gif alt=双子座";}
		break;
	case 7:
		if(B>=23)
		{s+="5.gif alt=狮子座";}
		else
		{s+="4.gif alt=巨蟹座";}
		break;
	case 8:
		if(B>=24)
		{s+="6.gif alt=处女座";}
		else
		{s+="5.gif alt=狮子座";}
		break;
	case 9:
		if(B>=24)
		{s+="7.gif alt=天秤座";}
		else
		{s+="6.gif alt=处女座";}
		break;
	case 10:
		if(B>=24)
		{s+="8.gif alt=天蝎座";}
		else
		{s+="7.gif alt=天秤座";}
		break;
	case 11:
		if(B>=23)
		{s+="9.gif alt=射手座";}
		else
		{s+="8.gif alt=天蝎座";}
		break;
	case 12:
		if(B>=22)
		{s+="10.gif alt=魔羯座";}
		else
		{s+="9.gif alt=射手座";}
		break;
	default:
		s="";
	}
	if(s!=""){s+=" align=absmiddle>";}
	return(s);
}

function DisplayBirthAnimal(BirthYear)
{
	var temp,t="<img width=15 height=15 src=" + HU + "images/" + GDI + "snxa/sx";
	BirthYear%=12;
	switch(BirthYear)
	{
		case 0: t+="9s.gif alt=申猴";break;
		case 1: t+="10s.gif alt=酉鸡";break;
		case 2: t+="11s.gif alt=戌狗";break;
		case 3: t+="12s.gif alt=亥猪";break;
		case 4: t+="1s.gif alt=子鼠";break;
		case 5: t+="2s.gif alt=丑牛";break;
		case 6: t+="3s.gif alt=寅虎";break;
		case 7: t+="4s.gif alt=卯兔";break;
		case 8: t+="5s.gif alt=辰龙";break;
		case 9: t+="6s.gif alt=巳蛇";break;
		case 10: t+="7s.gif alt=午马";break;
		case 11: t+="8s.gif alt=未羊";break;
		default: t = "";
	}
	if(t!=""){t+=" align=absmiddle>";}
	return(t);
}

function DisplayOfficerString(Officer)
{
	var t,n,f=0;
	var str="";
	t = Officer.split(",");
	for(n=0;n<=t.length;n++)
	{
		if(t[n]>=0 && t[n]<=<%=DEF_UserOfficerNum%>)
		{
			if(f == 0)
			{	f = 1;
				str += DEF_UserOfficerString[t[n]];
			}
			else
			{
				str += "," + DEF_UserOfficerString[t[n]];
			}
		}
	}
	var re = /(,)/gi;
	str = str.replace(re,"<br>&nbsp; &nbsp; &nbsp; ");
	return(str);
}

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;"

				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=332 border=0 cellspacing=0 cellpadding=0 style='table-layout:fixed; word-break:break-all'><tr><td><img src=../images/" & GBL_DefineImage & "signature.gif width=500 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
%>
</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 & " - " & KillHTMLLabel(GBL_Board_BoardName) & " - " & LMT_TopicNameNoHTML,0,GetBoardNavigateString & " &gt;&gt; 查看帖子"
	CheckAccessLimit

	If GBL_CHK_TempStr = "" Then
	%>
	
	<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=announce.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=announce.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 If
	If GBL_CHK_TempStr = "" Then
		UpdateOnlineUserAtInfo GBL_board_ID,GBL_Board_BoardName & "→" & Temp
		DisplayTopic
		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 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.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.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
%>