From df5dee8444a48dce64a83054791175e88e3cd160 Mon Sep 17 00:00:00 2001 From: Steven Wittens Date: Sat, 11 May 2002 15:20:35 +0000 Subject: [PATCH] Poll.module: - (forgot to mention in the last update) The side-block for the poll now has node-links - Prevented 'read more' links (there's nothing to 'read more' for polls) --- modules/poll.module | 8 ++++++-- modules/poll/poll.module | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/modules/poll.module b/modules/poll.module index 4f2765bee10..ee78abddc0f 100644 --- a/modules/poll.module +++ b/modules/poll.module @@ -17,7 +17,7 @@ function poll_block() { $poll = node_load(array("type" => "poll", "created" => $timestamp, "status" => "1")); if ($poll->nid) { // Poll_view dumps the output into $poll->body - poll_view($poll, 0, 1); + poll_view($poll, 1, 1); } } $blocks[0][subject] = t("Latest poll: %t", array("%t" => $poll->title)); @@ -263,7 +263,11 @@ function poll_view(&$node, $main = 0, $block = 0) { } } } - $output .= "
Total votes: ". $votestotal . ($block ? "
" . $theme->links(link_node($node, 1)) : "") ."
"; + if ($block) { + // Prevent a 'read more' link in the side-block. + $node->body = $node->teaser = ""; + } + $output .= "
Total votes: ". $votestotal . ($block ? "
" . $theme->links(link_node($node, $main)) : "") ."
"; } // Force the output on both the mainpage and elsewhere $node->body = $output; diff --git a/modules/poll/poll.module b/modules/poll/poll.module index 4f2765bee10..ee78abddc0f 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -17,7 +17,7 @@ function poll_block() { $poll = node_load(array("type" => "poll", "created" => $timestamp, "status" => "1")); if ($poll->nid) { // Poll_view dumps the output into $poll->body - poll_view($poll, 0, 1); + poll_view($poll, 1, 1); } } $blocks[0][subject] = t("Latest poll: %t", array("%t" => $poll->title)); @@ -263,7 +263,11 @@ function poll_view(&$node, $main = 0, $block = 0) { } } } - $output .= "
Total votes: ". $votestotal . ($block ? "
" . $theme->links(link_node($node, 1)) : "") ."
"; + if ($block) { + // Prevent a 'read more' link in the side-block. + $node->body = $node->teaser = ""; + } + $output .= "
Total votes: ". $votestotal . ($block ? "
" . $theme->links(link_node($node, $main)) : "") ."
"; } // Force the output on both the mainpage and elsewhere $node->body = $output;