diff options
-rw-r--r-- | includes/common.inc | 4 | ||||
-rw-r--r-- | includes/theme.inc | 4 | ||||
-rw-r--r-- | modules/node.module | 6 | ||||
-rw-r--r-- | modules/node/node.module | 6 | ||||
-rw-r--r-- | themes/marvin/marvin.theme | 4 | ||||
-rw-r--r-- | themes/unconed/unconed.theme | 4 |
6 files changed, 12 insertions, 16 deletions
diff --git a/includes/common.inc b/includes/common.inc index e1f2dcc11..fabee01bf 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -350,10 +350,10 @@ function link_page() { return $links; } -function link_node($node) { +function link_node($node, $main = 0) { foreach (module_list() as $name) { if (module_hook($name, "link")) { - $links = array_merge($links, module_invoke($name, "link", "node", $node)); + $links = array_merge($links, module_invoke($name, "link", "node", $node, $main)); } } diff --git a/includes/theme.inc b/includes/theme.inc index 79fdeb353..60bf86cd0 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -69,8 +69,8 @@ class BaseTheme { else { $output .= check_output($node->body, 1); } - if ($main) { - $output .= "<br />[ ". $this->links(link_node($node)) ." ]"; + if ($links = link_node($node, $main)) { + $output .= "<br />[ ". $this->links($links) ." ]"; } $output .= "<hr />"; diff --git a/modules/node.module b/modules/node.module index 0a587fe50..f2ab82bbc 100644 --- a/modules/node.module +++ b/modules/node.module @@ -88,7 +88,6 @@ function node_filter_link($text) { } function node_filter_line($text) { - /* ** If HTML mark-up is being used, strip regular mark-up: */ @@ -129,7 +128,7 @@ function node_filter($text) { return node_filter_line($text); } -function node_link($type, $node = 0) { +function node_link($type, $node = 0, $main = 0) { if ($type == "admin" && user_access("administer nodes")) { $links[] = "<a href=\"admin.php?mod=node\">content management</a>"; @@ -140,12 +139,11 @@ function node_link($type, $node = 0) { } if ($type == "node") { - if ($node->links) { $links = $node->links; } - if ($node->teaser != $node->body) { + if ($node->teaser != $node->body && $main) { $links[] = "<a href=\"node.php?id=". $node->nid ."\">". t("read more") ."</a>"; } diff --git a/modules/node/node.module b/modules/node/node.module index 0a587fe50..f2ab82bbc 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -88,7 +88,6 @@ function node_filter_link($text) { } function node_filter_line($text) { - /* ** If HTML mark-up is being used, strip regular mark-up: */ @@ -129,7 +128,7 @@ function node_filter($text) { return node_filter_line($text); } -function node_link($type, $node = 0) { +function node_link($type, $node = 0, $main = 0) { if ($type == "admin" && user_access("administer nodes")) { $links[] = "<a href=\"admin.php?mod=node\">content management</a>"; @@ -140,12 +139,11 @@ function node_link($type, $node = 0) { } if ($type == "node") { - if ($node->links) { $links = $node->links; } - if ($node->teaser != $node->body) { + if ($node->teaser != $node->body && $main) { $links[] = "<a href=\"node.php?id=". $node->nid ."\">". t("read more") ."</a>"; } diff --git a/themes/marvin/marvin.theme b/themes/marvin/marvin.theme index 87dbe9f8b..91aea2c27 100644 --- a/themes/marvin/marvin.theme +++ b/themes/marvin/marvin.theme @@ -69,8 +69,8 @@ print " <tr><td colspan=\"2\"> </td></tr>\n"; - if ($main) { - print " <tr><td colspan=\"2\">". $this->links(link_node($node)) ."</td></tr>\n"; + if ($links = link_node($node, $main)) { + print " <tr><td colspan=\"2\">". $this->links($links) ."</td></tr>\n"; } print "</table>\n"; diff --git a/themes/unconed/unconed.theme b/themes/unconed/unconed.theme index 95c36244f..e0eae11c2 100644 --- a/themes/unconed/unconed.theme +++ b/themes/unconed/unconed.theme @@ -110,8 +110,8 @@ </TD> </TR> <?php - if ($main) { - echo "<TR BGCOLOR=\"". $this->bgcolor3 ."\"><TD BGCOLOR=\"". $this->bgcolor3 ."\" ALIGN=\"right\" COLSPAN=\"2\">[ ". $this->links(link_node($node)) ." ]</TD></TR>"; + if ($links = link_node($node, $main)) { + echo "<TR BGCOLOR=\"". $this->bgcolor3 ."\"><TD BGCOLOR=\"". $this->bgcolor3 ."\" ALIGN=\"right\" COLSPAN=\"2\">[ ". $this->links($links) ." ]</TD></TR>"; } ?> </TABLE></TD></TR></TABLE><BR> |