<% 'Inicio do Album de fotos 'Declara as variaveis Dim CurFile, PopFileShowSub, ShowPic, PictureNo Dim strPathInfo, strPhysicalPath Dim intTotPics, intPicsPerRow, intPicsPerPage, intTotPages, intPage, intPicsWidth, strPicArray() 'Configurações personalizadas intPicsPerRow = 4 'Numero de Colunas intPicsPerPage = 24 'Numero de imagens por páginas intPicsWidth = 200 'Tamanha das mininhaturas das imagens intPage = CInt(Request.QueryString("Pagina")) If intPage = 0 Then intPage = 1 End If CurFile = "eventos.asp" PopFile = "Ver.asp" %>

Galeria de Fotos

Eventos:

<% If ShowPic > " " then ShowPic = Replace(ShowPic, " ", "%20") Response.Write "

Voltar
" Else %> <% 'Localiza a quatidade de pastas que tem imagens strPhysicalPath = Server.MapPath(".\" & ShowSub) If ShowSub > " " then ShowSub = Replace(ShowSub, " ", "%20") Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder(strPhysicalPath) Set objFolderContents = objFolder.Files 'Conta a quatidade de imagens nos sub diretórios intTotPics = 0 For Each objFileItem in objFolderContents If Ucase(Right(objFileItem.Name,4))=".GIF" OR Ucase(Right(objFileItem.Name,4))=".JPG" THEN intTotPics = intTotPics + 1 End if Next 'Calcula a quatidade de imagens que tem no diretorio If (intTotPics/intPicsPerPage) = (int(intTotPics/intPicsPerPage)) Then intTotPages = int(intTotPics/intPicsPerPage) Else intTotPages = int(intTotPics/intPicsPerPage)+1 End If Redim strPicArray(2,intTotPics) 'Varre o diretorio e pegas as imagens com extenções de imagens x = 0 For Each objFileItem in objFolderContents If Ucase(Right(objFileItem.Name,4))=".GIF" OR Ucase(Right(objFileItem.Name,4))=".JPG" THEN strPicArray(0,x) = objFileItem.Name strPicArray(1,x) = Cstr(int(x/intPicsPerPage)+1) x = x + 1 End if Next 'Determina a paginação para imagens e mostra o total de imagens no diretorio. If intTotPages > 1 Then Response.Write "" Response.Write "" End If 'Mosta as tabelas onde serão exibidas as imagens For x = 0 to UBound(strPicArray,2)-1 If CInt(strPicArray(1,x)) = intPage Then ShowPic = Replace(strPicArray(0,x), " ", "%20") Response.write "" & vbcrlf PictureNo = PictureNo + 1 If PictureNo=intPicsPerRow Then Response.write "" PictureNo = 0 End if End If Next Set objFSO = Nothing End if %>
Páginas:   " For x = 1 to intTotPages If x = intPage Then Response.Write "" & x & "    " Else Response.Write "" & x & "    " End If Next Response.Write "

Total de imagens nesta página: "&intTotPics&"
" Response.Write "
 
" Response.Write(" ") Response.Write("
" & Mid(strPicArray(0,x),1,Len(strPicArray(0,x))-4) & "") Response.write "
<% End if %>