summaryrefslogtreecommitdiff
path: root/modules/page.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-04-11 19:44:24 +0000
committerDries Buytaert <dries@buytaert.net>2001-04-11 19:44:24 +0000
commit4711869f52897077b52f76b54a74982de3ff0e9b (patch)
treef2633c6f760e9faba9a825d5feb1a30af566f955 /modules/page.module
parentdc93ff3260b15f4660ea40901a9ea227e60b43f1 (diff)
downloadbrdo-4711869f52897077b52f76b54a74982de3ff0e9b.tar.gz
brdo-4711869f52897077b52f76b54a74982de3ff0e9b.tar.bz2
- fixed a small SQL bug in page.module
- slightly improved story.module, node.module and book.module - made the "default theme" a setting from the setting page - polished a bit on the export function: we can now export the book or parts thereof through the following url: 1. http://drop.org/export/book/ (full book) 2. http://drop.org/export/book/nid (where nid is the node id to start with) The export routine demonstrates how it can be done yet the output is too basic and can only improve over time.
Diffstat (limited to 'modules/page.module')
-rw-r--r--modules/page.module21
1 files changed, 16 insertions, 5 deletions
diff --git a/modules/page.module b/modules/page.module
index f004f59b1..1d712a9ba 100644
--- a/modules/page.module
+++ b/modules/page.module
@@ -56,14 +56,22 @@ function page_save($edit) {
node_save(array_merge($edit, array(type => "page", status => $status[posted])));
}
-function page_overview() {
- return node_overview("type = 'page'");
+function page_query($type = "") {
+ global $status;
+ $queries = array(array("recent pages", "WHERE n.type = 'page' ORDER BY n.timestamp DESC"), array("posted pages", "WHERE n.type = 'page' AND n.status = '$status[posted]' ORDER BY n.timestamp DESC"), array("dumped pages", "WHERE n.type = 'page' AND n.status = '$status[dumped]' ORDER BY n.timestamp DESC"));
+ return ($queries[$type] ? $queries[$type] : $queries);
+}
+
+function page_overview($query = array()) {
+ return node_overview($query);
}
function page_admin() {
- global $id, $op, $edit;
+ global $id, $op, $edit, $type;
- print "<SMALL><A HREF=\"admin.php?mod=page&op=add\">add new page</A> | <A HREF=\"admin.php?mod=page\">overview</A></SMALL><HR>\n";
+ print "<SMALL><A HREF=\"admin.php?mod=page&op=add\">add new page</A> | <A HREF=\"admin.php?mod=page&op=listing\">page listing</A> | <A HREF=\"admin.php?mod=page\">overview</A></SMALL><HR>\n";
+
+ $type = ($type ? $type : 0);
switch ($op) {
case "add":
@@ -72,11 +80,14 @@ function page_admin() {
case "edit":
print page_form(node_get_array(nid, $id));
break;
+ case "listing":
+ print node_listing(page_query());
+ break;
case "Save page":
print status(page_save($edit));
// fall through:
default:
- print page_overview();
+ print page_overview(page_query($type));
}
}