X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=scripts%2Fcocanwiki_links.ml;h=cd3b13f965a2e74184693d3c1c87a1ee104eece3;hb=aec0096a00df1b58b7a057618ad9f3baab7c846c;hp=99ee98736c9cbcc770b91e78b52f1ca61be22786;hpb=f249bda689881753ba729e48cce6ddf84ffeb3c2;p=cocanwiki.git diff --git a/scripts/cocanwiki_links.ml b/scripts/cocanwiki_links.ml index 99ee987..cd3b13f 100644 --- a/scripts/cocanwiki_links.ml +++ b/scripts/cocanwiki_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: cocanwiki_links.ml,v 1.4 2004/10/10 14:44:50 rich Exp $ + * $Id: cocanwiki_links.ml,v 1.5 2004/10/10 16:14:43 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 @@ -162,12 +162,13 @@ let what_links_here (dbh : Dbi.connection) hostid page = let qs = Dbi.placeholders (List.length urls) in let sth = dbh#prepare_cached - ("select li.from_url, p.title + ("select li.from_url, p.title, li.from_url = 'index' from links li, pages p where li.hostid = ? and li.to_url in " ^ qs ^ " - and li.hostid = p.hostid and li.from_url = p.url") in + and li.hostid = p.hostid and li.from_url = p.url + order by 3 desc, 2, 1") in sth#execute (`Int hostid :: (List.map (fun s -> `String s) urls)); sth#map (function - | [`String url; `String title] -> url, title + | [`String url; `String title; _] -> url, title | _ -> assert false)