From 9a57a20732303b306c3f48bdc4b3b37636e1557d Mon Sep 17 00:00:00 2001 From: Kjartan Mannes Date: Thu, 13 Mar 2003 14:02:44 +0000 Subject: - Fixes invalid link generation in import module (wouldn't work with clean urls enabled). - Changed the logic in blog module to handle "blog it" links. --- modules/aggregator.module | 6 +++--- modules/aggregator/aggregator.module | 6 +++--- modules/blog.module | 22 ++++++++++------------ modules/blog/blog.module | 22 ++++++++++------------ modules/import.module | 6 +++--- 5 files changed, 29 insertions(+), 33 deletions(-) (limited to 'modules') diff --git a/modules/aggregator.module b/modules/aggregator.module index 0ee0a24d1..d4c7469d0 100644 --- a/modules/aggregator.module +++ b/modules/aggregator.module @@ -524,7 +524,7 @@ function import_page_last() { $output .= ""; while ($item = db_fetch_object($result)) { if (module_exist("blog") && user_access("maintain personal blog")) { - $links[] = l(t("blog it"), "node/add/blog&iid=$item->iid", array("title" => t("Comment on this news item in your personal blog."))); + $links[] = l(t("blog it"), "node/add/blog", array("title" => t("Comment on this news item in your personal blog.")), "iid=$item->iid"); } $links[] = l(t("feed"), "import/feed/$item->fid", array("title" => t("Read more syndicated news from this feed."))); @@ -560,7 +560,7 @@ function import_page_feed($fid) { $output .= "
"; while ($item = db_fetch_object($result)) { if (module_exist("blog") && user_access("maintain personal blog")) { - $links[] = l(t("blog it"), "node/add/blog&iid=$item->iid", array("title" => t("Comment on this news item in your personal blog."))); + $links[] = l(t("blog it"), "node/add/blog", array("title" => t("Comment on this news item in your personal blog.")), "iid=$item->iid"); } $links[] = "link\">". t("visit") .""; @@ -597,7 +597,7 @@ function import_page_bundle($bid) { $output .= "
"; while ($item = db_fetch_object($result)) { if (module_exist("blog") && user_access("maintain personal blog")) { - $links[] = l(t("blog it"), "node/add/blog&iid=$item->iid", array("title" => t("Comment on this news item in your personal blog."))); + $links[] = l(t("blog it"), "node/add/blog", array("title" => t("Comment on this news item in your personal blog.")), "iid=$item->iid"); } $links[] = l(t("feed"), "import/feed/$item->fid", array("title" => t("Read more syndicated news from this feed."))); $links[] = "link\">". t("visit") .""; diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index 0ee0a24d1..d4c7469d0 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -524,7 +524,7 @@ function import_page_last() { $output .= "
"; while ($item = db_fetch_object($result)) { if (module_exist("blog") && user_access("maintain personal blog")) { - $links[] = l(t("blog it"), "node/add/blog&iid=$item->iid", array("title" => t("Comment on this news item in your personal blog."))); + $links[] = l(t("blog it"), "node/add/blog", array("title" => t("Comment on this news item in your personal blog.")), "iid=$item->iid"); } $links[] = l(t("feed"), "import/feed/$item->fid", array("title" => t("Read more syndicated news from this feed."))); @@ -560,7 +560,7 @@ function import_page_feed($fid) { $output .= "
"; while ($item = db_fetch_object($result)) { if (module_exist("blog") && user_access("maintain personal blog")) { - $links[] = l(t("blog it"), "node/add/blog&iid=$item->iid", array("title" => t("Comment on this news item in your personal blog."))); + $links[] = l(t("blog it"), "node/add/blog", array("title" => t("Comment on this news item in your personal blog.")), "iid=$item->iid"); } $links[] = "link\">". t("visit") .""; @@ -597,7 +597,7 @@ function import_page_bundle($bid) { $output .= "
"; while ($item = db_fetch_object($result)) { if (module_exist("blog") && user_access("maintain personal blog")) { - $links[] = l(t("blog it"), "node/add/blog&iid=$item->iid", array("title" => t("Comment on this news item in your personal blog."))); + $links[] = l(t("blog it"), "node/add/blog", array("title" => t("Comment on this news item in your personal blog.")), "iid=$item->iid"); } $links[] = l(t("feed"), "import/feed/$item->fid", array("title" => t("Read more syndicated news from this feed."))); $links[] = "link\">". t("visit") .""; diff --git a/modules/blog.module b/modules/blog.module index 17d5c89e3..8646ea3f3 100644 --- a/modules/blog.module +++ b/modules/blog.module @@ -134,17 +134,7 @@ function blog_page_last() { function blog_form(&$node, &$help, &$error) { global $nid, $iid; - - if (isset($node->body)) { - /* - ** 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.")); - } - } - else { + if (empty($node->body)) { /* ** Carry out some explanation or submission guidelines: @@ -166,6 +156,15 @@ function blog_form(&$node, &$help, &$error) { $node->body = "link\">$item->title - ". check_output($item->description) ." [flink\">$item->ftitle]\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)); @@ -177,7 +176,6 @@ function blog_form(&$node, &$help, &$error) { function blog_page() { - if (user_access("access content")) { switch (arg(1)) { case "feed": diff --git a/modules/blog/blog.module b/modules/blog/blog.module index 17d5c89e3..8646ea3f3 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -134,17 +134,7 @@ function blog_page_last() { function blog_form(&$node, &$help, &$error) { global $nid, $iid; - - if (isset($node->body)) { - /* - ** 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.")); - } - } - else { + if (empty($node->body)) { /* ** Carry out some explanation or submission guidelines: @@ -166,6 +156,15 @@ function blog_form(&$node, &$help, &$error) { $node->body = "link\">$item->title - ". check_output($item->description) ." [flink\">$item->ftitle]\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)); @@ -177,7 +176,6 @@ function blog_form(&$node, &$help, &$error) { function blog_page() { - if (user_access("access content")) { switch (arg(1)) { case "feed": diff --git a/modules/import.module b/modules/import.module index 0ee0a24d1..d4c7469d0 100644 --- a/modules/import.module +++ b/modules/import.module @@ -524,7 +524,7 @@ function import_page_last() { $output .= "
"; while ($item = db_fetch_object($result)) { if (module_exist("blog") && user_access("maintain personal blog")) { - $links[] = l(t("blog it"), "node/add/blog&iid=$item->iid", array("title" => t("Comment on this news item in your personal blog."))); + $links[] = l(t("blog it"), "node/add/blog", array("title" => t("Comment on this news item in your personal blog.")), "iid=$item->iid"); } $links[] = l(t("feed"), "import/feed/$item->fid", array("title" => t("Read more syndicated news from this feed."))); @@ -560,7 +560,7 @@ function import_page_feed($fid) { $output .= "
"; while ($item = db_fetch_object($result)) { if (module_exist("blog") && user_access("maintain personal blog")) { - $links[] = l(t("blog it"), "node/add/blog&iid=$item->iid", array("title" => t("Comment on this news item in your personal blog."))); + $links[] = l(t("blog it"), "node/add/blog", array("title" => t("Comment on this news item in your personal blog.")), "iid=$item->iid"); } $links[] = "link\">". t("visit") .""; @@ -597,7 +597,7 @@ function import_page_bundle($bid) { $output .= "
"; while ($item = db_fetch_object($result)) { if (module_exist("blog") && user_access("maintain personal blog")) { - $links[] = l(t("blog it"), "node/add/blog&iid=$item->iid", array("title" => t("Comment on this news item in your personal blog."))); + $links[] = l(t("blog it"), "node/add/blog", array("title" => t("Comment on this news item in your personal blog.")), "iid=$item->iid"); } $links[] = l(t("feed"), "import/feed/$item->fid", array("title" => t("Read more syndicated news from this feed."))); $links[] = "link\">". t("visit") .""; -- cgit v1.2.3