summaryrefslogtreecommitdiff
path: root/modules/forum.module
diff options
context:
space:
mode:
authorKjartan Mannes <kjartan@2.no-reply.drupal.org>2003-03-07 22:11:44 +0000
committerKjartan Mannes <kjartan@2.no-reply.drupal.org>2003-03-07 22:11:44 +0000
commit831ee213032623aefb9d40cc0ebb97234e56fa63 (patch)
tree1fc05827a5fd28106c8ee001eb61f89ddcd39ee1 /modules/forum.module
parent3aba0fda70b825a588d20d6f9797acab9418c436 (diff)
downloadbrdo-831ee213032623aefb9d40cc0ebb97234e56fa63.tar.gz
brdo-831ee213032623aefb9d40cc0ebb97234e56fa63.tar.bz2
- Renamed "form.admin" to "form admin".
- Added node_admin_settings() to let users set node defaults. * Added _nodeapi("conf") - Modified form_checkbox() to unset options. (Modified the patch from Ax.) - Removed the _save() hook. - Fixed a logical flaw in field_get() and field_set() which would break moderation. - Moved some admin menus around and cleaned up some typos.
Diffstat (limited to 'modules/forum.module')
-rw-r--r--modules/forum.module37
1 files changed, 13 insertions, 24 deletions
diff --git a/modules/forum.module b/modules/forum.module
index 5b90e3145..80026a80d 100644
--- a/modules/forum.module
+++ b/modules/forum.module
@@ -69,24 +69,6 @@ function forum_taxonomy($op, $type, $object) {
}
}
-function forum_save($op, $node) {
- if ($op == "approve") {
- return array("status" => 1);
- }
-
- if ($op == "create") {
- return array("body" => filter($node->body), "teaser" => filter($node->teaser), "moderate" => 0, "status" => 1, "tid", "icon_num", "shadow" => 0);
- }
-
- if ($op == "decline") {
- return array("status" => 0);
- }
-
- if ($op == "update") {
- return array("body" => filter($node->body), "teaser" => filter($node->teaser), "tid", "icon_num", "shadow");
- }
-}
-
function forum_load($node) {
$forum = db_fetch_object(db_query("SELECT * FROM forum WHERE nid = '%d'", $node->nid));
@@ -185,13 +167,20 @@ function forum_view($node, $main = 0) {
theme("node", $node, $main);
}
-function forum_validate($node) {
- // we use the validate hook to remember the old taxonomy terms
- $node->taxonomy = array_keys(taxonomy_node_get_terms($node->nid));
- if (!in_array($node->tid[0], $node->taxonomy)) {
- $node->taxonomy[] = $node->tid[0];
+function forum_validate(&$node) {
+ // Make sure all fields are set properly:
+ $node->body = filter($node->body);
+ $node->teaser = filter($node->teaser);
+ $node->icon = $node->icon ? $node->icon : "";
+ $node->shadow = $node->shadow ? $node->shadow : 0;
+ $node->tid = $node->tid ? $node->tid : 0;
+ // We use the validate hook to remember the old taxonomy terms:
+ if ($node->tid) {
+ $node->taxonomy = array_keys(taxonomy_node_get_terms($node->nid));
+ if (!in_array($node->tid[0], $node->taxonomy)) {
+ $node->taxonomy[] = $node->tid[0];
+ }
}
- return $node;
}
function forum_form(&$node, &$help, &$error) {