<% Dim iTr, objFSO, objFiles, objFolders, strPath, maxColumns, subFolder, containedFile, strPhysicalPath Dim i, maxUpload:maxUpload = 10 Dim deletefile Dim delfile:delfile = request.querystring("delfile")&"" Dim delType:delType = request.querystring("deltype")&"" Dim subFoldersCount, subFilesCount Dim iFileCount Dim avatarPath Dim defaultFolderObj Dim totalSizeInFolder:totalSizeInFolder = 0 'response.write delfile 'response.end if len(delfile)<>0 then set objFSO = Server.CreateObject("Scripting.FileSystemObject") with objFSO deletefile = server.mappath(delfile) if delType = "f" then if .folderexists(deletefile) then .DeleteFolder deletefile, true else if .fileexists(deletefile) then .DeleteFile deletefile, true end if end with set objFSO = nothing avatarPath = delfile end if Dim createFolder:createFolder = request.querystring("createFolder")&"" Dim folderSpec if len(createFolder)<>0 then set objFSO = Server.CreateObject("Scripting.FileSystemObject") with objFSO folderSpec = server.mappath(createFolder) if not .folderexists(folderSpec) then .CreateFolder folderSpec end with set objFSO = nothing avatarPath = createFolder 'to read the content end if %> Smiley/Avatar Upload and Management <%= OutputCSS() %>
Smiley/Avatar Upload and Management:       Help

<% strPhysicalPath = server.mappath("upfiles/smiley/") set objFSO = Server.CreateObject("Scripting.FileSystemObject") set defaultFolderObj = objFSO.GetFolder(strPhysicalPath) set objFiles = defaultFolderObj.files totalSizeInFolder = defaultFolderObj.size subFilesCount = objFiles.count set defaultFolderObj = nothing set objFSO = nothing maxColumns = 5 iTr = 1 %>
<% iFileCount = 0 for each containedFile in objFiles if iTr = 1 then response.write ("") response.write ("") if iTr < maxColumns then iTr = iTr +1 else iTr = 1 response.write (""&vbcrlf) end if iFileCount = iFileCount + 1 next Set objFiles = nothing if iTr <> 1 then response.write ("") end if %>
Existing Smileys
class="cat" colspan="<%= maxColumns %>"> Click on smileys to delete.
"&_ ""&_ "
class="cat" colspan="<%= maxColumns %>"> Total Size: <%= FormatNumber(totalSizeInFolder/1024,2,-1,-1,-1) %> KB
Smiley Upload
class="cat"> Select Smileys from your hard drive and upload:
> <% for i=1 to maxUpload %> <% next %>

You can only upload 200KB of smileys at once.

<% strPath = request.queryString("d") if instr(avatarPath,"avatars/") then strPath = processAvatars(avatarPath) strPath = replace(replace(strPath,"{",""),"}","") strPhysicalPath = server.mappath("avatars/"&strPath) set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set defaultFolderObj = objFSO.GetFolder(strPhysicalPath) set objFolders = defaultFolderObj.subFolders set objFiles = defaultFolderObj.files subFilesCount = objFiles.count subFoldersCount = objFolders.count totalSizeInFolder = defaultFolderObj.size set defaultFolderObj = nothing set objFSO = nothing if strPath <>"" then strPath = strPath &"/" maxColumns = 3 iTr = 1 %> <% if strPath <> "" then %> <% Dim upStrPath, leftAmount upStrPath = strPath upStrPath = left(upStrPath,len(upStrPath)-1) leftAmount = instrRev(upStrPath,"/") if leftAmount <> 0 then leftAmount = leftAmount - 1 else leftAmount = 0 end if Dim doUpFolder:doUpFolder = 1 %> <% end if %>
<% iFileCount = 0 Dim subFilesAndFoldersCount:subFilesAndFoldersCount = subFilesCount+subFoldersCount for each subFolder in objFolders if left(subFolder.Name,1) <> "_" then if iTr = 1 then response.write ("") if doUpFolder = 1 then call upOneLevel(1) iTr = iTr + 1 doUpFolder = 0 end if response.write ("") if iTr < maxColumns then iTr = iTr +1 else iTr = 1 response.write (""&vbcrlf) end if iFileCount = iFileCount+1 else subFilesAndFoldersCount = subFilesAndFoldersCount - 1 end if next if subFilesAndFoldersCount = 0 and strPath <>"" then response.write ("") call upOneLevel(maxColumns) response.write ("") end if for each containedFile in objFiles if iTr = 1 then response.write ("") if doUpFolder = 1 then call upOneLevel(1) iTr = iTr + 1 doUpFolder = 0 end if response.write ("") if iTr < maxColumns then iTr = iTr +1 else iTr = 1 response.write (""&vbcrlf) end if iFileCount = iFileCount+1 next if iTr <> 1 then response.write ("") end if Set objFiles = nothing Set objFolders = nothing %>
Existing Avatars
class="cat" colspan="<%= maxColumns %>"> Click on Avatars to delete.
"&_ ""&_ "
"&subFolder.Name&"
"&_ ""&_ "
"&_ "
class="cat" colspan="<%= maxColumns %>"> Total Size: <%= FormatNumber(totalSizeInFolder/1024,2,-1,-1,-1) %> KB
Avatar Upload
class="cat"> Select avatars from your hard drive and upload:
> <% for i=1 to maxUpload %> <% next %>

You can only upload 200KB of avatars at once.

Create a folder
class="cat"> Create a folder in the current directory:
>