structure NM = BinaryMapFn(IntKey)
-val outputDir = "/home/hcoop/public_html/dyn/"
+val outputDir = "/home/hcoop/new-hcoop-website/"
fun generate () =
let
end
fun header (outf, title) =
- procOutput (outf, ("/usr/local/bin/hcoop_header", [title]))
+ (TextIO.output (outf, "<!--#include file=\"header.html\" -->\n<div id=\"main\">");
+ TextIO.output (outf, "<h2>" ^ title ^ "</h2>\n"))
- fun footer outf =
- procOutput (outf, ("/usr/local/bin/hcoop_footer", []))
+ fun footer outf = TextIO.output (outf, "</div>\n<!--#include file=\"footer.html\" -->\n");
fun genMemberList () =
let
- val outf = TextIO.openOut (outputDir ^ "members.html")
+ val outf = TextIO.openOut (outputDir ^ "members.shtml")
fun printOne ([name, rname, usr], (total, anon)) =
let
if not isAnon then
(TextIO.output (outf, "<tr> <td><a href=\"member/");
TextIO.output (outf, name);
- TextIO.output (outf, ".html\">");
+ TextIO.output (outf, ".shtml\">");
TextIO.output (outf, name);
TextIO.output (outf, "</a></td> <td>");
TextIO.output (outf, rname);
()
else
let
- val outf = TextIO.openOut (String.concat [outputDir, "member/", name, ".html"])
+ val outf = TextIO.openOut (String.concat [outputDir, "member/", name, ".shtml"])
- val _ = header (outf, "HCoop member: " ^ name)
+ val _ = header (outf, "HCoop Member: " ^ name)
+ val _ = TextIO.output (outf, "<p><a href=\"/members.shtml\">Return to members directory</a></p>\n\n");
val _ = TextIO.output (outf, "<table>\n<tr> <td align=\"right\"><b>Member</b>:</td> <td>")
val _ = TextIO.output (outf, name)
val _ = TextIO.output (outf, "</td> </tr>\n<tr> <td align=\"right\"><b>Name</b>:</td> <td>")
val _ = TextIO.output (outf, rname)
val _ = TextIO.output (outf, "</td> </tr>\n<tr> <td align=\"right\"><b>Joined</b>:</td> <td>")
val _ = TextIO.output (outf, Date.toString (Date.fromTimeLocal joined))
+ val _ = TextIO.output (outf, "</td></tr>\n\n");
fun doLocation [id] = C.intFromSql id
| doLocation _ = raise Fail "Bad location row"
val _ = case locations of
[] => ()
| _ =>
- (TextIO.output (outf, "<tr> </tr>\n\n<tr> <td align=\"right\"><b>Locations</b>:</td> <td>");
+ (TextIO.output (outf, "<tr> <td align=\"right\"><b>Locations</b>:</td> <td>");
app appLocation locations;
TextIO.output (outf, "</td> </tr>\n"))
val _ = case links of
[] => ()
| _ =>
- (TextIO.output (outf, "<tr> </tr>\n\n<tr> <td><b>Hosted sites</b></td> </tr>\n");
+ (TextIO.output (outf, "<tr> <td><b>Hosted sites</b></td> </tr>\n");
app appLink links)
fun doContact [v, name, url, urlPrefix, urlPostfix] =
val _ = case contacts of
[] => ()
| _ =>
- (TextIO.output (outf, "<tr> </tr>\n\n<tr> <td><b>Contact information</b></td> </tr>\n");
+ (TextIO.output (outf, "<tr> <td><b>Contact information</b></td> </tr>\n");
app appContact contacts)
in
TextIO.output (outf, "</table>\n");
end
| doOne _ = raise Fail "Bad member row"
in
- ignore (OS.Process.system ("/bin/rm " ^ outputDir ^ "member/*.html"));
+ ignore (OS.Process.system ("/bin/rm " ^ outputDir ^ "member/*.shtml"));
C.app db doOne "SELECT id, name, rname, joined, usr FROM WebUserPaying LEFT OUTER JOIN DirectoryPref ON usr = id"
end
let
val outf = TextIO.openOut (outputDir ^ "sites.html")
- val _ = header (outf, "HCoop: Hosted sites")
+ (* val _ = header (outf, "HCoop: Hosted sites") *)
fun doLink [url, title, descr, name] = (C.stringFromSql url, C.stringFromSql title, C.stringFromSql descr, C.stringFromSql name)
| doLink _ = raise Fail "Bad link' row"
" ORDER BY title"])
fun appLink (url, title, descr, name) =
- (TextIO.output (outf, "<tr> <td><b><a href=\"");
+ (TextIO.output (outf, "<tr> <td><a href=\"");
TextIO.output (outf, Web.html url);
TextIO.output (outf, "\">");
TextIO.output (outf, Web.html title);
- TextIO.output (outf, "</a></b></td> <td>");
+ TextIO.output (outf, "</a></td> <td>");
TextIO.output (outf, Web.html descr);
TextIO.output (outf, "</td> <td><a href=\"member/");
TextIO.output (outf, name);
- TextIO.output (outf, ".html\">");
+ TextIO.output (outf, ".shtml\">");
TextIO.output (outf, name);
TextIO.output (outf, "</a></td> </tr>\n"))
in
- TextIO.output (outf, "<table>\n");
+ (* TextIO.output (outf, "<table>\n"); *)
app appLink links;
- footer outf;
+ (* footer outf; *)
TextIO.closeOut outf
end
in