Luckys Tattoo Museum
 

Guestbook

<% maxitems = 5 set conn = Server.Createobject("adodb.connection") set rs_comments = server.createobject("adodb.recordset") connstr="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("./fpdb/guestbook.mdb") conn.open connstr count_comments=0 rs_comments.open "select count(*) from comments where approved=true",conn if not rs_comments.eof then count_comments = rs_comments(0) end if rs_comments.close if count_comments > 0 then p=GetQSInt("p2") if p="" then p="1" if isnumeric(p) then showp=cint(p) else showp=1 end if maxpages = int(.999+(count_comments / maxitems)) if showp < 1 then showp=1 if showp > maxpages then showp=maxpages rs_comments.open "select * from comments where approved = true order by id desc",conn,3,1 count=0 if showp > 1 then skip= (showp-1)* maxitems do while not rs_comments.eof rs_comments.movenext skip=skip-1 if skip=0 then exit do end if loop end if maincount=0 if not rs_comments.eof then do while not rs_comments.eof %>

Added <%=rs_comments("posted")%> by <%=rs_comments("name")%>

<%=rs_comments("comment")%>
<% rs_comments.movenext count = count + 1 if count = 5 then exit do loop else %>

No comments on this page

<% end if rs_comments.close if maxpages > 1 then response.write "

" for i =1 to maxpages if i <> showp then response.write "" & i & " " else response.write "" & i & " " end if next end if else %>

 

There are no comments

 

 

 

<% end if %>