submit -> moderate -> post to the main page -> comments. Below you may fix a minimum word count for stories and also write some submission or content guidelines for users wanting to post a story."); break; case 'admin/help#story': $output = "

The story module lets your users submit articles for consideration by the rest of the community, who can vote on them if moderation is enabled. Stories usually follow a publishing flow of submit -> moderate -> post to the main page -> comments. Administrators are able to shortcut this flow as desired.

"; $output .= "In %story-config you can set up an introductory text for story authors, and a floor on the number of words which may be included in a story. This is designed to help discourage the submission of trivially short stories."; $output = t($output, array("%story-config" => l(t("administer") ." » ". t("configuration") ." » ". t("modules") ." » ". t("story"), "admin/system/modules/story"))); break; } return $output; } function story_settings() { $output .= form_textarea("Explanation or submission guidelines", "story_help", variable_get("story_help", ""), 70, 5, "This text will be displayed at the top of the story submission form. It is useful for helping or instructing your users."); $output .= form_select(t("Minimum number of words"), "minimum_story_size", variable_get("minimum_story_size", 0), array(0 => "0 words", 10 => "10 words", 25 => "25 words", 50 => "50 words", 75 => "75 words", 100 => "100 words", 125 => "125 words", 150 => "150 words", 175 => "175 words", 200 => "200 words"), t("The minimum number of words a story must be to be considered valid. This can be useful to rule out submissions that do not meet the site's standards, such as short test posts.")); return $output; } function story_node($field) { $info["name"] = t("story"); $info["description"] = t("A story is a post that is submitted to the attention of other users and is queued in the submission queue. Users and moderators vote on the posts they like or dislike, promoting or demoting them. When a post gets above a certain threshold it automatically gets promoted to the front page."); return $info[$field]; } function story_perm() { return array("create stories"); } function story_access($op, $node) { if ($op == "view") { return $node->status; } if ($op == "create") { return user_access("create stories"); } } function story_link($type) { $links = array(); if ($type == "system") { if (user_access("create stories")) { menu("node/add/story", t("story"), "node_page", 0); } } return $links; } function story_validate(&$node) { /* ** Validate the size of the story: */ if (isset($node->body) && count(explode(" ", $node->body)) < variable_get("minimum_story_size", 0)) { $error["body"] = "
". t("The body of your story is too short.") ."
"; } return $error; } function story_form(&$node, &$help, &$error) { /* ** Carry out some explanation or submission guidelines: */ $help = variable_get("story_help", ""); if (function_exists("taxonomy_node_form")) { $output .= implode("", taxonomy_node_form("story", $node)); } $output .= form_textarea(t("Body"), "body", $node->body, 60, 15, $error["body"] ? $error["body"] : form_allowed_tags_text()); return $output; } function story_content($node) { return node_prepare($node); } ?>