able to check that these actually work yet however.
scripts/forgot_password.ml
scripts/forgot_password_form.ml
scripts/history.ml
+scripts/history_rss.ml
scripts/host_menu.ml
scripts/hoststyle.ml
scripts/image.ml
scripts/page_email_form.ml
scripts/page_email_send.ml
scripts/page_email_unsubscribe.ml
+scripts/page_rss.ml
scripts/pagestyle.ml
scripts/preview.ml
scripts/rebuild_links.ml
scripts/recent.ml
+scripts/recent_rss.ml
scripts/recently_visited.ml
scripts/restore.ml
scripts/restore_form.ml
-scripts/rss.ml
scripts/search.ml
scripts/send_feedback.ml
scripts/send_feedback_form.ml
templates/footer.html
templates/forgot_password_form.html
templates/history.html
+templates/history_rss.xml
templates/host_menu.html
templates/images.html
templates/invite_user.txt
templates/page_404.html
templates/page_email_form.html
templates/page_email_send.txt
+templates/page_rss.xml
templates/rebuild_links.html
templates/rebuild_links_done.html
templates/rebuild_links_start.html
templates/recent.html
+templates/recent_rss.xml
templates/recently_visited.html
templates/restore_form.html
-templates/rss.xml
templates/send_feedback.txt
templates/send_feedback_form.html
templates/set_password_form.html
# Apache configuration for COCANWIKI.
-# $Id: cocanwiki.conf,v 1.17 2004/10/27 21:14:05 rich Exp $
+# $Id: cocanwiki.conf,v 1.18 2004/11/01 17:46:21 rich Exp $
# Uncomment the following lines if necessary. You will probably need
# to adjust the paths to reflect where cocanwiki is really installed.
RewriteRule ^/_pe_confirm$ /_bin/page_email_confirm.cmo [PT,L,QSA]
RewriteRule ^/_pe_unsub$ /_bin/page_email_unsubscribe.cmo [PT,L,QSA]
RewriteRule ^/_recent$ /_bin/recent.cmo [PT,L,QSA]
+RewriteRule ^/_recent.rss$ /_bin/recent_rss.cmo [PT,L,QSA]
RewriteRule ^/_sitemap$ /_bin/sitemap.cmo [PT,L,QSA]
RewriteRule ^/_userprefs$ /_bin/user_prefs_form.cmo [PT,L,QSA]
RewriteRule ^/_users$ /_bin/users.cmo [PT,L,QSA]
RewriteRule ^/([^_].*)/editcss$ /_bin/edit_page_css_form.cmo?page=$1 [PT,L,QSA]
RewriteRule ^/([^_].*)/edittitle$ /_bin/edit_page_title_form.cmo?page=$1 [PT,L,QSA]
RewriteRule ^/([^_].*)/history$ /_bin/history.cmo?page=$1 [PT,L,QSA]
-RewriteRule ^/([^_].*)/index.rss$ /_bin/rss.cmo?page=$1 [PT,L,QSA]
+RewriteRule ^/([^_].*)/history.rss$ /_bin/history_rss.cmo?page=$1 [PT,L,QSA]
+RewriteRule ^/([^_].*)/index.rss$ /_bin/page_rss.cmo?page=$1 [PT,L,QSA]
RewriteRule ^/([^_].*)/links$ /_bin/links.cmo?page=$1 [PT,L,QSA]
RewriteRule ^/([^_].*)/source$ /_bin/source.cmo?page=$1 [PT,L,QSA]
RewriteRule ^/([^_].*)/stats$ /_bin/stats.cmo?page=$1 [PT,L,QSA]
lib/cocanwiki_template.cmi
history.cmx: lib/cocanwiki.cmx lib/cocanwiki_date.cmx \
lib/cocanwiki_template.cmx
+history_rss.cmo: lib/cocanwiki.cmo lib/cocanwiki_date.cmo \
+ lib/cocanwiki_template.cmi
+history_rss.cmx: lib/cocanwiki.cmx lib/cocanwiki_date.cmx \
+ lib/cocanwiki_template.cmx
host_menu.cmo: lib/cocanwiki.cmo lib/cocanwiki_template.cmi
host_menu.cmx: lib/cocanwiki.cmx lib/cocanwiki_template.cmx
hoststyle.cmo: lib/cocanwiki.cmo lib/cocanwiki_template.cmi
lib/cocanwiki_strings.cmx lib/cocanwiki_template.cmx
page_email_unsubscribe.cmo: lib/cocanwiki.cmo lib/cocanwiki_ok.cmo
page_email_unsubscribe.cmx: lib/cocanwiki.cmx lib/cocanwiki_ok.cmx
+page_rss.cmo: lib/cocanwiki.cmo lib/cocanwiki_template.cmi lib/wikilib.cmi
+page_rss.cmx: lib/cocanwiki.cmx lib/cocanwiki_template.cmx lib/wikilib.cmx
pagestyle.cmo: lib/cocanwiki.cmo
pagestyle.cmx: lib/cocanwiki.cmx
preview.cmo: lib/cocanwiki.cmo lib/wikilib.cmi
lib/cocanwiki_template.cmi
recent.cmx: lib/cocanwiki.cmx lib/cocanwiki_date.cmx \
lib/cocanwiki_template.cmx
+recent_rss.cmo: lib/cocanwiki.cmo lib/cocanwiki_date.cmo \
+ lib/cocanwiki_template.cmi
+recent_rss.cmx: lib/cocanwiki.cmx lib/cocanwiki_date.cmx \
+ lib/cocanwiki_template.cmx
recently_visited.cmo: lib/cocanwiki.cmo lib/cocanwiki_template.cmi
recently_visited.cmx: lib/cocanwiki.cmx lib/cocanwiki_template.cmx
restore.cmo: lib/cocanwiki.cmo lib/cocanwiki_diff.cmi \
lib/cocanwiki_ok.cmo lib/cocanwiki_template.cmi
restore_form.cmx: lib/cocanwiki.cmx lib/cocanwiki_diff.cmx \
lib/cocanwiki_ok.cmx lib/cocanwiki_template.cmx
-rss.cmo: lib/cocanwiki.cmo lib/cocanwiki_template.cmi lib/wikilib.cmi
-rss.cmx: lib/cocanwiki.cmx lib/cocanwiki_template.cmx lib/wikilib.cmx
search.cmo: lib/cocanwiki.cmo
search.cmx: lib/cocanwiki.cmx
send_feedback.cmo: lib/cocanwiki.cmo lib/cocanwiki_ok.cmo \
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: history.ml,v 1.8 2004/09/21 13:01:16 rich Exp $
+ * $Id: history.ml,v 1.9 2004/11/01 17:46:21 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
let page = q#param "page" in
let page = if page = "" then "index" else page in
+ template#set "page" page;
let sth =
dbh#prepare_cached
--- /dev/null
+(* COCANWIKI - a wiki written in Objective CAML.
+ * Written by Richard W.M. Jones <rich@merjis.com>.
+ * Copyright (C) 2004 Merjis Ltd.
+ * $Id: history_rss.ml,v 1.1 2004/11/01 17:46:21 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *)
+
+open Apache
+open Registry
+open Cgi
+open Printf
+
+open Cocanwiki
+open Cocanwiki_template
+open Cocanwiki_date
+
+let run r (q : cgi) (dbh : Dbi.connection) hostid {hostname = hostname} _ =
+ let template = get_template dbh hostid "history_rss.xml" in
+
+ let page = q#param "page" in
+ let page = if page = "" then "index" else page in
+ template#set "page" page;
+
+ template#set "hostname" hostname;
+
+ let sth =
+ dbh#prepare_cached
+ "select p.id, p.url, p.url_deleted, p.title, p.last_modified_date,
+ p.logged_ip, u.name
+ from pages p left outer join users u on p.logged_user = u.id
+ where p.hostid = ? and (p.url = ? or p.url_deleted = ?)
+ order by p.last_modified_date desc" in
+ sth#execute [`Int hostid; `String page; `String page];
+
+ let table =
+ sth#map
+ (function
+ | [`Int version; `String url; _; `String title;
+ `Timestamp last_modified_date; logged_ip; logged_user ] ->
+ let date = printable_date_time last_modified_date in
+ let has_logged_ip, logged_ip =
+ match logged_ip with
+ `Null -> false, ""
+ | `String ip -> true, ip
+ | _ -> assert false in
+ let has_logged_user, logged_user =
+ match logged_user with
+ `Null -> false, ""
+ | `String name -> true, name
+ | _ -> assert false in
+ [ "version", Template.VarString (string_of_int version);
+ "url", Template.VarString url;
+ "title", Template.VarString title;
+ "last_modified_date", Template.VarString date;
+ "has_logged_ip", Template.VarConditional has_logged_ip;
+ "logged_ip", Template.VarString logged_ip;
+ "has_logged_user", Template.VarConditional has_logged_user;
+ "logged_user", Template.VarString logged_user;
+ "is_live", Template.VarConditional true ]
+ | [`Int version; `Null; `String url; `String title;
+ `Timestamp last_modified_date; logged_ip; logged_user ] ->
+ let date = printable_date_time last_modified_date in
+ let has_logged_ip, logged_ip =
+ match logged_ip with
+ `Null -> false, ""
+ | `String ip -> true, ip
+ | _ -> assert false in
+ let has_logged_user, logged_user =
+ match logged_user with
+ `Null -> false, ""
+ | `String name -> true, name
+ | _ -> assert false in
+ [ "version", Template.VarString (string_of_int version);
+ "url", Template.VarString url;
+ "title", Template.VarString title;
+ "last_modified_date", Template.VarString date;
+ "has_logged_ip", Template.VarConditional has_logged_ip;
+ "logged_ip", Template.VarString logged_ip;
+ "has_logged_user", Template.VarConditional has_logged_user;
+ "logged_user", Template.VarString logged_user;
+ "is_live", Template.VarConditional false ]
+ | _ -> assert false) in
+
+ template#table "history" table;
+
+ q#template template
+
+let () =
+ register_script ~restrict:[CanEdit] run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: rss.ml,v 1.2 2004/10/04 15:19:56 rich Exp $
+ * $Id: page_rss.ml,v 1.1 2004/11/01 17:46:21 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
--- /dev/null
+(* COCANWIKI - a wiki written in Objective CAML.
+ * Written by Richard W.M. Jones <rich@merjis.com>.
+ * Copyright (C) 2004 Merjis Ltd.
+ * $Id: recent_rss.ml,v 1.1 2004/11/01 17:46:21 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *)
+
+open Apache
+open Registry
+open Cgi
+open Printf
+
+open Cocanwiki
+open Cocanwiki_template
+open Cocanwiki_date
+
+let limit = 30
+
+let run r (q : cgi) (dbh : Dbi.connection) hostid {hostname = hostname} _ =
+ let template = get_template dbh hostid "recent_rss.xml" in
+
+ template#set "hostname" hostname;
+
+ (* Get the changes. *)
+ let sth =
+ dbh#prepare_cached
+ "select p.id, p.url, p.url_deleted, p.title, p.last_modified_date,
+ p.logged_ip, u.name
+ from pages p left outer join users u on p.logged_user = u.id
+ where p.hostid = ?
+ order by p.last_modified_date desc
+ limit ?" in
+ sth#execute [`Int hostid; `Int limit];
+
+ let table =
+ sth#map
+ (function
+ | [`Int version; `String url; _; `String title;
+ `Timestamp last_modified_date; logged_ip; logged_user] ->
+ let date = printable_date_time last_modified_date in
+ let has_logged_ip, logged_ip =
+ match logged_ip with
+ `Null -> false, ""
+ | `String ip -> true, ip
+ | _ -> assert false in
+ let has_logged_user, logged_user =
+ match logged_user with
+ `Null -> false, ""
+ | `String name -> true, name
+ | _ -> assert false in
+ [ "version", Template.VarString (string_of_int version);
+ "url", Template.VarString url;
+ "title", Template.VarString title;
+ "last_modified_date", Template.VarString date;
+ "has_logged_ip", Template.VarConditional has_logged_ip;
+ "logged_ip", Template.VarString logged_ip;
+ "has_logged_user", Template.VarConditional has_logged_user;
+ "logged_user", Template.VarString logged_user;
+ "is_live", Template.VarConditional true ]
+ | [`Int version; `Null; `String url; `String title;
+ `Timestamp last_modified_date; logged_ip; logged_user] ->
+ let date = printable_date_time last_modified_date in
+ let has_logged_ip, logged_ip =
+ match logged_ip with
+ `Null -> false, ""
+ | `String ip -> true, ip
+ | _ -> assert false in
+ let has_logged_user, logged_user =
+ match logged_user with
+ `Null -> false, ""
+ | `String name -> true, name
+ | _ -> assert false in
+ [ "version", Template.VarString (string_of_int version);
+ "url", Template.VarString url;
+ "title", Template.VarString title;
+ "last_modified_date", Template.VarString date;
+ "has_logged_ip", Template.VarConditional has_logged_ip;
+ "logged_ip", Template.VarString logged_ip;
+ "has_logged_user", Template.VarConditional has_logged_user;
+ "logged_user", Template.VarString logged_user;
+ "is_live", Template.VarConditional false ]
+ | _ -> assert false) in
+
+ template#table "recent_changes" table;
+
+ q#template template
+
+let () =
+ register_script ~restrict:[CanEdit] run
<h1><span>Versions of this page</span></h1>
+<ul class="menu">
+<li class="first"> <a href="history.rss">RSS feed of this page</a> </li>
+</ul>
+
<ul id="history">
::table(history)::
<li>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<rdf:RDF
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns="http://purl.org/rss/1.0/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <channel rdf:about="http://::hostname_html_tag::/::page_html_tag::">
+ <title>Version of page ::page_html::</title>
+ <link>http://::hostname_html_tag::/::page_html_tag::</link>
+ <language>en-GB</language>
+ <items>
+ <rdf:Seq>
+ ::table(history)::
+ <rdf:li rdf:resource="http://::hostname_html_tag::/::page_html_tag::?version=::version::"/>
+ ::end::
+ </rdf:Seq>
+ </items>
+ </channel>
+::table(history)::
+ <item rdf:about="http://::hostname_html_tag::/::page_html_tag::?version=::version::">
+ <title>::title_html:: (version ::version::) changed by ::logged_user:: ::logged_ip::</title>
+ <link>http://::hostname_html_tag::/::page_html_tag::?version=::version::</link>
+ <description>
+ <a href="/::url_html_tag::/diff?version=::version::">Differences</a>
+ </description>
+ <!-- <dc:creator> ... </dc:creator> -->
+ <!-- <dc:date> ... </dc:date> -->
+ </item>
+::end::
+</rdf:RDF>
::if(has_next)::
<li> <a href="?offset=::next_offset::&limit=::limit::">Show next ::limit::</a> </li>
::end::
+<li> <a href="_recent.rss">RSS feed of this page</a> </li>
</ul>
<ul id="recent_changes">
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<rdf:RDF
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns="http://purl.org/rss/1.0/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <channel rdf:about="http://::hostname_html_tag::/">
+ <title>Recent changes at ::hostname_html::</title>
+ <link>http://::hostname_html_tag::/</link>
+ <language>en-GB</language>
+ <items>
+ <rdf:Seq>
+ ::table(recent_changes)::
+ <rdf:li rdf:resource="http://::hostname_html_tag::/::url_html_tag::?version=::version::"/>
+ ::end::
+ </rdf:Seq>
+ </items>
+ </channel>
+::table(recent_changes)::
+ <item rdf:about="http://::hostname_html_tag::/::url_html_tag::?version=::version::">
+ <title>::title_html:: (version ::version::) changed by ::logged_user:: ::logged_ip::</title>
+ <link>http://::hostname_html_tag::/::url_html_tag::?version=::version::</link>
+ <description>
+ <a href="/::url_html_tag::/diff?version=::version::">Differences</a>
+ </description>
+ <!-- <dc:creator> ... </dc:creator> -->
+ <!-- <dc:date> ... </dc:date> -->
+ </item>
+::end::
+</rdf:RDF>