X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=scripts%2Frebuild_links.ml;h=91d206e21561596a00d0213db7419158cd37895e;hb=4bc6c4992dbf48fce59efc39cd31f97f03291383;hp=df3a707bd01d92f7f21b8afc2b83dcce8def4383;hpb=eeb304015c65ccf593a77058d5db5f5a3e3b45d5;p=cocanwiki.git diff --git a/scripts/rebuild_links.ml b/scripts/rebuild_links.ml index df3a707..91d206e 100644 --- a/scripts/rebuild_links.ml +++ b/scripts/rebuild_links.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: rebuild_links.ml,v 1.1 2004/09/28 10:56:40 rich Exp $ + * $Id: rebuild_links.ml,v 1.2 2004/09/28 11:28:39 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 @@ -63,14 +63,6 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ = q#header (); print_string r template_start#to_string; - let insert_link = - let sth = - dbh#prepare_cached "insert into links (hostid, from_url, to_url) - values (?, ?, ?)" in - fun from_url to_url -> - sth#execute [`Int hostid; `String from_url; `String to_url] - in - (* Process each section ... *) let i = ref 0 in @@ -83,7 +75,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ = print_string r template#to_string; let links = get_links_from_section dbh hostid content in - List.iter (insert_link url) links + List.iter (insert_link dbh hostid url) links | _ -> assert false);