<!--#include file="inc/Conn.asp"-->
<!--#include file="Inc/Cls.Common.asp"-->
<!--#include file="Inc/Cls.Templates.asp"-->
<%
  Dim ID
  ID = WRMPS.CheckStr(Request("ID"),1)
  If ID = "" Then Call WRMPS.ErrView("","","<li>操作错误，本窗口将在 <span id=time>5</span> 秒钟后自动关闭。<script language=javascript>"&vbCrLf&"function clock(){i=i-1"&vbCrLf&"time.innerHTML = i;"&vbCrLf&"if(i>0)"&vbCrLf&"setTimeout(""clock();"",1000);"&vbCrLf&"else"&vbCrLf&"self.close();}"&vbCrLf&"var i=5"&vbCrLf&"clock();"&vbCrLf&"</script>",0)
  SitePath = ",<a href="&WR_Setting(3)&"Announce.asp?ID="&ID&">阅读公告</a>"
  SitePath = WRMPS.GetSitePath(-1,SitePath)
  Call DBConnBegin()
  
  Set Rs = Server.CreateObject("ADODB.RecordSet")
  Rs.Open "Select WM_ID,WM_Tit,WM_Content,WM_User,WM_Time,WM_TempID From WM_Announce Where WM_Key=1 and WM_ID="&ID ,Conn,1,1
  If Rs.Eof Then
    Call WRMPS.ErrView("","","<li>公告不存在，本窗口将在 <span id=time>5</span> 秒钟后自动关闭。<script language=javascript>"&vbCrLf&"function clock(){i=i-1"&vbCrLf&"time.innerHTML = i;"&vbCrLf&"if(i>0)"&vbCrLf&"setTimeout(""clock();"",1000);"&vbCrLf&"else"&vbCrLf&"self.close();}"&vbCrLf&"var i=5"&vbCrLf&"clock();"&vbCrLf&"</script>",0)
  Else
    Call WRMPS.FsoBegin()
    TempStr = WRTemp.SiteTemplates(1,Rs(5),12,0)
    Call WRMPS.FsoEnd()
    TempStr = WRMPS.GetReplace(TempStr,"{$AnnounceID}",Rs(0)) 
    TempStr = WRMPS.GetReplace(TempStr,"{$AnnounceTitle}",Rs(1)) 
    TempStr = WRMPS.GetReplace(TempStr,"{$AnnounceContent}",Rs(2)) 
    TempStr = WRMPS.GetReplace(TempStr,"{$AnnounceTime}",Rs(4)) 
    TempStr = WRMPS.GetReplace(TempStr,"{$AnnounceAnthor}",Rs(3)) 
  End If
  Rs.Close
  Set Rs = Nothing

  TempStr = WRTemp.SiteLabel(TempStr)
  Call ClassEnd()
  Response.write TempStr
  Call DBConnEnd()
%>