Commit a6121c15 authored by Kjartan's avatar Kjartan

- fixing some incorrect l*() calls.

- fixing node_feed() to work with tax feeds. Thanks Moshe.
parent 66ccfb3f
......@@ -341,7 +341,7 @@ function blog_block() {
while ($node = db_fetch_object($result)) {
$output .= l(check_output($node->title), array("id" => $node->nid)) ."<br />\n";
}
$output .= "<br /><div align=\"right\">".lm(t("more"), array("mod" => "blog"), t("Read the latest blog entries."))."</div>";
$output .= "<br /><div align=\"right\">".lm(t("more"), array("mod" => "blog"), "", array("title" => t("Read the latest blog entries."))) ."</div>";
$block[0]["content"] = $output;
}
......
......@@ -341,7 +341,7 @@ function blog_block() {
while ($node = db_fetch_object($result)) {
$output .= l(check_output($node->title), array("id" => $node->nid)) ."<br />\n";
}
$output .= "<br /><div align=\"right\">".lm(t("more"), array("mod" => "blog"), t("Read the latest blog entries."))."</div>";
$output .= "<br /><div align=\"right\">".lm(t("more"), array("mod" => "blog"), "", array("title" => t("Read the latest blog entries."))) ."</div>";
$block[0]["content"] = $output;
}
......
......@@ -667,7 +667,7 @@ function comment_node_link($node) {
$output .= " <tr><th>title</th><th>author</th><th colspan=\"3\">operations</th></tr>";
while ($comment = db_fetch_object($result)) {
$output .= "<tr><td>". l($comment->subject, array("id" => $node->nid, "cid" => $comment->cid), "node", $comment->cid) ."</td><td>". format_name($comment) ."</td><td>". l(t("view comment"), array("id" => $node->nid, "cid" => $comment->cid ."#". $comment->cid)) ."</td><td>". la(t("edit comment"), array("mod" => "comment", "op" => "edit", "id" => $comment->cid)) ."</td><td>". la(t("delete comment"), array("mod" => "comment", "op" => "delete", "id" => $comment->cid)) ."</td></tr>";
$output .= "<tr><td>". l($comment->subject, array("id" => $node->nid, "cid" => $comment->cid), "node", $comment->cid) ."</td><td>". format_name($comment) ."</td><td>". l(t("view comment"), array("id" => $node->nid, "cid" => $comment->cid), $comment->cid) ."</td><td>". la(t("edit comment"), array("mod" => "comment", "op" => "edit", "id" => $comment->cid)) ."</td><td>". la(t("delete comment"), array("mod" => "comment", "op" => "delete", "id" => $comment->cid)) ."</td></tr>";
}
$output .= "</table>";
......
......@@ -667,7 +667,7 @@ function comment_node_link($node) {
$output .= " <tr><th>title</th><th>author</th><th colspan=\"3\">operations</th></tr>";
while ($comment = db_fetch_object($result)) {
$output .= "<tr><td>". l($comment->subject, array("id" => $node->nid, "cid" => $comment->cid), "node", $comment->cid) ."</td><td>". format_name($comment) ."</td><td>". l(t("view comment"), array("id" => $node->nid, "cid" => $comment->cid ."#". $comment->cid)) ."</td><td>". la(t("edit comment"), array("mod" => "comment", "op" => "edit", "id" => $comment->cid)) ."</td><td>". la(t("delete comment"), array("mod" => "comment", "op" => "delete", "id" => $comment->cid)) ."</td></tr>";
$output .= "<tr><td>". l($comment->subject, array("id" => $node->nid, "cid" => $comment->cid), "node", $comment->cid) ."</td><td>". format_name($comment) ."</td><td>". l(t("view comment"), array("id" => $node->nid, "cid" => $comment->cid), $comment->cid) ."</td><td>". la(t("edit comment"), array("mod" => "comment", "op" => "edit", "id" => $comment->cid)) ."</td><td>". la(t("delete comment"), array("mod" => "comment", "op" => "delete", "id" => $comment->cid)) ."</td></tr>";
}
$output .= "</table>";
......
......@@ -671,31 +671,38 @@ function node_block() {
return $block;
}
function node_feed() {
$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));
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
*/
$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 .= "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n";
$output .= "<?xml version=\"1.0\" ". t("encoding=\"ISO-8859-1\""). "?>\n";
// $output .= "<!DOCTYPE rss [<!ENTITY % HTMLlat1 PUBLIC \"-//W3C//ENTITIES Latin 1 for XHTML//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent\">\n";
$output .= "<rss version=\"0.91\">\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 .= "<rss version=\"". $channel["version"] . "\">\n";
$output .= format_rss_channel($channel["title"], $channel["link"], $channel["description"], $items, $channel["language"]);
$output .= "</rss>\n";
header("Content-Type: text/xml");
print $output;
}
function node_validate($node, &$error) {
global $user;
......
......@@ -671,31 +671,38 @@ function node_block() {
return $block;
}
function node_feed() {
$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));
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
*/
$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 .= "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n";
$output .= "<?xml version=\"1.0\" ". t("encoding=\"ISO-8859-1\""). "?>\n";
// $output .= "<!DOCTYPE rss [<!ENTITY % HTMLlat1 PUBLIC \"-//W3C//ENTITIES Latin 1 for XHTML//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent\">\n";
$output .= "<rss version=\"0.91\">\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 .= "<rss version=\"". $channel["version"] . "\">\n";
$output .= format_rss_channel($channel["title"], $channel["link"], $channel["description"], $items, $channel["language"]);
$output .= "</rss>\n";
header("Content-Type: text/xml");
print $output;
}
function node_validate($node, &$error) {
global $user;
......
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