<!-- #include file=../inc/BBSsetup.asp -->
<!-- #include file=../inc/Board_Popfun.asp -->
<!-- #include file=inc/UserTopic.asp -->
<%
DEF_BBS_HomeUrl = "../"
Dim GetData

GBL_CHK_PWdFlag = 0
initDatabase
GBL_CHK_TempStr = ""

SiteHead(DEF_SiteNameString & " - 查看社区公告")
UpdateOnlineUserAtInfo GBL_board_ID,"查看社区公告"
GBL_CHK_TempStr=""
UserTopicTopInfo
DisplayUserNavigate("查看社区公告")
%><p><%
if GBL_CHK_TempStr <> "" Then
	Response.Write "<br><p align=left><font color=ff0000 class=RedFont><b>" & GBL_CHK_TempStr & "</b></font>"
Else
	GBL_CHK_TempStr = ""
	GetMessageValue
	If GBL_CHK_TempStr = "" Then
		LookMessage
	Else
		Response.Write "<p align=left><font color=ff0000 class=RedFont><b>&nbsp; &nbsp; " & GBL_CHK_TempStr & "</b>"
	End If
End If
UserTopicBottomInfo
closeDataBase
SiteBottom
If GBL_ShowBottomSure = 1 Then Response.Write GBL_SiteBottomString

Function GetMessageValue

	Dim Rs,SQL
	Set Rs = Server.CreateObject("ADODB.RecordSet")
	SQL = "Select top " & DEF_TopicContentMaxListNum & " ID,FromUser,toUser,Title,Content,IP,SendTime,ReadFlag from LeadBBS_InfoBox where ToUser='' order by ID DESC"
	Set Rs = Con.ExeCute(SQL)
	GBL_DBNum = GBL_DBNum + 1

	If Rs.Eof Then
		GBL_CHK_TempStr = "错误，找不到这条消息相关资料．"
	Else
		GetData = Rs.GetRows(-1)
	End If
	Rs.Close
	Set Rs = Nothing

End Function


Function LookMessage

	Dim TempN,N,SuperFlag
	SuperFlag = CheckSupervisorUserName
	If GBL_UserID < 1 Then SuperFlag = 0
	For N = 0 to Ubound(GetData,2)
		Response.Write "<a name=" & N & "></a>"
%>
	
	<br>
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr> 
		<td> 
			<div align="center">
				<%
				If GetData(3,N)<>"" Then Response.Write "<b>" & GetData(3,N) & "</b>"%>
			</div>
		</td>
		<td> 
		</td>
	</tr>
	</table>
	<br>
	<table border=0 cellpadding=5 cellspacing=1 width=100% bgcolor="<%=DEF_BBS_Color%>" style="WORD-BREAK: break-all;" class=TBBG1 align=center>
	
	<tr bgcolor="<%=DEF_BBS_LightestColor%>" class=TBBG9> 
		<td align=center>
			发布人： <a href=LookUserinfo.asp?name=<%=urlencode(GetData(1,N))%>><%=htmlencode(GetData(1,N))%></a> &nbsp;公告时间： <%=htmlencode(RestoreTime(GetData(6,N)))%>
		</td>
	</tr>
	<tr bgcolor="<%=DEF_BBS_LightestColor%>" class=TBBG9> 
		<td height=24 valign=top align=center>
			<table border="0" cellspacing="0" cellpadding="0">
			<tr> 
				<td>
			<%
		   	If DEF_UBBiconNumber > 0 then
		   		If inStr(GetData(4,N),"[em") > 0 or inStr(GetData(4,N),"[EM") > 0 then
					For TempN = 1 to DEF_UBBiconNumber
			   			GetData(4,N)=replace(GetData(4,N),"[EM" & Right(("0" & TempN),2) & "]","<img src=""../images/UBBicon/em" & Right("0" & TempN,Len(DEF_UBBiconNumber)) & ".GIF"" width=20 height=20 align=absmiddle border=0>",1,10,0)
			   			GetData(4,N)=replace(GetData(4,N),"[em" & Right(("0" & TempN),2) & "]","<img src=""../images/UBBicon/em" & Right("0" & TempN,Len(DEF_UBBiconNumber)) & ".GIF"" width=20 height=20 align=absmiddle border=0>",1,10,0)
			   		Next
			   	End If
		   	End If
			Response.Write VbCrLf & ReplaceNotNull(ReplaceNotNull(GetData(4,N),VbCrLf,"<br>"),"  ","&nbsp;&nbsp;")
			%>
				</td>
			</tr>
			</table>
		</td>
	</tr>
	<%
	If SuperFlag = 1 Then%>
	<tr bgcolor="<%=DEF_BBS_LightestColor%>" class=TBBG9> 
		<td>
			<script language=javascript>
				function kill(killID)
				{
					window.open('DeleteMessage.asp?MessageID='+killID,'','width=450,height=37,scrollbars=auto,status=no');
				}
			</script>
			<a href='javascript:kill(<%=GetData(0,N)%>);'>要删除公告请点击这里</a>
			发布公告人IP：<%=GetData(5,N)%>
		</td>
	</tr><%End If%>
	</table>
	<br>
<%
	Next

End Function%>