COCANWIKI is now ~95% UTF-8 safe.
[cocanwiki.git] / scripts / edit_page_css.ml
index d8add8d..8b18b9b 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: edit_page_css.ml,v 1.20 2006/03/27 19:10:29 rich Exp $
+ * $Id: edit_page_css.ml,v 1.23 2006/08/14 11:36:50 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
@@ -50,14 +50,13 @@ let run r (q : cgi) dbh hostid {hostname = hostname} user =
    * us to revert changes to the CSS easily.
    *)
   let rows = PGSQL(dbh)
-    "select id, title, description, creation_date, redirect
+    "select id, title, description, keywords, noodp, creation_date, redirect
        from pages
       where hostid = $hostid and url = $page" in
 
-  let oldpageid, title, description, creation_date, redirect =
+  let oldpageid, title, description, keywords, noodp, creation_date, redirect =
     match rows with
-    | [id, title, description, creation_date, redirect ] ->
-       id, title, description, creation_date, redirect
+    | [row] -> row
     | _ -> assert false in
 
   PGSQL(dbh)
@@ -69,18 +68,20 @@ let run r (q : cgi) dbh hostid {hostname = hostname} user =
                where hostid = $hostid and id = $oldpageid";
 
   PGSQL(dbh) "insert into pages (hostid, url, title,
-                                 description, creation_date, logged_ip,
+                                 description, keywords, noodp,
+                                 creation_date, logged_ip,
                                  logged_user, redirect, css)
-              values ($hostid, $page, $title, $description,
+              values ($hostid, $page, $title, $description, $?keywords,
+                      $?noodp,
                       $creation_date, $?logged_ip, $?logged_user,
                       $?redirect, $?css)";
 
   let pageid = PGOCaml.serial4 dbh "pages_id_seq" in
 
   PGSQL(dbh) "insert into contents (pageid, ordering,
-                                    sectionname, content, divname)
+                                    sectionname, content, divname, jsgo)
               select $pageid as pageid, ordering, sectionname,
-                     content, divname
+                     content, divname, jsgo
                 from contents
                where pageid = $oldpageid";