scripts/create_form.ml
scripts/create_user.ml
scripts/create_user_form.ml
+scripts/dead_ends.ml
scripts/delete_contact.ml
scripts/delete_contact_form.ml
scripts/delete_file.ml
scripts/upload_image.ml
scripts/upload_image_form.ml
scripts/users.ml
+scripts/what_links_here.ml
scripts/wikilib.ml
scripts/wikilib.mli
templates/00-TEMPLATE.html
templates/create_contact_form.html
templates/create_form.html
templates/create_user_form.html
+templates/dead_ends.html
templates/delete_contact_form.html
templates/delete_file_form.html
templates/delete_image_form.html
templates/upload_file_form.html
templates/upload_image_form.html
templates/users.html
+templates/what_links_here.html
\ No newline at end of file
create_user.cmx: cocanwiki.cmx cocanwiki_ok.cmx cocanwiki_strings.cmx
create_user_form.cmo: cocanwiki.cmo cocanwiki_template.cmi
create_user_form.cmx: cocanwiki.cmx cocanwiki_template.cmx
+dead_ends.cmo: cocanwiki.cmo cocanwiki_template.cmi
+dead_ends.cmx: cocanwiki.cmx cocanwiki_template.cmx
delete_contact.cmo: cocanwiki.cmo cocanwiki_ok.cmo
delete_contact.cmx: cocanwiki.cmx cocanwiki_ok.cmx
delete_contact_form.cmo: cocanwiki.cmo cocanwiki_template.cmi
upload_image_form.cmx: cocanwiki.cmx cocanwiki_template.cmx
users.cmo: cocanwiki.cmo cocanwiki_date.cmo cocanwiki_template.cmi
users.cmx: cocanwiki.cmx cocanwiki_date.cmx cocanwiki_template.cmx
+what_links_here.cmo: cocanwiki.cmo cocanwiki_template.cmi
+what_links_here.cmx: cocanwiki.cmx cocanwiki_template.cmx
wikilib.cmo: cocanwiki_strings.cmo wikilib.cmi
wikilib.cmx: cocanwiki_strings.cmx wikilib.cmi
admin/admin.cmo: cocanwiki.cmo cocanwiki_date.cmo cocanwiki_template.cmi
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: 00-TEMPLATE.ml,v 1.3 2004/09/09 12:21:21 rich Exp $
+ * $Id: 00-TEMPLATE.ml,v 1.4 2004/09/28 11:51:38 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#template template
let () =
- register_script ~restrict:[CanManageUsers] run
+ register_script ~restrict:[Put_Restrictions_Here] run
# Makefile for COCANWIKI.
-# $Id: Makefile,v 1.29 2004/09/28 10:56:39 rich Exp $
+# $Id: Makefile,v 1.30 2004/09/28 11:51:38 rich Exp $
include ../Makefile.config
wikilib.cmo \
cocanwiki_links.cmo
-OBJS := 00-TEMPLATE.cmo \
- change_password.cmo \
+OBJS := change_password.cmo \
change_password_form.cmo \
contact.cmo \
contact_show.cmo \
create_contact_form.cmo \
create_user.cmo \
create_user_form.cmo \
+ dead_ends.cmo \
delete_contact.cmo \
delete_contact_form.cmo \
delete_file.cmo \
upload_file_form.cmo \
upload_image.cmo \
upload_image_form.cmo \
- users.cmo
+ users.cmo \
+ what_links_here.cmo
ADMIN_OBJS := \
admin/admin.cmo \
--- /dev/null
+(* COCANWIKI - a wiki written in Objective CAML.
+ * Written by Richard W.M. Jones <rich@merjis.com>.
+ * Copyright (C) 2004 Merjis Ltd.
+ * $Id: dead_ends.ml,v 1.1 2004/09/28 11:51:38 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
+
+let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ =
+ let template = get_template dbh hostid "dead_ends.html" in
+
+ let sth =
+ dbh#prepare_cached
+ "select p.url, p.title, count (l.to_url)
+ from pages p left outer join links l
+ on p.hostid = l.hostid and p.url = l.from_url
+ where p.hostid = ?
+ and p.url is not null
+ and p.redirect is null
+ group by 1, 2
+ having count(l.to_url) = 0
+ order by 1" in
+ sth#execute [`Int hostid];
+
+ let table =
+ sth#map (function [`String page; `String title; _] ->
+ [ "page", Template.VarString page;
+ "title", Template.VarString title ]
+ | _ -> assert false) in
+
+ template#table "pages" table;
+
+ q#template template
+
+let () =
+ register_script run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: largest_pages.ml,v 1.1 2004/09/21 17:07:58 rich Exp $
+ * $Id: largest_pages.ml,v 1.2 2004/09/28 11:51:38 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#template template
let () =
- register_script ~restrict:[CanManageUsers] run
+ register_script run
--- /dev/null
+(* COCANWIKI - a wiki written in Objective CAML.
+ * Written by Richard W.M. Jones <rich@merjis.com>.
+ * Copyright (C) 2004 Merjis Ltd.
+ * $Id: what_links_here.ml,v 1.1 2004/09/28 11:51:38 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
+
+let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ =
+ let template = get_template dbh hostid "what_links_here.html" in
+
+ let page = q#param "page" in
+ template#set "page" page;
+
+ let sth = dbh#prepare_cached "select title from pages
+ where hostid = ? and url = ?" in
+ sth#execute [`Int hostid; `String page];
+
+ let title = sth#fetch1string () in
+ template#set "title" title;
+
+ let sth =
+ dbh#prepare_cached "select l.from_url, p.title from links l, pages p
+ where l.hostid = ? and l.to_url = ?
+ and l.hostid = p.hostid and l.from_url = p.url" in
+ sth#execute [`Int hostid; `String page];
+
+ let table =
+ sth#map
+ (function [`String page; `String title] ->
+ [ "page", Template.VarString page;
+ "title", Template.VarString title ]
+ | _ -> assert false) in
+
+ template#table "pages" table;
+
+ q#template template
+
+let () =
+ register_script run
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<title>Dead end pages</title>
+<meta name="robots" content="noindex,nofollow"/>
+<meta name="author" content="http://www.merjis.com/" />
+<link rel="stylesheet" href="::theme_css_html_tag::" type="text/css" title="Standard"/>
+</head><body>
+
+<h1>Dead end pages</h1>
+
+<ul>
+::table(pages)::
+<li> <a href="/::page_html_tag::">::title_html::</a> </li>
+::end::
+</ul>
+
+<ul id="topmenu" class="menu">
+<li class="first"> <a href="/">Home page</a> </li>
+<li> <a href="/_sitemap">Sitemap</a> </li>
+<li> <a href="/_recent">Recent changes</a> </li>
+</ul>
+
+<div id="menu_div">
+<ul id="bottommenu" class="menu">
+<li class="first"> <a href="/">Home page</a> </li>
+::table(sitemenu)::<li> <a href="/::url_html_tag::">::label_html::</a> </li>
+::end::
+<li> <a href="/_sitemap">Sitemap</a> </li>
+</ul>
+</div>
+
+<div id="footer_div">
+<hr/>
+
+<ul id="footer" class="menu">
+<li class="first"> <a href="/copyright">Copyright © ::year::</a> </li>
+<li> Powered by <a href="http://sandbox.merjis.com/">::cocanwiki_package_html:: ::cocanwiki_version_html::</a> </li>
+</ul>
+</div>
+
+</body>
+</html>
\ No newline at end of file
<li> <a href="/::page_html_tag::/history">Versions of this page</a> </li>
<li> <a href="/::page_html_tag::/editcss">Edit stylesheet for this page</a> </li>
<li> <a href="/::page_html_tag::/edittitle">Edit title</a> </li>
+<li> <a href="/_bin/what_links_here.cmo?page=::page_url::">What links here?</a> </li>
<li> <a href="/_bin/edit_sitemenu.cmo">Edit site menu</a> </li>
<li> <a href="/_bin/largest_pages.cmo">Largest pages</a> </li>
+<li> <a href="/_bin/dead_ends.cmo">Dead end pages</a> </li>
<li> <a href="/_images">Images</a> </li>
<li> <a href="/_files">Files</a> </li>
::if(has_stats)::
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<title>What links to ::title_html::</title>
+<meta name="robots" content="noindex,nofollow"/>
+<meta name="author" content="http://www.merjis.com/" />
+<link rel="stylesheet" href="::theme_css_html_tag::" type="text/css" title="Standard"/>
+</head><body>
+
+<h1>What links to ::title_html::</h1>
+
+<p>
+List of pages which link to
+<a href="/::page_html_tag::">::title_html::</a>:
+</p>
+
+<ul>
+::table(pages)::
+<li> <a href="/::page_html_tag::">::title_html::</a> </li>
+::end::
+</ul>
+
+<ul id="topmenu" class="menu">
+<li class="first"> <a href="/">Home page</a> </li>
+<li> <a href="/_sitemap">Sitemap</a> </li>
+<li> <a href="/_recent">Recent changes</a> </li>
+</ul>
+
+<div id="menu_div">
+<ul id="bottommenu" class="menu">
+<li class="first"> <a href="/">Home page</a> </li>
+::table(sitemenu)::<li> <a href="/::url_html_tag::">::label_html::</a> </li>
+::end::
+<li> <a href="/_sitemap">Sitemap</a> </li>
+</ul>
+</div>
+
+<div id="footer_div">
+<hr/>
+
+<ul id="footer" class="menu">
+<li class="first"> <a href="/copyright">Copyright © ::year::</a> </li>
+<li> Powered by <a href="http://sandbox.merjis.com/">::cocanwiki_package_html:: ::cocanwiki_version_html::</a> </li>
+</ul>
+</div>
+
+</body>
+</html>
\ No newline at end of file