View/Edit #733:do_www_setup

Switch to edit mode.

Name(s): do_www_setup
1:  caller == this || raise(E_PERM)
2:  pass(@args)
3:  if ($www:parse_GET("slideshowsetup"))
4:    this.toollocation = $www:parse_GET("location")
5:    this.show_watch = !!$www:parse_GET("watch")
6:    this.show_surf = !!$www:parse_GET("surf")
7:    player:tell("<B>Options changed.</B>")
8:  elseif (filenames = $www:parse_POST("urls"))
9:    urls = pages = {}
10:   for filename in ({@filenames})
11:     if (!(filename = $su:trim(filename)))
12:       continue
13:     endif
14:     suspend(0)
15:     if (match(filename, ".%.%(gif%|jpg%|jpeg%)$"))
16:       player:tell("Confirming existance of \"", filename, "\"...")
17:       file = `$network:confirm_URL(filename) ! ANY'
18:       if (file)
19:         player:tell("OK.<BR>")
20:         urls = {@urls, filename}
21:         pages = {@pages, strsub(this.image_template, "*URL*", filename)}
22:       elseif (file == 0)
23:         player:tell("<BR>WARNING! Can't find \"", filename, "\".  Skipping this slide.<BR>")
24:       else
25:         player:tell("<BR>ERROR! Something evil (", file, ") happened while trying to confirm the existance of <A HREF=\"", filename, "\">", filename, "</A>.  Skipping this slide. Complain!<BR>")
26:       endif
27:       "elseif (!match(filename, \".%.%(htm%|html%)$\"))"
28:       "  player:tell(\"WARNING! \\\"\", filename, \"\\\" doesn't look like an HTML, a GIF, or a JPEG.  Skipping this slide.<BR>\")"
29:     else
30:       player:tell("Loading \"", filename, "\"...")
31:       file = `$network:get_URL(filename) ! ANY'
32:       if (file)
33:         if (index(file[1], "HTTP") == 1 && "" in file)
34:           file = file[("" in file) + 1..$]
35:         endif
36:         player:tell("OK.<BR>")
37:         urls = {@urls, filename}
38:         pages = {@pages, file}
39:       elseif (file == 0)
40:         player:tell("<BR>WARNING! Can't find \"", filename, "\".  Skipping this slide.<BR>")
41:       else
42:         player:tell("<BR>ERROR! Something evil (", file, ") happened while trying to read <A HREF=\"", filename, "\">", filename, "</A>.  Skipping this slide. Complain!<BR>")
43:       endif
44:     endif
45:   endfor
46:   this.slide_URLs = urls
47:   this.slide_pages = pages
48: endif
49: "Last modified by Dax (#789) on Wed Jul 22 21:11:49 1998 EDT."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Dax (#789)

You are not logged in.

[home | help | who | search | setup | code]