Commit 9a57a207 authored by Kjartan's avatar Kjartan

- 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.
parent 4ad174c4
......@@ -524,7 +524,7 @@ function import_page_last() {
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
while ($item = db_fetch_object($result)) {
if (module_exist("blog") && user_access("maintain personal blog")) {
$links[] = l(t("blog it"), "node/add/blog&amp;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 .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
while ($item = db_fetch_object($result)) {
if (module_exist("blog") && user_access("maintain personal blog")) {
$links[] = l(t("blog it"), "node/add/blog&amp;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[] = "<a href=\"$item->link\">". t("visit") ."</a>";
......@@ -597,7 +597,7 @@ function import_page_bundle($bid) {
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
while ($item = db_fetch_object($result)) {
if (module_exist("blog") && user_access("maintain personal blog")) {
$links[] = l(t("blog it"), "node/add/blog&amp;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[] = "<a href=\"$item->link\">". t("visit") ."</a>";
......
......@@ -524,7 +524,7 @@ function import_page_last() {
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
while ($item = db_fetch_object($result)) {
if (module_exist("blog") && user_access("maintain personal blog")) {
$links[] = l(t("blog it"), "node/add/blog&amp;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 .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
while ($item = db_fetch_object($result)) {
if (module_exist("blog") && user_access("maintain personal blog")) {
$links[] = l(t("blog it"), "node/add/blog&amp;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[] = "<a href=\"$item->link\">". t("visit") ."</a>";
......@@ -597,7 +597,7 @@ function import_page_bundle($bid) {
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
while ($item = db_fetch_object($result)) {
if (module_exist("blog") && user_access("maintain personal blog")) {
$links[] = l(t("blog it"), "node/add/blog&amp;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[] = "<a href=\"$item->link\">". t("visit") ."</a>";
......
......@@ -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 = "<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));
......@@ -177,7 +176,6 @@ function blog_form(&$node, &$help, &$error) {
function blog_page() {
if (user_access("access content")) {
switch (arg(1)) {
case "feed":
......
......@@ -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 = "<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));
......@@ -177,7 +176,6 @@ function blog_form(&$node, &$help, &$error) {
function blog_page() {
if (user_access("access content")) {
switch (arg(1)) {
case "feed":
......
......@@ -524,7 +524,7 @@ function import_page_last() {
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
while ($item = db_fetch_object($result)) {
if (module_exist("blog") && user_access("maintain personal blog")) {
$links[] = l(t("blog it"), "node/add/blog&amp;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 .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
while ($item = db_fetch_object($result)) {
if (module_exist("blog") && user_access("maintain personal blog")) {
$links[] = l(t("blog it"), "node/add/blog&amp;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[] = "<a href=\"$item->link\">". t("visit") ."</a>";
......@@ -597,7 +597,7 @@ function import_page_bundle($bid) {
$output .= "<table border=\"0\" cellpadding=\"4\" cellspacing=\"2\">";
while ($item = db_fetch_object($result)) {
if (module_exist("blog") && user_access("maintain personal blog")) {
$links[] = l(t("blog it"), "node/add/blog&amp;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[] = "<a href=\"$item->link\">". t("visit") ."</a>";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment