Change subject line so it shows the name of the site.
[cocanwiki.git] / scripts / images.ml
index a9d43b5..b11dafd 100644 (file)
@@ -1,7 +1,7 @@
 (* COCANWIKI - a wiki written in Objective CAML.
  * Written by Richard W.M. Jones <rich@merjis.com>.
  * Copyright (C) 2004 Merjis Ltd.
- * $Id: images.ml,v 1.9 2006/03/28 13:20:00 rich Exp $
+ * $Id: images.ml,v 1.10 2006/03/28 16:24:07 rich Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -50,26 +50,26 @@ let run r (q : cgi) dbh hostid _ _ =
       order by 2, 3" in
 
   let table =
-    sth#map
+    List.map
       (fun row ->
         let id, name, width, height, alt, size, tn_width, tn_height,
           is_deleted, has_thumbnail =
           match row with
-            | [id, Some name, None, width, height,
-               alt, Some size, tn_width, tn_height] ->
+            | (id, Some name, None, width, height,
+               alt, Some size, Some tn_width, Some tn_height) ->
                 id, name, width, height, alt, size, tn_width, tn_height,
                 false, true
-            | [id, None, Some name, width, height,
-               alt, Some size, tn_width, tn_height] ->
+            | (id, None, Some name, width, height,
+               alt, Some size, Some tn_width, Some tn_height) ->
                 id, name, width, height, alt, size, tn_width, tn_height,
                 true, true
-            | [id, Some name, None, width, height,
-               alt, Some size, None, None] ->
-                id, name, width, height, alt, size, 0, 0,
+            | (id, Some name, None, width, height,
+               alt, Some size, None, None) ->
+                id, name, width, height, alt, size, 0l, 0l,
                 false, false
-            | [id, None, Some name, width, height,
-               alt, Some size, None, None] ->
-                id, name, width, height, alt, size, 0, 0,
+            | (id, None, Some name, width, height,
+               alt, Some size, None, None) ->
+                id, name, width, height, alt, size, 0l, 0l,
                 true, false
             | _ -> assert false in
         let size = Int32.to_int size in
@@ -82,7 +82,8 @@ let run r (q : cgi) dbh hostid _ _ =
           "tn_width", Template.VarString (Int32.to_string tn_width);
           "tn_height", Template.VarString (Int32.to_string tn_height);
           "is_deleted", Template.VarConditional is_deleted;
-          "has_thumbnail", Template.VarConditional has_thumbnail ]) in
+          "has_thumbnail", Template.VarConditional has_thumbnail ]
+      ) rows in
 
   template#table "images" table;