summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2001-06-01 23:23:53 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2001-06-01 23:23:53 +0000
commit4060a9ee8078f0855d8cbf2ab24a804819a152dd (patch)
tree521ac21620706105e707a48026ebed01cb5d29bd
parent255c56cc2b0126a3970d9b7a8a48c8fc2dfdfa17 (diff)
downloadbrdo-4060a9ee8078f0855d8cbf2ab24a804819a152dd.tar.gz
brdo-4060a9ee8078f0855d8cbf2ab24a804819a152dd.tar.bz2
Shrunk the poll output... it was rather big in full-view :)
-rw-r--r--modules/poll.module14
-rw-r--r--modules/poll/poll.module14
2 files changed, 16 insertions, 12 deletions
diff --git a/modules/poll.module b/modules/poll.module
index 3282d21ea..5ed349a8a 100644
--- a/modules/poll.module
+++ b/modules/poll.module
@@ -115,11 +115,10 @@ function poll_view($node, $main = 0, $block = 0) {
foreach ($node->choice as $key => $value) {
if ($value) {
- if ($main) {
- $output .= "<table cellspacing=\"1\" cellpadding=\"0\" width=\"100%\"><tr><td width=\"20%\" valign=\"middle\" align=\"left\">" . check_output($value) . "</td><td width=\"70%\">" . poll_graph($node->chvotes[$key] / $node->maxvotes) . "</td><td width=\"10%\" align=\"right\">" . round(($node->chvotes[$key] / $node->totalvotes) * 100) . "%</td></tr></table>";
- }
- else {
+ if ($block) {
$output .= (!$block ? "<br>" : "") . check_output($value) . "<br><table width=\"90%\" align=\"center\" cellspacing=\"1\" cellpadding=\"0\"><tr><td width=\"70%\" valign=\"middle\" align=\"left\">" . poll_graph($node->chvotes[$key] / $node->maxvotes) . "</td><td align=\"right\">" . round(($node->chvotes[$key] / $node->totalvotes) * 100) . "%</td></tr></table>";
+ } else {
+ $output .= "<table cellspacing=\"1\" cellpadding=\"0\" width=\"100%\"><tr><td width=\"20%\" valign=\"middle\" align=\"left\">" . check_output($value) . "</td><td width=\"70%\">" . poll_graph($node->chvotes[$key] / $node->maxvotes) . "</td><td width=\"10%\" align=\"right\">" . round(($node->chvotes[$key] / $node->totalvotes) * 100) . "%</td></tr></table>";
}
}
}
@@ -140,8 +139,11 @@ function poll_view($node, $main = 0, $block = 0) {
$output .= "<input type=\"radio\" name=\"chid\" value=\"" . $node->chid[$key] . "\">&nbsp;" . check_output($value) . "<br>";
}
}
- $output .= "</td></tr></table>";
- $output .= "<br><div align=\"center\">" . form_submit("Vote") . "<br>" . $footer . "</div>";
+ if ($block) {
+ $output .= "</td></tr></table><br><div align=\"center\">" . form_submit("Vote") . "<br>" . $footer . "</div>";
+ } else {
+ $output .= "</td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td align=\"center\"><br><div align=\"center\">" . form_submit("Vote") . "<br>" . $footer . "</div></td></tr></table>";
+ }
$output = form($REQUEST_URI, $output);
}
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index 3282d21ea..5ed349a8a 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -115,11 +115,10 @@ function poll_view($node, $main = 0, $block = 0) {
foreach ($node->choice as $key => $value) {
if ($value) {
- if ($main) {
- $output .= "<table cellspacing=\"1\" cellpadding=\"0\" width=\"100%\"><tr><td width=\"20%\" valign=\"middle\" align=\"left\">" . check_output($value) . "</td><td width=\"70%\">" . poll_graph($node->chvotes[$key] / $node->maxvotes) . "</td><td width=\"10%\" align=\"right\">" . round(($node->chvotes[$key] / $node->totalvotes) * 100) . "%</td></tr></table>";
- }
- else {
+ if ($block) {
$output .= (!$block ? "<br>" : "") . check_output($value) . "<br><table width=\"90%\" align=\"center\" cellspacing=\"1\" cellpadding=\"0\"><tr><td width=\"70%\" valign=\"middle\" align=\"left\">" . poll_graph($node->chvotes[$key] / $node->maxvotes) . "</td><td align=\"right\">" . round(($node->chvotes[$key] / $node->totalvotes) * 100) . "%</td></tr></table>";
+ } else {
+ $output .= "<table cellspacing=\"1\" cellpadding=\"0\" width=\"100%\"><tr><td width=\"20%\" valign=\"middle\" align=\"left\">" . check_output($value) . "</td><td width=\"70%\">" . poll_graph($node->chvotes[$key] / $node->maxvotes) . "</td><td width=\"10%\" align=\"right\">" . round(($node->chvotes[$key] / $node->totalvotes) * 100) . "%</td></tr></table>";
}
}
}
@@ -140,8 +139,11 @@ function poll_view($node, $main = 0, $block = 0) {
$output .= "<input type=\"radio\" name=\"chid\" value=\"" . $node->chid[$key] . "\">&nbsp;" . check_output($value) . "<br>";
}
}
- $output .= "</td></tr></table>";
- $output .= "<br><div align=\"center\">" . form_submit("Vote") . "<br>" . $footer . "</div>";
+ if ($block) {
+ $output .= "</td></tr></table><br><div align=\"center\">" . form_submit("Vote") . "<br>" . $footer . "</div>";
+ } else {
+ $output .= "</td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td align=\"center\"><br><div align=\"center\">" . form_submit("Vote") . "<br>" . $footer . "</div></td></tr></table>";
+ }
$output = form($REQUEST_URI, $output);
}