<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <%'option explicit%> Brunel 200: Education
Brunel 200 Masthead Montage Registration Acknowledgements Visitor Information Creative Bristol
Brunel 200 Masthead Montage
Image Gallery


<% Dim iPageSize 'How big our pages are Dim iPageCount 'The number of pages we get back Dim iPageCurrent 'The page we want to show Dim strOrderBy 'A fake parameter used to illustrate passing them Dim SQL 'SQL command to execute Dim iRecordsShown 'Loop controller for displaying just iPageSize records Dim I 'Standard looping var Dim smallF Dim BlackF Dim NormalF smallF = "" BlackF = "" NormalF = "" iPageSize =2000 'number of images shown on each page ' Retrieve page to show or default to 1 If Request.QueryString("page") = "" Then iPageCurrent = 1 Else iPageCurrent = CInt(Request.QueryString("page")) End If If Request.QueryString("order") = "" Then strOrderBy = "id" Else strOrderBy = Request.QueryString("order") End If SQL = "SELECT * FROM gallery ORDER BY " & strOrderBy & " DESC ;" Set objCon = Server.CreateObject ("ADODB.Connection") objcon.Open dbcon Set objRec = Server.CreateObject ("ADODB.Recordset") Objrec.PageSize = iPageSize objrec.CacheSize = iPageSize objRec.Open SQL, objcon, adOpenStatic, adLockReadOnly, adCmdText iPageCount = objrec.PageCount iPageCount = objrec.PageCount If iPageCurrent > iPageCount Then iPageCurrent = iPageCount If iPageCurrent < 1 Then iPageCurrent = 1 ' Check page count to prevent bombing when zero results are returned! If iPageCount = 0 Then Response.Write "No records found!" Else ' Move to the selected page objrec.AbsolutePage = iPageCurrent ' Response.Write "" & normalF & "There are " & objRec.RecordCount & " pictures in the gallery" end if %> <% iRecordsShown = 0 Do While iRecordsShown < iPageSize And Not objrec.EOF If NOT ObjRec.BOF Then if imagenr = 4 then 'change this if you want more than 4 images in a row %> <% imagenr = 0 end if %> <% imagenr = imagenr + 1 iRecordsShown = iRecordsShown + 1 objRec.MoveNext end if loop ObjRec.close set Objrec = Nothing %>


<< Back to the 'Education and Learning' home page.
ships