%' Now to the Runtime code:
Dim strPath 'Path of directory to show
Dim objFSO 'FileSystemObject variable
Dim objFolder 'Folder variable
Dim objItem 'Variable used to loop through the contents of the folder
' NOTE: As currently implemented, this needs to end with the /
%>
<% if session ("sessvar") <> 1 then
response.redirect ("./includes/config.asp")
end if
%>
<%
dim ActDir,MyFile
MyFile=Split(Request.ServerVariables("PATH_INFO"),"/")
galname=MyFile(UBound(MyFile)-1)
ActDir= "/" & galname & "/"
strPath = ActDir
' Create our FSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
' Get a handle on our folder
Set objFolder = objFSO.GetFolder(Server.MapPath(strPath))
' Show a little description line and the title row of our table
%>
<% =title %>
<% ' Album - Index main %>
<%
' First I deal with any subdirectories. I just display them and when you
' click you go to them via plain HTTP. You might want to loop them back
' through this file once you've set it up to take a path as input. It seems
' like the logical thing to do to me at least!
For Each objItem In objFolder.SubFolders
' Deal with the stupid VTI's that keep giving our visitors 404's
If InStr(1, objItem, "_hidden_", 1) = 0 and InStr(1, objItem, "includes", 1) = 0 and InStr(1, objItem, "_vti", 1) = 0Then
%>