client
Topic(ref, list[])
..()
switch(list["action"])
if("download_file")
var/f = list["file"]
src<<ftp(Default_Dir+"/"+f, "[f]")
return
if("display_file")
var/f = list["file"]
var/S = Default_Dir+"\\"+f
alert(src, "This : [S]")
mob.ViewFile(S)
proc
CreateViewTopic(File, Name)
if(!Name) Name = "View [File]"
return "<a href='?action=display_file;file=[File]'>[Name]</a>"
mob
proc
ViewFile(f)
f = file(f)
if(!isfile(f)) {src<<browse("Could Not Display Preview Of File");ViewBrowser();return}
if(isicon(f))//if this failed
var/F = fcopy_rsc(f)
winset(src, "display.display", "image=\ref[F]")
ShowIDisplay()
if(!isicon(f))//this will obviously work, its the same as else XD
var/F = file2text(f)//<--
src<<output(null, "display2.text")
src<<output(html_encode(F), "display2.text")
ShowTDisplay()
else
src<<browse("Failed To Read...")
Problem description:
Well, trying to make it so you can get a preview of your files but for some reason or another after clicking the view topic it isn't showing the preview...I'm pretty sure because its not getting the file as an argument, maybe it just doesn't see it as an icon, it works for text but that's about it.