{% local obj, files, owner if DB.isobjhexvalid(request:path():sub(7, 7 + 31)) then obj = DB.getobj(DB.objshowid(request:path():sub(7, 7 + 31))) end if obj then local virt = "/objd/" .. DB.objhideid(obj.id) .. "/" local phys = DB.urltophysical(virt) files = {} for f in LFS.dir(phys) do if f ~= "." and f ~= ".." then local attribs = LFS.attributes(phys .. f) table.insert(files, {name = f, size = attribs.size, modtime = attribs.modification, phys = phys .. f, virt = virt .. f}) end end table.sort(files, function(a,b) if a.modtime == b.modtime then return a.name < b.name else return a.modtime < b.modtime end end) if verified and request:post() and request:post().csrf and DB.csrfverify(verified.id, Escapes.urlunescape(request:post().csrf)) then if request:post().comment then DB.postcomment(obj.id, verified.id, Escapes.urlspunescape(request:post().comment)) end end owner = DB.getuserbyid(obj.owner) end title = BigGlobe.cfg.sitename .. " - " .. (obj and obj.name or "Object not found") %} {% function content() %} {% if obj then %}
Object has {{#files-1}} files:
Object was not found.
{% end %} {% end %} {# base.inc
{{ Escapes.htmlescape(c.authordisplayname) }} {{ c.createtime }}
{{ Escapes.htmlescape(c.content):gsub("\n\n", "
") }}