<% If usesummary="no" then showall Else If request("id")<>"" Then showentry Else showsummary End If End If Sub showsummary() toptable offset=request("offset") If not Isnumeric(offset) or offset="" or offset<1 Then offset=1 End If blogfile = Server.MapPath("myblogindex.txt") Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True) news=objCountFile.ReadAll objCountFile.Close Set objCountFile = Nothing Set objFSO = Nothing filenames=Split(news, "**") numrecords = Ubound(filenames) topcount=(offset+recordsperpage)-1 If numrecords < topcount Then topcount=numrecords End If showscript=Request.ServerVariables("SCRIPT_NAME") for i = offset to topcount bloginfo=split(filenames(i), "%%%") Response.Write "" & bloginfo(2) & "" & FormatDateTime(bloginfo(1), formdate) & "" & bloginfo(3) & "more ..." Next If offset > 1 Then Response.Write "See newer entries" End If If topcount < numrecords Then Response.Write "See older entries" End If bottomtable End Sub Sub showall() toptable offset=request("offset") If not Isnumeric(offset) or offset="" or offset<1 Then offset=1 End If blogfile = Server.MapPath("myblogindex.txt") Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True) news=objCountFile.ReadAll objCountFile.Close Set objCountFile = Nothing Set objFSO = Nothing filenames=Split(news, "**") numrecords = Ubound(filenames) topcount=(offset+recordsperpage)-1 If numrecords < topcount Then topcount=numrecords End If showscript=Request.ServerVariables("SCRIPT_NAME") for i = offset to topcount bloginfo=split(filenames(i), "%%%") blogfile = Server.MapPath("myblog" & bloginfo(0) & ".txt") Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True) news=objCountFile.ReadAll objCountFile.Close Set objCountFile = Nothing Set objFSO = Nothing bloginfo=Split(news, "%%%") showscript=Request.ServerVariables("SCRIPT_NAME") Response.Write "" & bloginfo(0) & "" & FormatDateTime(bloginfo(1), formdate) & "" & bloginfo(3) & "" Next If offset > 1 Then Response.Write "See newer entries" End If If topcount < numrecords Then Response.Write "See older entries" End If bottomtable End Sub Sub Showentry() toptable blogfile = Server.MapPath("myblog" & request("id") & ".txt") Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True) news=objCountFile.ReadAll objCountFile.Close Set objCountFile = Nothing Set objFSO = Nothing bloginfo=Split(news, "%%%") showscript=Request.ServerVariables("SCRIPT_NAME") Response.Write "" & bloginfo(0) & "" & FormatDateTime(bloginfo(1), formdate) & "" & bloginfo(3) & "" Response.Write "< back to main blog" bottomtable End Sub %>