<!--#include file="../inc/Conn.asp"-->
<!--#include file="../Inc/Cls.Common.asp"-->
<!--#include file="../Inc/Cls.Templates.asp"-->
<!--#include file="Channel_Config.asp"-->
<%
   Dim ID
   Dim PrevArticle,NextArticle,ParentPath
   Dim i,LinkUrl

   ID=WRMPS.CheckStr(Request("ID"),1)
   If ID = "" Then Call WRMPS.ErrView("返回"&ChannelName&"首页","index.asp","<li>操作错误",0)

   Call DBConnBegin()
   Call WRMPS.FsoBegin()
   TempStr = WRTemp.SiteTemplates(1,0,42,ChannelID)
   Call WRMPS.FsoEnd()
     Set Rs=server.createobject("adodb.recordset")
     Rs.Open"select A.WM_Title,A.WM_TitleIntact,A.WM_Synopsis,A.WM_Content,A.WM_Author,A.WM_CopyFrom,A.WM_Post,A.WM_AddTime,A.WM_Grade,A.WM_ClassID,A.WM_ClassDir,B.WM_Name,B.WM_ParentPath From WM_Article A Inner Join WM_ArticleSort B on A.WM_ClassID = B.WM_ID where A.WM_Passed=1 and A.WM_IsDeleted=0 and A.WM_id="&ID,Conn,1,1
     If Rs.eof then
       Call WRMPS.ErrView("返回"&ChannelName&"首页","index.asp","<li>该内容不存在或还没有通过管理员审核",0)
	 End If
       TempStr = WRMPS.GetReplace(TempStr,"{$ArticleTitle}",Rs(0))
       TempStr = WRMPS.GetReplace(TempStr,"{$ArticleSubheading}",Rs(1))
       TempStr = WRMPS.GetReplace(TempStr,"{$ArticleIntro}",Rs(2))
       TempStr = WRMPS.GetReplace(TempStr,"{$ArticleContent}",Rs(3))
       TempStr = WRMPS.GetReplace(TempStr,"{$Hit}","<script language='JavaScript' src='{$InstallDir}Inc/WM.Article.asp?{$ArticleID},Hit'></script>")
       TempStr = WRMPS.GetReplace(TempStr,"{$Re}","<script language='JavaScript' src='{$InstallDir}Inc/WM.Article.asp?{$ArticleID},reNum'></script>")
       TempStr = WRMPS.GetReplace(TempStr,"{$NewRe}","<script language='JavaScript' src='{$InstallDir}Inc/WM.Article.asp?{$ArticleID},reShow'></script>")
       TempStr = WRMPS.GetReplace(TempStr,"{$ArticleID}",ID)
       TempStr = WRMPS.GetReplace(TempStr,"{$Author}",Rs(4))
       TempStr = WRMPS.GetReplace(TempStr,"{$CopyFrom}",Rs(5))
       TempStr = WRMPS.GetReplace(TempStr,"{$Editor}",WRUser.DispUser(0,Rs(6)))
       TempStr = WRMPS.GetReplace(TempStr,"{$Time}",Rs(7))
       TempStr = WRMPS.GetReplace(TempStr,"{$ArticleGrade}",Rs(8))
	   TempStr = WRMPS.GetReplace(TempStr,"{$Url}",WRMPS.GetShowUrl(1,1,0,ID,Rs(7),ChannelDir&Rs(10),ChannelID))
	   ClassID = Rs(9)
	   ClassName = Rs(11)
	   ParentPath = Rs(12)
	   Set Rso = Conn.Execute("Select Top 1 WM_ID,WM_TitlePrefixion,WM_Title,WM_ClassDir,WM_AddTime From WM_Article where WM_Passed=1 and WM_IsDeleted=0 and WM_ClassID="&ClassID&" and WM_id<"&ID&" Order By WM_ID Desc")
		 If Not Rso.Eof Then
           PrevArticle = "<a href="&WRMPS.GetShowUrl(1,1,0,Rso(0),Rso(4),ChannelDir&Rso(3),ChannelID)&" target=_blank>"&Rso(1)&Rso(2)&"</a>"
		 Else
		   PrevArticle = "没有了"
		 End If
	   Rso.Close
	   Set Rso = Conn.Execute("Select Top 1 WM_ID,WM_TitlePrefixion,WM_Title,WM_ClassDir,WM_AddTime From WM_Article where WM_Passed=1 and WM_IsDeleted=0 and WM_ClassID="&ClassID&" and WM_id>"&ID&" Order By WM_ID")
		 If Not Rso.Eof Then
           NextArticle = "<a href="&WRMPS.GetShowUrl(1,1,0,Rso(0),Rso(4),ChannelDir&Rso(3),ChannelID)&" target=_blank>"&Rso(1)&Rso(2)&"</a>"
		 Else
		   NextArticle = "没有了"
		 End If
	   Rso.Close
	   SitePath = ",<a href="&WR_Setting(3)&ChannelDir&"/>"&ChannelName&"</a>"
	   If Instr(ParentPath,",") Then
		   ParentPath = Right(ParentPath,Len(ParentPath)-2)
           For i = 0 To UBound(Split(ParentPath,","))
		     If Split(ParentPath,",")(i) <> "" Then
			   Set Rso = Conn.Execute("Select WM_Name,WM_ID,WM_ParentDir,WM_Dir From WM_ArticleSort where WM_ID="&Int(Split(ParentPath,",")(i)))
		       If Not Rso.Eof Then
				 SitePath = SitePath & ",<a href="&WRMPS.GetClassUrl(1,1,ChannelDir&Rso(2)&Rso(3),Rso(1))&">"&Rso(0)&"</a>"
		       End If
		       Rso.Close
			 End If
		   Next
	   End If
	   Set Rso = Nothing
	   SitePath = SitePath & ",<a href="&WRMPS.GetClassUrl(1,1,ChannelDir&Rs(10),ClassID)&">"&ClassName&"</a>"
	 Rs.Close
	 Set Rs = Nothing

	 TempStr = WRMPS.GetReplace(TempStr,"{$PrevArticle}",PrevArticle)
	 TempStr = WRMPS.GetReplace(TempStr,"{$NextArticle}",NextArticle)
	 SitePath = WRMPS.GetSitePath(-1,SitePath)
     TempStr = WRTemp.SiteClass(TempStr)
     TempStr = WRTemp.SiteChannel(TempStr)
     TempStr = WRTemp.SiteLabel(TempStr)

     Call ClassEnd()
	 Call DBConnEnd()
	 Response.Write TempStr

%>
