%
'option explicit
dim ForReading
dim objFSO
dim objNewFile
dim pathToTxt
dim MyString
dim basePath
dim Bvpath
dim howManyPicsInRow
dim widthImage
dim heightImage
dim headFontSize
'---------- configuration (see the readme for more details) --------
basePath = "D:\Inetpub\webs\antaniocom\cazzate\cazzate\"
Bvpath = "http://www.antanio.com/cazzate/cazzate/"
'how many foto per row
howManyPicsInRow = 3
'small pictures sizes
widthImage = 90
heightImage = 75
'header font size
headFontSize = 18
'--------------------------------------------------------------------
'read the header file function
function readTextFile(pathToTxt)
'set file - for reading
ForReading=1
set objFSO = server.createobject("scripting.FileSystemobject")
'open the text file
set objNewFile = objFSO.OpenTextFile(pathToTxt, ForReading)
'loop over the file until the end
do while not objNewFile.AtEndOfStream
'read line
MyString = MyString & objNewFile.ReadLine & "
"
loop
readTextFile = MyString
End function
'decleration
dim folderName 'Folder Name
dim fso ' File System Object
dim fldr ' folder object
dim objFile
dim lastFolder
dim pathToFile
dim f 'file Object
dim i,o,p 'counters
dim buildFolders
dim imageUrl
dim sf 'sub Folders
dim f1 'files in sub folder
dim vpath ' virtual path
dim result
dim blnfoto
dim imgFolderFlag
dim x
dim mini
dim detail
'-----------------------------------------
'the folder name from queryString
folderName = request.queryString("folderName")
mini = ("thumbnails/mini")
detail = ("http://www.antanio.com/foto/detail.asp?id=")
'security
blnfoto = split(folderName,"\")
if folderName <> "" then
for x = 0 to ubound(blnfoto)
if blnfoto(x) = "foto" then
imgFolderFlag = true
exit for
end if
next
if imgFolderFlag <> true then
response.write "
| "
if objFile(lastFolder)<> "folder.gif" then
'counter for pictures
i = i + 1
vpath = split(Bpath,"\")
'converting to virtual path to display image
for o = 0 to ubound(vpath)
if vpath(o) = "foto" then
exit for
end if
next
for p = o+1 to ubound(vpath)
buildFolders = buildFolders & vpath(p) & "/"
next
imageUrl = Bvpath & buildFolders
response.write " " & "" & objFile(lastFolder) if f.name<>"folder.gif" then response.write " (" & mid(f.size,1,2) & "K" & ")" end if response.write " | "
end if
end if
buildFolders = ""
'3 pictures in
| " response.write " |
| Browse Folders: |
"
'sub folders
Set sf = fldr.SubFolders
For Each f1 in sf
response.write" " & "" & f1.name & "" Next response.write " back" response.write " |