% Response.Buffer = true %>
![[ search ]](skinz/images<%=customcolours%>/t_search.gif) |
This is a browserable listing of the files on ..::LvL.
 |
folders and files |
| |
title/comments link |
| |
downloads and links |
| |
file size |
| |
file date |
 |
 |
<%
dim root_dir, current_path, old_path, au_link, fileplanet_link
current_path = Request.QueryString("path")
'do a quick secruity trap
current_path = replace(current_path,"..\","")
current_path = replace(current_path,"../","")
current_path = replace(current_path,"$","")
'cdrom_dir = "\\netapp1\ftp\cdrom\lvl\" on planetquake
'where are we looking for files again??
root_dir = cdrom_dir & current_path
'ok, now how do i get the file??
au_link = replace(au & current_path,"\","/")
fileplanet_link = replace(fileplanet & current_path,"\","/")
'as of 2-july-00
'gsn_link = replace(gsn & current_path,"\","/")
'lqex_link = replace(lqex & current_path,"\","/")
if root_dir <> cdrom_dir then
%>
 |
..<%=replace(current_path,"\","/")%> |
<%
end if
ShowFolderList(root_dir)
Response.Flush
ShowFilesList(root_dir)%>
<%
'listing the folders
Function ShowFolderList(folderspec)
dim fso, f, f1, fc, s, parent
set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(folderspec)
Set fc = f.SubFolders
For Each f1 in fc
%> |  |
"><%=f1.name%> |
| | | | | | | |
<%
Next
End Function
'listing the files
Function ShowFilesList(filespec)
dim fso, f, f1, fc, s, bgclr
'Response.Write(folderspec)
set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(filespec)
Set fc = f.Files
'start a counter so we can make the display look pretty
n = 1
For Each f1 in fc
if n mod 2 then
bgclr = " bgcolor=" & bgcolourCustom & ""
else
bgclr = ""
end if
%>>
 |
<%
if lcase(right(f1.name,4)) = ".txt" then
%>"><%=f1.name%> |
<%
else
%><%=f1.name%> | <%
end if
%> | <%
if lcase(right(f1.name,4)) = ".zip" then
'1st work out if is a zip file as there could be some strays
getmoreinfo(f1.name)
else
'must be a stray, so give them a link anyway
%> | |
<%
if lcase(right(f1.name,4)) = ".txt" then
%>">read me
<%
else
%>
">fileplanet |
">.au
<%
end if
end if
%> | | <%=FileSize(filespec & "\" & f1.name)%> | | <%=ShowFileAccessInfo(filespec & "\" & f1.name)%> |
<%
if n mod 5 = 0 then
Response.Flush
end if
n = n + 1
Next
End Function
function getmoreinfo(byval filename)
'used to return *extra* info about a file from the database
'Response.Write("a zip!")
'Response.Write("filename=[" & filename & "]")
'now find out if its in the data base!
set tigCON = Server.CreateObject("ADODB.Connection")
tigCON.Open(DSN)
' set up the query to list the news by date Desc
query = "SELECT q3a_download.num_dload AS num_dload, " & _
"q3a_download.level_id AS level_id, " & _
"q3a_levels.str_title AS title, " & _
"q3a_levels.str_author AS author " & _
"FROM q3a_download (nolock) LEFT OUTER JOIN " & _
"q3a_levels ON " & _
"q3a_download.level_id = q3a_levels.id " & _
"WHERE (q3a_levels.str_filename = '" & replace(lcase(filename),".zip","") & "')"
'Response.Write("Query = [" & query & "]
")
set tigRS = tigCON.Execute(query)
if (tigRS.EOF) then
%> |
">fileplanet | ">.au
<%
else
'ok, now we have a file thats in the database, so lets keep track
tmp_id = tigRS("level_id")
%><%=tigRS("title")%> |
|
" target="_blank">fileplanet |
" target="_blank">.au |
<%=tigRS("num_dload")%>
<%
end if
tigRS.close
tigCON.Close
end function
%> |