(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* 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
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
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);