<% ' PhotoAlbum Dim CurFile, PopFileShowSub, ShowPic, PictureNo Dim strPathInfo, strPhysicalPath Dim intTotPics, intPicsPerRow, intPicsPerPage, intTotPages, intPage, strPicArray() intPicsPerRow = 4 intPicsPerPage = 12 intPage = CInt(Request.QueryString("Page")) If intPage = 0 Then intPage = 1 End If CurFile = "PhotoAlbum.asp" PopFile = "ShowPicture.asp" %>
method="POST" ID="Form1"> Selecione a Galeria de Fotos que deseja ver:
<% If ShowPic > " " then ShowPic = Replace(ShowPic, " ", "%20") Response.Write "

Voltar
" Else %> <% 'response.Write ShowSub 'response.End if request("ShowSub") <> empty then arrshow = split(request("ShowSub"),"/",-1,1) ShowSub = arrshow(0) & "/thumbs" strPhysicalPath = Server.MapPath(".\" & ShowSub) else 'arrshow = split(request("ShowSub"),"/",-1,1) 'response.Write instr(1,request("ShowSub"),"/thumbs") & " dir=" & showsub 'strPhysicalPath = Server.MapPath(".\" & arrshow(0)) strPhysicalPath = Server.MapPath(".\" & ShowSub) end if 'response.Write instr(1,request("ShowSub"),"thumbs") 'Response.Write strPhysicalPath & "
" & ShowSub 'response.end If ShowSub > " " then ShowSub = Replace(ShowSub, " ", "%20") 'ShowSub = ShowSub & "/thumbs" 'arrs = split(ShowSub,"/",-1,1) 'response.Write arrs(0) Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder(strPhysicalPath) Set objFolderContents = objFolder.Files 'Get the number of pictures in the subdirectory intTotPics = 0 For Each objFileItem in objFolderContents If Ucase(Right(objFileItem.Name,4))=".GIF" OR Ucase(Right(objFileItem.Name,4))=".JPG" OR Ucase(Right(objFileItem.Name,4))=".JPE" THEN intTotPics = intTotPics + 1 End if Next 'Get the total number of pages in the subdirectory If (intTotPics/intPicsPerPage) = (int(intTotPics/intPicsPerPage)) Then intTotPages = int(intTotPics/intPicsPerPage) Else intTotPages = int(intTotPics/intPicsPerPage)+1 End If Redim strPicArray(2,intTotPics) 'Store picture file names in an array x = 0 For Each objFileItem in objFolderContents If Ucase(Right(objFileItem.Name,4))=".GIF" OR Ucase(Right(objFileItem.Name,4))=".JPG" OR Ucase(Right(objFileItem.Name,4))=".JPE" THEN strPicArray(0,x) = objFileItem.Name strPicArray(1,x) = Cstr(int(x/intPicsPerPage)+1) x = x + 1 End if Next 'Determine if there are multiple pages and if so, display page numbers. If intTotPages > 1 Then Response.Write "" Response.Write "" End If For x = 0 to UBound(strPicArray,2)-1 If CInt(strPicArray(1,x)) = intPage Then ShowPic = Replace(strPicArray(0,x), " ", "%20") ShowOrig = split(ShowSub,"/",-1,1) 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 "
" Response.Write(" ") Response.Write("
" & Mid(strPicArray(0,x),1,Len(strPicArray(0,x))-4) & "") Response.write "
<% End if %>