abstract = $story[abstract]; $this->body = $story[body]; } } function story_status() { return array(dumped, queued, posted); } function story_search($keys) { global $PHP_SELF, $status; $result = db_query("SELECT n.*, s.* FROM story s LEFT JOIN node n ON n.nid = s.nid AND n.lid = s.lid WHERE n.status = '$status[posted]' AND (n.title LIKE '%$keys%' OR s.abstract LIKE '%$keys%' OR s.body LIKE '%$keys%') ORDER BY n.timestamp DESC LIMIT 20"); while ($story = db_fetch_object($result)) { $find[$i++] = array("title" => check_output($story->title), "link" => (strstr($PHP_SELF, "admin.php") ? "admin.php?mod=node&type=story&op=edit&id=$story->nid" : "node.php?id=$story->nid"), "user" => $story->name, "date" => $story->timestamp); } return $find; } function story_help() { ?>
Queued stories: user-contributed stories are automatically whisked away to a submission queue for moderators (i.e. registered user) to frown at. Moderators vote whether or not a story should be posted to the front page for discussion.
Posted stories: published stories accessible to all visitors.
Dumped stories: rejected stories that are no longer available to visitors.
abstract; } function story_view($node, $main = 0) { global $theme; $node->body = ((!$main) && ($node->body)) ? "$node->abstract\n"; $form .= form_submit(t("Preview")); } else if ($edit && !$edit[abstract]) { $form .= "". t("Warning: you did not supply an abstract.") ."
\n"; $form .= form_submit(t("Preview")); } else { $form .= form_submit(t("Preview")); $form .= form_submit(t("Submit")); } return form($form); } function story_save($edit) { global $status, $user; if (!$edit[nid]) { node_save($edit, array(abstract, attributes => node_attributes_save("story", $edit), author => $user->uid, body, comment => variable_get("story_comment", 0), moderate => variable_get("story_moderate", ""), promote => variable_get("story_promote", 0), score => 0, status => variable_get("story_status", $status[queued]), timestamp => time(), title, type => "story", votes => 0)); } else if (user_access("administer nodes")) { node_save($edit, array(abstract, attributes => node_attributes_save("story", $edit), body, title, type => "story")); } } function story_user() { global $edit, $op, $theme; switch($op) { case t("Preview"): $theme->box(t("Submit"), story_form($edit)); break; case t("Submit"): story_save($edit); $theme->box(t("Submit"), t("Thank you for your submission.")); break; default: $theme->box(t("Submit"), story_form()); } } ?>