<%
	Function ReplaceSK_Page_content(MID,SK_Template_content_output,SK_Page_contents)
    Dim Parameter_data
	IF skweboa.SK_sys(40)<>"Ofem8"&skcmscodeJ(skweboa.SK_sys(6)&skweboa.SK_sys(39)&skweboa.SK_sys(12))&"ewlbf" THEN
	SK_Page_contents=replace(SK_Page_contents,"网站","<a href=""http://www.elline.cn"" title=""网站系统""  >网站</a>")	
	SK_Page_contents=replace(SK_Page_contents,"CMS","<a href=""http://www.skcms.net"" title=""CMS""  >CMS</a>")		
	SK_Page_contents=replace(SK_Page_contents,"空间","<a href=""http://www.elline.cn"" title=""网站空间""  >空间</a>")			
	SK_Page_contents=replace(SK_Page_contents,"域名","<a href=""http://www.elline.cn"" title=""域名注册""  >域名</a>")		
	If DateDiff("m",""&skweboa.SK_sys(39)&"",now())>6 Then
	SK_Page_contents="<script>alert('EL网站系统提示:\n\n您当前使用的免费网站程序已经到期，需要登陆 www.elline.cn 购买正式授权(198元)，才能继续使用!\n\n未经正式授权应用于商业网站我们将追究相关法律责任!');location.href='http://www.elline.cn/el';</script>"	
	end if	
	    END IF	
		       SK_Page_contents=skweboa.SK_SKCMSlinks(SK_Page_contents)
			   If InStr(SK_Template_content_output, "{$articlesize}") <> 0 Then
			   SK_Page_contents = "<span ID=""ContentArea"">" & SK_Page_contents & "</span>"
			   Parameter_data = "<script Language=Javascript>" & _
					  "function ContentSize(size)" & _
					  "{document.all.ContentArea.style.fontSize=size+""px"";}" & _
					  "</script>"
			  Parameter_data = Parameter_data & "【字体：<A href=""javascript:ContentSize(16)"">大</A> <A href=""javascript:ContentSize(14)"">中</A> <A href=""javascript:ContentSize(12)"">小</A>】"
				  SK_Template_content_output = Replace(SK_Template_content_output, "{$articlesize}", Parameter_data)
			  End If
		 SK_Template_content_output=SK_modestyle(MID,SK_Template_content_output)
 		 SK_Template_content_output = Replace(SK_Template_content_output,"{$SK_page_content}",  SK_Page_contents   )
		
   
			SK_Template_content_output = Replace(SK_Template_content_output,"{$articletitle}",SK_GetNodehtml("title"))
 			If InStr(SK_Template_content_output, "{$KeyTags}") > 0  Then
				SK_Template_content_output = Replace(SK_Template_content_output, "{$KeyTags}",ReplaceKeyTags(1,SK_GetNodehtml("keywords")))
			End if
			
 			If InStr(SK_Template_content_output, "{$ctitle}") > 0  Then
				SK_Template_content_output = Replace(SK_Template_content_output, "{$ctitle}",skweboa.CloseHtml(SK_GetNodehtml("title")))
			End if
 
		  
			If InStr(SK_Template_content_output, "{$picurl}") > 0   And Trim(SK_GetNodehtml("picurl")) <> "" Then
				SK_Template_content_output = Replace(SK_Template_content_output, "{$picurl}",skweboa.PathDoMain&SK_GetNodehtml("picurl"))
			Else
				SK_Template_content_output = Replace(SK_Template_content_output, "{$picurl}","")
			End If 
 

 			If InStr(SK_Template_content_output, "{$articleurl}") > 0  Then
				SK_Template_content_output = Replace(SK_Template_content_output, "{$articleurl}", skweboa.SK_pageaddressall(MID,SK_GetNodehtml("classid"),SK_GetNodehtml("id"),SK_GetNodehtml("skweblink"),SK_GetNodehtml("filename"),SK_GetNodehtml("skadminuserpurview"),SK_GetNodehtml("skReadthecontent")))
			End If 

			If InStr(SK_Template_content_output, "{$classname}") > 0  Then
				SK_Template_content_output = Replace(SK_Template_content_output, "{$classname}", skweboa.skCMSlist(SK_GetNodehtml("classid"),2))
			End If 
 
	
				
			If InStr(SK_Template_content_output, "{$classad}") > 0  Then
				SK_Template_content_output = Replace(SK_Template_content_output, "{$classad}", skweboa.skCMSlist(SK_GetNodehtml("classid"),18))
			End If 
		
			If InStr(SK_Template_content_output, "{$classtitle}") > 0  Then
				SK_Template_content_output = Replace(SK_Template_content_output, "{$classtitle}", skweboa.skCMSlist(SK_GetNodehtml("classid"),25))
			End If 
			
				
			
			If InStr(SK_Template_content_output, "{$classimg}") > 0  Then
		  if skweboa.skCMSlist(SK_GetNodehtml("classid"),24)="" then
			   	 SK_Template_content_output = Replace(SK_Template_content_output, "{$classimg}","")          
		  else
		 SK_Template_content_output = Replace(SK_Template_content_output, "{$classimg}","<img src="""&skweboa.skCMSlist(SK_GetNodehtml("classid"),24)&"""/>")
		 end if
			End If 
			
			If InStr(SK_Template_content_output, "{$classico}") > 0  Then
		  if skweboa.skCMSlist(SK_GetNodehtml("classid"),28)="" then
			   	 SK_Template_content_output = Replace(SK_Template_content_output, "{$classico}","")          
		  else
		 SK_Template_content_output = Replace(SK_Template_content_output, "{$classico}","<img src="""&skweboa.skCMSlist(SK_GetNodehtml("classid"),28)&"""/>")
		 end if
			End If 
			
			
			If InStr(SK_Template_content_output, "{$intskwebtitle}") <> 0 And Trim(SK_GetNodehtml("intskwebtitle")) <> ""  Then
				SK_Template_content_output = Replace(SK_Template_content_output, "{$intskwebtitle}", SK_GetNodehtml("intskwebtitle"))
			Else
				SK_Template_content_output = Replace(SK_Template_content_output, "{$intskwebtitle}", SK_GetNodehtml("title"))
			End If 

			If InStr(SK_Template_content_output, "{$articlekeyword}") > 0  Then
				SK_Template_content_output = Replace(SK_Template_content_output, "{$articlekeyword}", SK_GetNodehtml("keywords"))
			End If 
			
			If InStr(SK_Template_content_output, "{$id}") > 0  Then
				SK_Template_content_output = Replace(SK_Template_content_output, "{$id}", SK_GetNodehtml("id"))
			End If 

			If InStr(SK_Template_content_output, "{$classid}") > 0  Then
				SK_Template_content_output = Replace(SK_Template_content_output, "{$classid}", Application(SkcmsCookies & "classid"))
			End If 
			
			If InStr(SK_Template_content_output, "{$modeid}") > 0  Then
				SK_Template_content_output = Replace(SK_Template_content_output, "{$modeid}", MID)
			End If 

			If InStr(SK_Template_content_output, "{$modename}") > 0  Then
				SK_Template_content_output = Replace(SK_Template_content_output, "{$modename}",skweboa.SK_Mroot(MID,1))
			End If 
	
			If InStr(SK_Template_content_output, "{$modedw}") > 0  Then
				SK_Template_content_output = Replace(SK_Template_content_output, "{$modedw}",skweboa.SK_Mroot(MID,5))
			End If 
					


			If InStr(SK_Template_content_output, "{$parentid}") > 0  Then
				SK_Template_content_output = Replace(SK_Template_content_output, "{$parentid}",skweboa.skCMSlist(Application(SkcmsCookies & "ClassID"),11))
			End If 
			
			
	if  skweboa.skCMSlist(Application(SkcmsCookies & "ClassID"),11)=0 then
		 SK_Template_content_output = Replace(SK_Template_content_output, "{$pclassname}",skweboa.skCMSlist(SK_GetNodehtml("classid"),2))
	else 
		 	SK_Template_content_output = Replace(SK_Template_content_output, "{$pclassname}",skweboa.skCMSlist(skweboa.skCMSlist(Application(SkcmsCookies & "ClassID"),11),2))	
	end if 	
			
			
			
			
			
			If InStr(SK_Template_content_output, "{$articlehits}") <> 0 Then
			 SK_Template_content_output = Replace(SK_Template_content_output, "{$articlehits}", "<Script Language=""Javascript"" Src="""&MyDbPath&"SKCMS/skweb.Hits.asp?ModeID="&MID&"&ID=" & SK_GetNodehtml("id") & """></Script>")
			End If
			
			
			If InStr(SK_Template_content_output, "{$articledate}") <> 0 Then
			   SK_Template_content_output = Replace(SK_Template_content_output, "{$articledate}", Year(SK_GetNodehtml("updatetime")) & "-" & Right("0" & Month(SK_GetNodehtml("updatetime")), 2) & "-" & Right("0" & Day(SK_GetNodehtml("updatetime")), 2)&"")
			End If
			
			
			If InStr(SK_Template_content_output, "{$articleintro}") >0  Then
				If Trim(SK_GetNodehtml("intro")) <> "" Then 
					SK_Template_content_output = Replace(SK_Template_content_output, "{$articleintro}", SK_GetNodehtml("intro"))
				Else
	SK_Template_content_output = Replace(SK_Template_content_output, "{$articleintro}", skweboa.ReplaceTrim(skweboa.GetStrValue(Replace(Replace(Replace(Replace(skweboa.CloseHtml(SK_GetNodehtml("content")), vbCrLf, ""), "[NextPage]", ""), "&nbsp;", ""),"""",""),300)))
				End If 
			End If 
			


 
		  
		Dim regEx,Matches,Match,CTemp
		Set regEx = New RegExp
		regEx.Pattern = "<!--comment-->([\s\S]*?)<!--comment-->"
		regEx.IgnoreCase = True
		regEx.Global = True
		Set Matches = regEx.Execute(SK_Template_content_output)
 		For Each Match In Matches
			  CTemp=apicomment(Match.SubMatches(0))
			  SK_Template_content_output =Replace(SK_Template_content_output, Match.Value,Split(CTemp,"§")(0))
			  SK_Template_content_output = Replace(SK_Template_content_output,"{$more}",Split(CTemp,"§")(1))
		Next 
 
        	 SK_Template_content_output = Replace(SK_Template_content_output, "{$wzprevarticle}", WZNextArticle(SK_GetNodehtml("id"), SK_GetNodehtml("classid"), "Prev",MID,1))
		 	 SK_Template_content_output = Replace(SK_Template_content_output, "{$wznextarticle}", WZNextArticle(SK_GetNodehtml("id"), SK_GetNodehtml("classid"), "Next",MID,1))
		 	 SK_Template_content_output = Replace(SK_Template_content_output, "{$wzprevarticleimg}", WZNextArticle(SK_GetNodehtml("id"), SK_GetNodehtml("classid"), "Prev",MID,2))
		 	 SK_Template_content_output = Replace(SK_Template_content_output, "{$wznextarticleimg}", WZNextArticle(SK_GetNodehtml("id"), SK_GetNodehtml("classid"), "Next",MID,2))
		 	 SK_Template_content_output = Replace(SK_Template_content_output, "{$prevarticleurl}", WZNextArticle(SK_GetNodehtml("id"), SK_GetNodehtml("classid"), "Prev",MID,3))
		 	 SK_Template_content_output = Replace(SK_Template_content_output, "{$nextarticleurl}", WZNextArticle(SK_GetNodehtml("id"), SK_GetNodehtml("classid"), "Next",MID,3))   
		 	 SK_Template_content_output = Replace(SK_Template_content_output, "{$prevarticletitle}", WZNextArticle(SK_GetNodehtml("id"), SK_GetNodehtml("classid"), "Prev",MID,4))
		 	 SK_Template_content_output = Replace(SK_Template_content_output, "{$nextarticletitle}", WZNextArticle(SK_GetNodehtml("id"), SK_GetNodehtml("classid"), "Next",MID,4))     
			 ReplaceSK_Page_content = SK_Template_content_output
 		     Call skweboa.bqts()
  End Function
		
	
		
'上一篇、下一篇 内容
		Function WZNextArticle(NID, CID, stlyedarr,MID,tid)  Dim aspexcop
		If Trim(stlyedarr) = "Prev" Then
	    aspexcop = " SELECT Top 1 ClassID,ID,skwebLink,FileName,skadminuserpurview,skReadthecontent,title,PicUrl From  "&skweboa.SK_Mroot(MID,2)&"  Where classID='" & Trim(CID) & "' And ID<" & NID & "  And isAccept=0 AND delif=0  Order By ID Desc"
			ElseIf Trim(stlyedarr) = "Next" Then
				   aspexcop = " SELECT Top 1 ClassID,ID,skwebLink,FileName,skadminuserpurview,skReadthecontent,title,PicUrl From  "&skweboa.SK_Mroot(MID,2)&"  Where classID='" & Trim(CID) & "' And ID>" & NID & "  And isAccept=0 AND delif=0  Order By ID"
			Else
				WZNextArticle = "":Exit Function
			End If
			 Dim RS:Set RS=Server.CreateObject("ADODB.Recordset")
			 RS.Open aspexcop, Conn, 1, 1
			 If RS.EOF And RS.BOF Then
				WZNextArticle =""
			 Else
			if tid=1 then
				WZNextArticle = "<a href=""" &skweboa.SK_pageaddress(MID,Rs(0),Rs(1),Rs(2),Rs(3),Rs(4),Rs(5)) & """ title=""" & skweboa.CloseHtml(RS("title")) & """>" & RS("title") & "</a>"
			elseif tid=2 then
				WZNextArticle = "<a class=""pic_1"" href=""" &skweboa.SK_pageaddress(MID,Rs(0),Rs(1),Rs(2),Rs(3),Rs(4),Rs(5)) & """  title=""" & skweboa.CloseHtml(RS("title")) & """><img  src="""&Rs(7)&""" onload='javascript:DrawImage(this,100,74);' /></a>"		
			elseif tid=3 then
				WZNextArticle =skweboa.SK_pageaddress(MID,Rs(0),Rs(1),Rs(2),Rs(3),Rs(4),Rs(5))
			elseif tid=4 then
				WZNextArticle =skweboa.CloseHtml(RS("title"))			
			end if
			 End If
			 RS.Close:Set RS = Nothing
		End Function
 
		%>