From a2e6910902bfb1263e1b6363e2c29ede68f89918 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 3 Nov 2001 18:38:30 +0000 Subject: - Made the node forms support "help texts": it is not possible to configure Drupal to display submission guidelines, or any other kind of explanation such as "NO TEST POSTS", for example. - Added node versioning: it is possible to create revisions, to view old revisions and to roll-back to older revisions. You'll need to apply a SQL update. I'm going to work on the book module now, so I might be changing a few things to enable collaborative, moderated revisions - but feel free to send some first feedback, if you like. - Added some configuration options which can be used to set the minimum number of words a blog/story should consist of. Hopefully this will be usefull to stop the (almost empty) test blogs. - Various improvements: + Fine-tuned new node permission system. + Fine-tuned the functions in node.inc. + Fine-tuned some forms. + XHTML-ified some code. --- modules/forum.module | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'modules/forum.module') diff --git a/modules/forum.module b/modules/forum.module index 1eec66753..e826fb95e 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -8,12 +8,9 @@ function forum_node($field) { } function forum_access($op, $node) { - if ($op == "view") { - return $node->nid && $node->status && !$node->moderate; + return ($node->nid && $node->status && !$node->moderate); } - - return user_access("adminster nodes"); } function forum_link($type) { @@ -30,15 +27,13 @@ function forum_view($node) { $theme->box(t("Discussion forum"), $output); } -function forum_form($node, $error) { - +function forum_form($node, $help, $error) { $output .= form_textarea("Body", "body", $node->body, 60, 10); return $output; } function forum_save() { - if ($node->nid) { return array(); } @@ -63,13 +58,13 @@ function forum_page() { if (user_access("access content")) { $result = db_query("SELECT nid FROM node WHERE type = 'forum' ORDER BY title"); - $output .= "\n"; - $output .= " "; + $output .= "
". t("Forum") ."". t("Comments") ."". t("Last comment") ."
"; + $output .= " "; while ($node = db_fetch_object($result)) { $node = node_load(array("nid" => $node->nid)); - $output .= " "; + $output .= " "; } - $output .= "
". t("Forum") ."". t("Comments") ."". t("Last comment") ."
nid\">". check_output($node->title) ."
". check_output($node->body, 1) ."
". forum_num_comments($node->nid) ."". forum_last_comment($node->nid) ."
nid\">". check_output($node->title) ."
". check_output($node->body, 1) ."
". forum_num_comments($node->nid) ."". forum_last_comment($node->nid) ."
\n"; + $output .= ""; $theme->header(); $theme->box(t("Discussion forum"), $output); -- cgit v1.2.3