%
include("language.html")
function FormatFileSize(bytes)
if math.floor(bytes/1024) < 1 then
return bytes.." Bytes"
elseif math.floor(bytes/(1024*1024)) < 1 then
return string.format("%0.1f KB",bytes/1024 )
elseif math.floor(bytes/(1024*1024*1024)) < 1 then
return string.format("%0.1f MB",bytes/(1024*1024) )
else
return string.format("%0.1f GB",bytes/(1024*1024*1024) )
end
end
function urlencode_special(s)
s = s.gsub (s, "\n", "\r\n")
s = s.gsub (s, "([^%w ])",
function (c) return s.format ("%%%02X", s.byte(c)) end)
return s
end
local downloadurl = _GET["url"] or ""
downloadurl = specialhtml_encode(downloadurl)
local file_list = strContent
local files = Split(file_list, "\r\n")
local outputHTML = ""
local nCount = 0
local strColor = "#FFF"
if string.find(downloadurl,"&subfolder=") then
outputHTML = outputHTML.."
"
for _,filename in pairs(files) do
if filename ~= "" then
if nCount % 2 == 1 then
strColor = "#EEE"
else
strColor = "#FFF"
end
local arrValue = Split(filename, "||")
local filesize = 0
local filedate = ""
if arrValue ~= nil and table.maxn(arrValue) == 4 then
filename = arrValue[1]
filesize = arrValue[2]
filedate = arrValue[3]
isfolder = arrValue[4]
end
local ext = string.lower(string.sub(filename,-4))
if isfolder == "1" then
if string.find(downloadurl,"&subfolder=") then
outputHTML = outputHTML.." "..specialhtml_encode(filename).." | - | "..filedate.." | - |
"
else
outputHTML = outputHTML.." "..specialhtml_encode(filename).." | - | "..filedate.." | - |
"
end
else
if ext == ".mp4" or ext == ".mov" then
outputHTML = outputHTML..""..specialhtml_encode(filename).." "..LANG["video_preview"].." | "..FormatFileSize(filesize).." | "..filedate.." | "..LANG["button_downpicture"].." |
"
else
outputHTML = outputHTML..""..specialhtml_encode(filename).." | "..FormatFileSize(filesize).." | "..filedate.." | "..LANG["button_downpicture"].." |
"
end
end
nCount = nCount+1
end
end
outputHTML = outputHTML..""
if string.find(downloadurl,"?download&weblink=") then
%>