<%
if Request("TYPE") = "" then
rType = 1
else
rType = CInt(Request("TYPE"))
end if
if Request("img") = "" then
rImg = ""
else
rImg = Request("img")
end if
if rImg <> "" and rType = 2 then
bolListAll = False
Response.Write "
"
else
bolListAll = True
end if
Response.write returnImageName(Request("DIR"),rType,rImg,bolListAll)
%>
<%
Function returnImageName(sDir, intType, imgName, listAll)
Dim fso
Dim fol
Dim sFile
Dim objFiles
Dim sSize
If intType = 1 Then
sSize = "small"
Else
sSize = "big"
End If
Set fso = Server.CreateObject("Scripting.FileSystemObject")
strPath = Server.MapPath("images") & "\" & sDir & "\" & sSize & "\"
Set fol = fso.GetFolder(strPath)
Set objFiles = fol.Files
intCount = 1
For Each Item In objFiles
sFile = Item
sRoot = rootName(sFile)
If imgName <> "" Then
If imgName = sRoot Then
If listAll = False Then
returnImageName = ""
Else
returnImageName = ""
End If
Exit Function
End If
Else
If listAll = False Then
Response.Write sDir & "\" & flipME(sSize) & "\" & sRoot
Else
Response.Write " "
if (intCount mod 6 ) + 1 = 6 then
Response.Write "
"
end if
End If
End If
intCount = intCount + 1
Next
Set objFiles = Nothing
Set fol = Nothing
Set fso = Nothing
End Function
Function flipME(strSize)
If strSize = "small" Then
flipME = "big"
Else
flipME = "small"
End If
End Function
Function rootName(sName)
Dim tStr
tStr = sName
Do
tStr = Mid(tStr, InStr(tStr, "\") + 1)
Loop Until InStr(tStr, "\") = 0
rootName = tStr
End Function
%>