diff --git a/modules/blog.module b/modules/blog.module index 1a2aa8d3c9e..7aba6d5dc59 100644 --- a/modules/blog.module +++ b/modules/blog.module @@ -341,7 +341,7 @@ function blog_block() { while ($node = db_fetch_object($result)) { $output .= l(check_output($node->title), array("id" => $node->nid)) ."
\n"; } - $output .= "
".lm(t("more"), array("mod" => "blog"), t("Read the latest blog entries."))."
"; + $output .= "
".lm(t("more"), array("mod" => "blog"), "", array("title" => t("Read the latest blog entries."))) ."
"; $block[0]["content"] = $output; } diff --git a/modules/blog/blog.module b/modules/blog/blog.module index 1a2aa8d3c9e..7aba6d5dc59 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -341,7 +341,7 @@ function blog_block() { while ($node = db_fetch_object($result)) { $output .= l(check_output($node->title), array("id" => $node->nid)) ."
\n"; } - $output .= "
".lm(t("more"), array("mod" => "blog"), t("Read the latest blog entries."))."
"; + $output .= "
".lm(t("more"), array("mod" => "blog"), "", array("title" => t("Read the latest blog entries."))) ."
"; $block[0]["content"] = $output; } diff --git a/modules/comment.module b/modules/comment.module index 3dc248914e4..1d8930f21bd 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -667,7 +667,7 @@ function comment_node_link($node) { $output .= " titleauthoroperations"; while ($comment = db_fetch_object($result)) { - $output .= "". l($comment->subject, array("id" => $node->nid, "cid" => $comment->cid), "node", $comment->cid) ."". format_name($comment) ."". l(t("view comment"), array("id" => $node->nid, "cid" => $comment->cid ."#". $comment->cid)) ."". la(t("edit comment"), array("mod" => "comment", "op" => "edit", "id" => $comment->cid)) ."". la(t("delete comment"), array("mod" => "comment", "op" => "delete", "id" => $comment->cid)) .""; + $output .= "". l($comment->subject, array("id" => $node->nid, "cid" => $comment->cid), "node", $comment->cid) ."". format_name($comment) ."". l(t("view comment"), array("id" => $node->nid, "cid" => $comment->cid), $comment->cid) ."". la(t("edit comment"), array("mod" => "comment", "op" => "edit", "id" => $comment->cid)) ."". la(t("delete comment"), array("mod" => "comment", "op" => "delete", "id" => $comment->cid)) .""; } $output .= ""; diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 3dc248914e4..1d8930f21bd 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -667,7 +667,7 @@ function comment_node_link($node) { $output .= " titleauthoroperations"; while ($comment = db_fetch_object($result)) { - $output .= "". l($comment->subject, array("id" => $node->nid, "cid" => $comment->cid), "node", $comment->cid) ."". format_name($comment) ."". l(t("view comment"), array("id" => $node->nid, "cid" => $comment->cid ."#". $comment->cid)) ."". la(t("edit comment"), array("mod" => "comment", "op" => "edit", "id" => $comment->cid)) ."". la(t("delete comment"), array("mod" => "comment", "op" => "delete", "id" => $comment->cid)) .""; + $output .= "". l($comment->subject, array("id" => $node->nid, "cid" => $comment->cid), "node", $comment->cid) ."". format_name($comment) ."". l(t("view comment"), array("id" => $node->nid, "cid" => $comment->cid), $comment->cid) ."". la(t("edit comment"), array("mod" => "comment", "op" => "edit", "id" => $comment->cid)) ."". la(t("delete comment"), array("mod" => "comment", "op" => "delete", "id" => $comment->cid)) .""; } $output .= ""; diff --git a/modules/node.module b/modules/node.module index 4a3d8d84254..f70e2173f1c 100644 --- a/modules/node.module +++ b/modules/node.module @@ -671,31 +671,38 @@ function node_block() { return $block; } -function node_feed() { +function node_feed($nodes = 0, $channel = array()) { + /* + a generic function for generating rss feeds from a set of nodes. + $nodes should be an object as returned by db_query() which contains the nid field + $channel is an associative array containing title, link, and description keys + */ - $result = db_query("SELECT nid, type FROM node WHERE promote = '1' AND status = '1' ORDER BY created DESC LIMIT 15"); - - while ($node = db_fetch_object($result)) { - $item = node_load(array("nid" => $node->nid, "type" => $node->type)); - - $link = path_uri() .drupal_url(array("id" => $item->nid), "node"); + if (!$nodes) { + $nodes = db_query("SELECT nid FROM node WHERE promote = '1' AND status = '1' ORDER BY created DESC LIMIT 15"); + } + while ($node = db_fetch_object($nodes)) { + $item = node_load(array("nid" => $node->nid)); + $link = path_uri(). drupal_url(array("id" => $item->nid), "node"); $items .= format_rss_item($item->title, $link, $item->teaser); } - $output .= "\n"; + $output .= "\n"; // $output .= "\n"; - $output .= "\n"; - $output .= format_rss_channel(variable_get("site_name", "drupal") ." - ". variable_get("site_slogan", ""), path_uri(), variable_get("site_mission", ""), $items); + if (!$channel["version"]) $channel["version"] = "0.91"; + if (!$channel["title"]) $channel["title"] = variable_get("site_name", "drupal") ." - ". variable_get("site_slogan", ""); + if (!$channel["link"]) $channel["link"] = path_uri(); + if (!$channel["description"]) $channel["description"] = variable_get("site_mission", ""); + if (!$channel["language"]) $channel["language"] = "en"; + $output .= "\n"; + $output .= format_rss_channel($channel["title"], $channel["link"], $channel["description"], $items, $channel["language"]); $output .= "\n"; header("Content-Type: text/xml"); - print $output; - } - function node_validate($node, &$error) { global $user; diff --git a/modules/node/node.module b/modules/node/node.module index 4a3d8d84254..f70e2173f1c 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -671,31 +671,38 @@ function node_block() { return $block; } -function node_feed() { +function node_feed($nodes = 0, $channel = array()) { + /* + a generic function for generating rss feeds from a set of nodes. + $nodes should be an object as returned by db_query() which contains the nid field + $channel is an associative array containing title, link, and description keys + */ - $result = db_query("SELECT nid, type FROM node WHERE promote = '1' AND status = '1' ORDER BY created DESC LIMIT 15"); - - while ($node = db_fetch_object($result)) { - $item = node_load(array("nid" => $node->nid, "type" => $node->type)); - - $link = path_uri() .drupal_url(array("id" => $item->nid), "node"); + if (!$nodes) { + $nodes = db_query("SELECT nid FROM node WHERE promote = '1' AND status = '1' ORDER BY created DESC LIMIT 15"); + } + while ($node = db_fetch_object($nodes)) { + $item = node_load(array("nid" => $node->nid)); + $link = path_uri(). drupal_url(array("id" => $item->nid), "node"); $items .= format_rss_item($item->title, $link, $item->teaser); } - $output .= "\n"; + $output .= "\n"; // $output .= "\n"; - $output .= "\n"; - $output .= format_rss_channel(variable_get("site_name", "drupal") ." - ". variable_get("site_slogan", ""), path_uri(), variable_get("site_mission", ""), $items); + if (!$channel["version"]) $channel["version"] = "0.91"; + if (!$channel["title"]) $channel["title"] = variable_get("site_name", "drupal") ." - ". variable_get("site_slogan", ""); + if (!$channel["link"]) $channel["link"] = path_uri(); + if (!$channel["description"]) $channel["description"] = variable_get("site_mission", ""); + if (!$channel["language"]) $channel["language"] = "en"; + $output .= "\n"; + $output .= format_rss_channel($channel["title"], $channel["link"], $channel["description"], $items, $channel["language"]); $output .= "\n"; header("Content-Type: text/xml"); - print $output; - } - function node_validate($node, &$error) { global $user;