<%@ language = "VBSCRIPT" %> <% 'Image Gallery Script with Access database 'By Steinthor Kristinsson 'You may change this code as mutch as 'you want all I ask is that you leave this 'comment whith the script and dont take 'credit for it. 'If any Comments or suggestions please 'e-mail me @ 'postmaster@legends.it %> <% 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 %> Mappe di Legends

 

 <% smallF = "" BlackF = "" NormalF = "" iPageSize =8 '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 Response.write ""& BlackF &"



" 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 & "Ci sono " & objRec.RecordCount & " mappe in biblioteca." end if %>

<% iRecordsShown = 0 Do While iRecordsShown < iPageSize And Not objrec.EOF If NOT ObjRec.BOF Then Response.write ""&showimage&"" imagenr = imagenr + 1 iRecordsShown = iRecordsShown + 1 objRec.MoveNext end if loop ObjRec.close set Objrec = Nothing function showimage() dim HTML html = "" if imagenr = 4 then 'change this if you want more than 4 images in a row html = "" imagenr = 0 end if html = html & "
"& SmallF & "
" html = html & "


" html = html & " Visualizza la Mappa
" showimage = html end function %>

<% Response.write "
"& SmallF& "" If iPageCurrent > 1 Then %>
[<< Indietro] <% End If 'Showing PageNumbers For I = 1 To iPageCount If I = iPageCurrent Then %> <%= I %> <% Else %> <%= I %> <% End If Next 'I If iPageCurrent < iPageCount Then %> [Avanti >>] <% End If Response.write "


"& SmallF& " "& infcop &"" %>

 


Legendstaff - © 2004-2006. Tutti i diritti sono riservati. E' vietata la duplicazione anche parziale senza il consenso scritto da parte della Comunità.
La partecipazione a Legends è gratuita, tutto il materiale inserito all'interno della comunità si intende esplicitamente messo in condivisione con gli altri membri della comunità ai fini del gioco. Con la creazione del personaggio si da espresso consenso alla Comunità di LEGENDS alla gestione dei dati personali (e-mail) ai soli fini della partecipazione alla Comunità. La partecipazione alla comunità implica l'implicita accettazione delle sue regole.
Comunicazioni & Informazioni:
postmaster@legends.it