Commit 83542a1b authored by natrak's avatar natrak

Changes

- fixed the trailing | in some cases.
- removed theme_morelinks().
- added node_links().
- simplified BaseTheme->links().
- updated themes.

Notes
- the new links system is taking form, but concider it beta. There might still
  be some major changes ahead so I suggest waiting a little longer before
  modifying your theme to take advantage of it.
parent 8f7eddbe
......@@ -247,4 +247,13 @@ function node_access($account, $node) {
return strstr($node->moderate, $account->userid);
}
function node_links(&$links, &$node, $main = 0) {
if ($main) {
if ($node->body) $_links[] = array("node.php?id=$node->nid", t("read more"));
if ($node->comment) $_links[] = array("node.php?id=$node->nid", format_plural(node_get_comments($node->nid), "comment", "comments"));
}
$links = array_merge($_links, $links);
return $links;
}
?>
\ No newline at end of file
......@@ -104,7 +104,7 @@ function node($node, $main = 0, $links = 0) {
$title = check_output($node->title);
$subleft = strtr(t("Submitted by %a on %b"), array("%a" => format_username($node->userid), "%b" => format_date($node->timestamp, "large")));
$subright = node_index($node->attribute);
$body = check_output($node->body, 1) . ($main || $links ? "<hr color=\"#404040\" size=\"1\"><div align=\"right\">" . $this->links($links, $main, $node) . "</div>" : "");
$body = check_output($node->body, 1) . (node_links($links, $node, $main) ? "<hr color=\"#404040\" size=\"1\"><div align=\"right\">" . $this->links($links, $main) . "</div>" : "");
print "<script language=\"JavaScript\"><!--\ns(\"". $this->stripbreaks(addslashes($title)) ."\",\"". $this->stripbreaks(addslashes($subleft)) ."\",\"". $this->stripbreaks(addslashes($subright)) ."\",\"". $this->stripbreaks(addslashes($body)) ."\"); // -->\n</script>\n";
} // close node function
......
......@@ -138,8 +138,8 @@ function node($node, $main = 0, $links = 0) {
<tr>
<td colspan="2" align="right">
<?php
if ($main || $links) echo $this->links($links, $main, $node);
if (node_links($links, $node, $main))
echo $this->links($links, $main);
?>
</td>
......
......@@ -145,8 +145,8 @@ function node($node, $main = 0, $links = 0) {
<tr>
<td align=\"right\">
<font color=\"". $color ."\">";
if ($main || $links)
echo $this->links($links, $main, $node);
if (node_links($links, $node, $main))
echo $this->links($links, $main);
echo"</font>";
?>
......
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