%@ CODEPAGE=65001 %> <% '/////////////////////////////////////////////////////////////////////////////// '// Z-Blog '// 作 者: 朱煊(zx.asd) & Sipo '// 版权所有: RainbowSoft Studio '// 技术支持: rainbowsoft@163.com '// 程序名称: '// 程序版本: '// 单元名称: guestbook.asp '// 开始时间: 2007-01-03 '// 最后修改: '// 备 注: GuestBook '/////////////////////////////////////////////////////////////////////////////// %> <% Option Explicit %> <% On Error Resume Next %> <% Response.Charset="UTF-8" %> <% Response.Buffer=True %> <% '********************************************************* ' 目的: 定义TGuestBook类 ' 输入: 无 ' 返回: 无 '********************************************************* Class TGuestBook Public Template_Article_Single Public Template_Article_Comment Public Template_Article_Commentpost Public Template_PageBar Public Template_Article_Commentpost_Verify Public html Private Ftemplate Public Property Let template(strFileName) Application.Lock Ftemplate=Application(ZC_BLOG_CLSID & "TEMPLATE_" & strFileName) Application.UnLock End Property Public Property Get template template = Ftemplate End Property Public Function Export(intPage) Dim i,j,strC_Count,objComment,strC If IsNumeric(intPage)=False Then intPage=1 Call CheckParameter(intPage,"int",1) Template_Article_Single=Application(ZC_BLOG_CLSID & "TEMPLATE_B_ARTICLE-GUESTBOOK") If (Template_Article_Single="") Then Template_Article_Single=Application(ZC_BLOG_CLSID & "TEMPLATE_B_ARTICLE-SINGLE") End If Template_Article_Commentpost=Application(ZC_BLOG_CLSID & "TEMPLATE_B_ARTICLE_COMMENTPOST") If ZC_COMMENT_VERIFY_ENABLE=True Then Template_Article_Commentpost_Verify=Application(ZC_BLOG_CLSID & "TEMPLATE_B_ARTICLE_COMMENTPOST-VERIFY") End If Dim objRS Set objRS=Server.CreateObject("ADODB.Recordset") objRS.CursorType = adOpenKeyset objRS.LockType = adLockReadOnly objRS.ActiveConnection=objConn objRS.Source="" objRS.Open("SELECT COUNT([comm_ID])AS allComment FROM [blog_Comment] WHERE [blog_Comment].[log_ID]=0") If (Not objRS.bof) And (Not objRS.eof) Then strC_Count=objRS("allComment") End If objRS.Close Set objRS=Nothing Set objRS=Server.CreateObject("ADODB.Recordset") objRS.CursorType = adOpenKeyset objRS.LockType = adLockReadOnly objRS.ActiveConnection=objConn objRS.Source="SELECT [comm_ID],[log_ID],[comm_AuthorID],[comm_Author],[comm_Content],[comm_Email],[comm_HomePage],[comm_PostTime],[comm_IP],[comm_Agent] FROM [blog_Comment] WHERE [blog_Comment].[log_ID]=0 ORDER BY [comm_PostTime] DESC" objRS.Open() objRS.PageSize=ZC_MSG_COUNT If objRS.PageCount>0 Then objRS.AbsolutePage = intPage If (not objRS.bof) And (not objRS.eof) Then For i=1 To objRS.PageSize Set objComment=New TComment objComment.LoadInfoByArray(Array(objRS("comm_ID"),objRS("log_ID"),objRS("comm_AuthorID"),objRS("comm_Author"),objRS("comm_Content"),objRS("comm_Email"),objRS("comm_HomePage"),objRS("comm_PostTime"),"","")) Application.Lock strC=Application(ZC_BLOG_CLSID & "TEMPLATE_B_ARTICLE_COMMENT") Application.UnLock objComment.Count=strC_Count-i-(ZC_MSG_COUNT * (intPage-1))+1 strC=objComment.MakeTemplate(strC) If ZC_COMMENT_REVERSE_ORDER_EXPORT=True Then Template_Article_Comment=Template_Article_Comment & strC Else Template_Article_Comment=strC & Template_Article_Comment End If Set objComment=Nothing objRS.MoveNext If objRS.eof Then Exit For Next End If j=objRS.PageCount If j>0 Then Dim a,b,s,t,intNowPage,strPageBar s=ZC_BLOG_HOST & "guestbook.asp" t="" intNowPage=intPage Application.Lock strPageBar=Application(ZC_BLOG_CLSID & "TEMPLATE_B_PAGEBAR") Application.UnLock strPageBar=Replace(strPageBar,"<#pagebar/page/url#>",s) strPageBar=Replace(strPageBar,"<#pagebar/page/number#>",ZC_MSG285) Template_PageBar=Template_PageBar & strPageBar If j>ZC_PAGEBAR_COUNT Then a=intNowPage b=intNowPage+ZC_PAGEBAR_COUNT If a>ZC_PAGEBAR_COUNT Then a=a-1:b=b-1 If b>j Then b=j:a=j-ZC_PAGEBAR_COUNT Else a=1:b=j End If For i=a to b s=ZC_BLOG_HOST & "guestbook.asp?"& t &"page="& i If i=1 Then s=ZC_BLOG_HOST & "guestbook.asp" End If Application.Lock strPageBar=Application(ZC_BLOG_CLSID & "TEMPLATE_B_PAGEBAR") Application.UnLock If i=intNowPage then Template_PageBar=Template_PageBar & "" & i & "" Else strPageBar=Replace(strPageBar,"<#pagebar/page/url#>",s) strPageBar=Replace(strPageBar,"<#pagebar/page/number#>",i) Template_PageBar=Template_PageBar & strPageBar End If Next s=ZC_BLOG_HOST & "guestbook.asp?"& t &"page="& j If j=1 Then s=ZC_BLOG_HOST & "guestbook.asp" End If Application.Lock strPageBar=Application(ZC_BLOG_CLSID & "TEMPLATE_B_PAGEBAR") Application.UnLock strPageBar=Replace(strPageBar,"<#pagebar/page/url#>",s) strPageBar=Replace(strPageBar,"<#pagebar/page/number#>",ZC_MSG286) Template_PageBar=Template_PageBar & strPageBar End If objRS.Close Set objRS=Nothing Template_Article_Comment=Template_Article_Comment & "
" Template_Article_Commentpost=Replace(Template_Article_Commentpost,"<#template:article_commentpost-verify#>",Template_Article_Commentpost_Verify) Template_Article_Single=Replace(Template_Article_Single,"<#template:article_trackback#>","") Template_Article_Single=Replace(Template_Article_Single,"<#template:article_comment#>",Template_Article_Comment) Template_Article_Single=Replace(Template_Article_Single,"<#template:article_commentpost#>",Template_Article_Commentpost) Template_Article_Single=Replace(Template_Article_Single,"<#template:article_tag#>","") Template_Article_Single=Replace(Template_Article_Single,"<#template:article_navbar_l#>","") Template_Article_Single=Replace(Template_Article_Single,"<#template:article_navbar_r#>","") Template_Article_Single=Replace(Template_Article_Single,"<#template:article_mutuality#>","") Template_Article_Single=Replace(Template_Article_Single,"<#template:pagebar#>",Template_PageBar) Dim aryTemplateTagsName(49) Dim aryTemplateTagsValue(49) j=49 Dim PostTime PostTime=GetTime(Now()) aryTemplateTagsName(1)="<#article/id#>" aryTemplateTagsValue(1)=0 aryTemplateTagsName(2)="<#article/level#>" aryTemplateTagsValue(2)=4 aryTemplateTagsName(3)="<#article/title#>" aryTemplateTagsValue(3)=ZC_MSG275 aryTemplateTagsName(4)="<#article/intro#>" aryTemplateTagsValue(4)=ZC_GUESTBOOK_CONTENT aryTemplateTagsName(5)="<#article/content#>" aryTemplateTagsValue(5)=ZC_GUESTBOOK_CONTENT & "