summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/node.inc9
-rw-r--r--themes/goofy/goofy.theme2
-rw-r--r--themes/jeroen/jeroen.theme4
-rw-r--r--themes/yaroon/yaroon.theme4
4 files changed, 14 insertions, 5 deletions
diff --git a/includes/node.inc b/includes/node.inc
index 38dd79a85..73b8f8c1c 100644
--- a/includes/node.inc
+++ b/includes/node.inc
@@ -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
diff --git a/themes/goofy/goofy.theme b/themes/goofy/goofy.theme
index 56c28dd78..89d4a3343 100644
--- a/themes/goofy/goofy.theme
+++ b/themes/goofy/goofy.theme
@@ -104,7 +104,7 @@ function c(subject,mod,author,date,body) {document.writeln("<table border=\"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
diff --git a/themes/jeroen/jeroen.theme b/themes/jeroen/jeroen.theme
index 26bb678b5..8af597435 100644
--- a/themes/jeroen/jeroen.theme
+++ b/themes/jeroen/jeroen.theme
@@ -138,8 +138,8 @@
<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>
diff --git a/themes/yaroon/yaroon.theme b/themes/yaroon/yaroon.theme
index 4aefd8a1a..66280be8b 100644
--- a/themes/yaroon/yaroon.theme
+++ b/themes/yaroon/yaroon.theme
@@ -145,8 +145,8 @@
<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>";
?>