<% startPage = request("startPage") if startPage = "" then startPage = "1" end if recordsPerPage = 5 databaseName = "guestbook" databaseDirectory = server.mappath("/tlBase/") & "\" & databaseName & "_table\" '----------------------------------- Retrieving the Records Order -------------------------------- Set tempXML = Server.CreateObject("Microsoft.XMLDOM") tempXML.Load(databaseDirectory &"\"& databaseName & "_sortBydateCreated.xml") orderText=tempXML.selectSingleNode("order/ID_order").text orderArray = Split(orderText, ",") indexStart = UBound(orderArray)- ((startPage-1)*recordsPerPage) indexEnd = indexStart-recordsPerPage+1 if ((UBound(orderArray)+1) Mod recordsPerPage) <> 0 then numberOfPages = ((UBound(orderArray)+1) \ recordsPerPage) + 1 else numberOfPages = (UBound(orderArray)+1) \ recordsPerPage end if %>
--> <% for i=1 to numberOfPages if i-startPage = 0 then %> PAGE<%=i%> <%else%> PAGE<%=i%> <% end if next %>    
<% i = indexStart do While i>=indexEnd and i>=0 tempXML.Load(databaseDirectory &"\"& databaseName & "_record" & Trim(orderArray(i)) & ".xml") set currRecord = tempXML.selectNodes("record/*") %> <% i=i-1 loop set tempXML = nothing set currRecord = nothing prevPage = startPage-1 nextPage = startPage+1 if prevPage < 1 then prevPage = numberOfPages end if if nextPage > numberOfPages then nextPage = 1 end if %>
:: GUESTBOOK ver.4.0 ::
   <%=currRecord.item(1).text%>    <%if not (currRecord.item(2).text="" or currRecord.item(2).text="http://" or currRecord.item(2).text="na") then%> [<%=currRecord.item(2).text%>]  <%end if%>   
      <%=currRecord.item(4).text%>   --<%=FormatDateTime(currRecord.item(5).text,2)%>