X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=scripts%2Fmailing_list_view.ml;h=e8750e151cffd9bb3386ec61dc3e76cfe08d8eaf;hb=eeb304015c65ccf593a77058d5db5f5a3e3b45d5;hp=1df4b0f9f0c360522f27c19b8cc7008f4a08c305;hpb=d5e16b1ffdc77f6212666db32314b5b5f4f457a2;p=cocanwiki.git diff --git a/scripts/mailing_list_view.ml b/scripts/mailing_list_view.ml index 1df4b0f..e8750e1 100644 --- a/scripts/mailing_list_view.ml +++ b/scripts/mailing_list_view.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: mailing_list_view.ml,v 1.1 2004/09/24 17:07:10 rich Exp $ + * $Id: mailing_list_view.ml,v 1.2 2004/09/24 17:11:57 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 @@ -40,16 +40,19 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ = else "text/html", template in (* Get the mailing list. *) - let sth = dbh#prepare_cached "select email, entry_date from mailing_lists + let sth = dbh#prepare_cached "select email, name, entry_date + from mailing_lists where hostid = ? and pending is null order by 1" in sth#execute [`Int hostid]; - let table = sth#map (function [`String email; `Date entry_date] -> - let entry_date = printable_date' entry_date in - [ "email", Template.VarString email; - "entry_date", Template.VarString entry_date ] - | _ -> assert false) in + let table = + sth#map (function [`String email; `String name; `Date entry_date] -> + let entry_date = printable_date' entry_date in + [ "email", Template.VarString email; + "name", Template.VarString name; + "entry_date", Template.VarString entry_date ] + | _ -> assert false) in template#table "emails" table;