<!--#include file="../fy_inc/fy.User.asp"-->
 <%	ConnectionDatabase
	 Dim pages,UID,CurrPage,title
     Dim ACT_L,TemplateContent,ID,rs
  	 ID = ChkNumeric(Request("id"))
	 CurrPage=ChkNumeric(fycms.s("page"))
    If CurrPage<=0 Then CurrPage=CurrPage+1
	if ID=0 or ID="" Then ID=1
	Application(fycmsN&"ModeID")=1
	 Set rs=fycms.actexe("select * from DiyPage_fy where id="&id)
	 If rs.eof Then echo "参数错误":response.end
	 
	 TemplateContent = LoadTemplate(rs("tempurl"))
	
	 pages="index.asp?page="
	 Dim newt:Set newt=New Cls_Template
	 Dim UserHS,userlogin
	 Set UserHS = New ACT_User
	 userlogin=CBool(UserHS.UserLoginChecked)
	 If userlogin=True Then 
		TemplateContent=rep(TemplateContent,"{fy:userlogin}","1=1")
	 Else 
		TemplateContent=rep(TemplateContent,"{fy:userlogin}","1=0")
 	 End If 


 			 Dim TotalPage,N,ArticlePageStr,ContentArr
			 ContentArr = Split(rs("content"),"[NextPage]")
			 TotalPage = Cint(UBound(ContentArr) + 1)
			   If TotalPage > 1 Then
 					   ArticlePageStr = ArticlePageStr & "<div Class=""pagelist"" align=center><span>本文共<b> " & TotalPage & " </b>页,第</span>&nbsp;&nbsp;"
				   For N = 1 To TotalPage
						 If CurrPage = N Then
						  ArticlePageStr = ArticlePageStr & "<span>[" & N & "]</span>&nbsp;"
						 Else
						  ArticlePageStr = ArticlePageStr & "<a  href="""&fycms.acturl&"plus/page.asp?id=" & ID & "&page=" & N & """>[" & N & "]</a>&nbsp;"
						 End If
					  If TotalPage > 8 Then
					   If N Mod 8 = 0 Then ArticlePageStr = ArticlePageStr & "<p>"
					  End If
					Next
					ArticlePageStr = ContentArr(CurrPage-1) & ArticlePageStr & "<span>页</span></div>"
				 Else
						  ArticlePageStr = rs("content")
				 End If

 

 
	  TemplateContent=newt.GetdiyContent(rs,TemplateContent,ArticlePageStr)'自定义函数

 


 	If userlogin=True Then 
		Dim usersqlstr,usrs
		usersqlstr="select f.* from User_fy F inner join "&fycms.ACT_U(UserHS.UModeID,2)&" U on F.userid=U.userid where u.userid="&userhs.userid&"   order by u.userid desc"
		Set usrs=fycms.actexe(usersqlstr)
		If  Not   usrs.eof Then  TemplateContent = newt.GetUserInfo(TemplateContent,usrs)
	Else 
		TemplateContent = newt.GetnoUserInfo(TemplateContent,"")
	End If 	 




	 echo TemplateContent
%>