(* 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
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
"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;