X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=scripts%2Fpage_email_form.ml;h=f3611354edbd2ba724c84281de916ca1a4ba9239;hb=cd059731a60fd3d4dcf426430ad26ff227b91910;hp=cb9188f613321daa08a07ec8b11ed3a4d6943229;hpb=50799fee9a4c3906fe0ab9988df83af2109fa269;p=cocanwiki.git diff --git a/scripts/page_email_form.ml b/scripts/page_email_form.ml index cb9188f..f361135 100644 --- a/scripts/page_email_form.ml +++ b/scripts/page_email_form.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: page_email_form.ml,v 1.2 2004/10/04 15:19:56 rich Exp $ + * $Id: page_email_form.ml,v 1.4 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 @@ -27,18 +27,17 @@ open Printf open Cocanwiki open Cocanwiki_template -let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ = +let run r (q : cgi) dbh hostid _ _ = let template = get_template dbh hostid "page_email_form.html" in let page = q#param "page" in template#set "page" page; (* Get the page title. *) - let sth = dbh#prepare_cached "select title from pages - where hostid = ? and url = ?" in - sth#execute [`Int hostid; `String page]; - - let title = sth#fetch1string () in + let title = List.hd ( + PGSQL(dbh) "select title from pages + where hostid = $hostid and url = $page" + ) in template#set "title" title; q#template template