diff options
Diffstat (limited to 'modules/blog')
-rw-r--r-- | modules/blog/blog.module | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/modules/blog/blog.module b/modules/blog/blog.module index 852d1c58e..e66460334 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -155,17 +155,30 @@ function blog_page_last() { print "<div style=\"text-align: right;\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" alt=\"\" title=\"\" />", "blog/feed", array("title" => t("Read the XML version of all blogs."))) ."</div>"; } +function blog_validate(&$node) { + + /* + ** Validate the size of the blog: + */ + + if (isset($node->body) && count(explode(" ", $node->body)) < variable_get("minimum_blog_size", 0)) { + $error["body"] = theme("theme_error", t("The body of your blog is too short.")); + } + + return $error; +} + function blog_form(&$node, &$help, &$error) { global $nid; $iid = $_GET["iid"]; - if (empty($node->body)) { - /* - ** Carry out some explanation or submission guidelines: - */ + /* + ** Carry out some explanation or submission guidelines: + */ - $help = variable_get("blog_help", ""); + $help = variable_get("blog_help", ""); + if (empty($node->body)) { /* ** If the user clicked a "blog it" link, we load the data from the ** database and quote it in the blog: @@ -180,19 +193,11 @@ function blog_form(&$node, &$help, &$error) { $node->body = "<a href=\"$item->link\">$item->title</a> - <i>". check_output($item->description) ."</i> [<a href=\"$item->flink\">$item->ftitle</a>]\n"; } } - else { - /* - ** Validate the size of the blog: - */ - - if (count(explode(" ", $node->body)) < variable_get("minimum_blog_size", 0)) { - $error["body"] = theme("theme_error", t("The body of your blog is too short.")); - } - } if (function_exists("taxonomy_node_form")) { $output .= implode("", taxonomy_node_form("blog", $node)); } + $output .= form_textarea(t("Body"), "body", $node->body, 60, 15, $error["body"] ? $error["body"] : form_allowed_tags_text()); return $output; |