X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=scripts%2Frebuild_links.ml;h=354776a8d43d1ef2f5d2693e8cf05a63aa971337;hb=6ad484dd47c27fd54c2f26fb931ba125bae9abc6;hp=df3a707bd01d92f7f21b8afc2b83dcce8def4383;hpb=eeb304015c65ccf593a77058d5db5f5a3e3b45d5;p=cocanwiki.git diff --git a/scripts/rebuild_links.ml b/scripts/rebuild_links.ml index df3a707..354776a 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.3 2004/10/23 12:00:24 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,14 +75,14 @@ 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); (* Finish off. *) dbh#commit (); - print_string r template_done#to_string + ignore (print_string r template_done#to_string) let () = register_script ~restrict:[CanManageSite] run