Change subject line so it shows the name of the site.
[cocanwiki.git] / scripts / links.ml
index eeb2804..953ad42 100644 (file)
@@ -1,7 +1,7 @@
 (* COCANWIKI - a wiki written in Objective CAML.
  * Written by Richard W.M. Jones <rich@merjis.com>.
  * Copyright (C) 2004 Merjis Ltd.
- * $Id: links.ml,v 1.4 2006/03/28 13:20:00 rich Exp $
+ * $Id: links.ml,v 1.5 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
@@ -64,7 +64,7 @@ let run r (q : cgi) dbh hostid _ _ =
 
        q#header ~content_type:"text/plain" ();
 
-       List.iter (fun url -> ignore (print_endline r url))
+       List.iter (fun url -> ignore (print_endline r url)) rows
 
       ) else
        failwith "'type' parameter should be 'inbound' or 'outbound'"
@@ -103,18 +103,18 @@ let run r (q : cgi) dbh hostid _ _ =
     let rows = PGSQL(dbh) "select from_url, to_url from links
                             where hostid = $hostid" in
 
-    sth#iter (fun (from_url, to_url) ->
-               add_link from_url to_url) rows;
+    List.iter (fun (from_url, to_url) ->
+                add_link from_url to_url) rows;
 
     (* Don't forget redirects!  They're kinda like links ... *)
     let rows = PGSQL(dbh) "select url, redirect from pages
                             where hostid = $hostid and url is not null
                               and redirect is not null" in
 
-    sth#iter (function
-             | (url, Some redirect) -> add_link url redirect
-             | (_, None) -> ()
-            ) rows;
+    List.iter (function
+              | (Some url, Some redirect) -> add_link url redirect
+              | _ -> ()
+             ) rows;
 
     let keys h = Hashtbl.fold (fun key _ xs -> key :: xs) h [] in