summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2001-07-11 14:27:03 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2001-07-11 14:27:03 +0000
commitee12d11165f867e8442d5e12e6325f0c4f2e6d0d (patch)
tree3a41e4474cec545d1f6c4c963c088e0e85189572 /modules
parent48029fe280676751af33f2ab8b028b0fbb0195ac (diff)
downloadbrdo-ee12d11165f867e8442d5e12e6325f0c4f2e6d0d.tar.gz
brdo-ee12d11165f867e8442d5e12e6325f0c4f2e6d0d.tar.bz2
poll.module - made the poll-durations a lot more locale friendly (using format_interval();)
Diffstat (limited to 'modules')
-rw-r--r--modules/poll.module6
-rw-r--r--modules/poll/poll.module6
2 files changed, 6 insertions, 6 deletions
diff --git a/modules/poll.module b/modules/poll.module
index 17b17925c..a3195294e 100644
--- a/modules/poll.module
+++ b/modules/poll.module
@@ -172,7 +172,7 @@ function poll_view($node, $main = 0, $block = 0) {
function poll_form($edit = array(), $nocheck = 0) {
global $REQUEST_URI, $user;
- $duration = array(0 => t("Unlimited"), 86400 => t("1 day"), 172800 => t("2 days"), 345600 => t("4 days"), 604800 => t("1 week"), 1209600 => t("2 weeks"), 2678400 => t("1 month"), 5356800 => t("2 months"), 10713600 => t("4 months"), 31536000 => t("1 year"));
+ $duration = array(0 => t("Unlimited"), 86400 => format_interval(86400), 172800 => format_interval(172800), 345600 => format_interval(345600), 604800 => format_interval(604800), 1209600 => format_interval(1209600), 2419200 => format_interval(2419200), 4838400 => format_interval(4838400), 9676800 => format_interval(9676800), 31536000 => format_interval(31536000));
$active = array(0 => "Closed", 1 => "Active");
$admin = ($edit[nid] && user_access("administer nodes")) ? 1 : 0;
@@ -180,7 +180,7 @@ function poll_form($edit = array(), $nocheck = 0) {
if ($admin && !is_array($edit[choices])) $edit = poll_get_choices_array($edit);
/* Mini-form for number of choiceboxes */
- $choices = $edit[choices] ? $edit[choices] : max(2, count($edit[choice]));
+ $choices = $edit[choices] ? $edit[choices] : max(2, count($edit[choices]) ? count($edit[choices]) : 5);
for ($c = 2; $c <= 20; $c++) $opts[$c]=$c;
$form .= form_select(t("Number of choices"), "choices", $choices, $opts, t("This box only specifies the number of boxes in this form, it doesn't have to equal the actual amount of choices in the poll."));
$form .= form_submit(t("Preview")) . "<br><br><br>";
@@ -249,7 +249,7 @@ function poll_block() {
while ($poll = db_fetch_object($result)) {
if (($poll->active) && ($poll->status == $status[posted])) {
$content = poll_view($poll, 0, 1);
- $output = "<b>" . $content[title] . "</b><br>" . $content[content] . "<br><div align=\"center\">[ <a href=\"node.php?id=" . $poll->nid . "\">" . t("Read more") . "</a> ]</div>";
+ $output = "<b>" . $content[title] . "</b><br>" . $content[content] . "<br><div align=\"center\">[ <a href=\"node.php?id=" . $poll->nid . "\">" . t("read more") . "</a> ]</div>";
break;
}
}
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index 17b17925c..a3195294e 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -172,7 +172,7 @@ function poll_view($node, $main = 0, $block = 0) {
function poll_form($edit = array(), $nocheck = 0) {
global $REQUEST_URI, $user;
- $duration = array(0 => t("Unlimited"), 86400 => t("1 day"), 172800 => t("2 days"), 345600 => t("4 days"), 604800 => t("1 week"), 1209600 => t("2 weeks"), 2678400 => t("1 month"), 5356800 => t("2 months"), 10713600 => t("4 months"), 31536000 => t("1 year"));
+ $duration = array(0 => t("Unlimited"), 86400 => format_interval(86400), 172800 => format_interval(172800), 345600 => format_interval(345600), 604800 => format_interval(604800), 1209600 => format_interval(1209600), 2419200 => format_interval(2419200), 4838400 => format_interval(4838400), 9676800 => format_interval(9676800), 31536000 => format_interval(31536000));
$active = array(0 => "Closed", 1 => "Active");
$admin = ($edit[nid] && user_access("administer nodes")) ? 1 : 0;
@@ -180,7 +180,7 @@ function poll_form($edit = array(), $nocheck = 0) {
if ($admin && !is_array($edit[choices])) $edit = poll_get_choices_array($edit);
/* Mini-form for number of choiceboxes */
- $choices = $edit[choices] ? $edit[choices] : max(2, count($edit[choice]));
+ $choices = $edit[choices] ? $edit[choices] : max(2, count($edit[choices]) ? count($edit[choices]) : 5);
for ($c = 2; $c <= 20; $c++) $opts[$c]=$c;
$form .= form_select(t("Number of choices"), "choices", $choices, $opts, t("This box only specifies the number of boxes in this form, it doesn't have to equal the actual amount of choices in the poll."));
$form .= form_submit(t("Preview")) . "<br><br><br>";
@@ -249,7 +249,7 @@ function poll_block() {
while ($poll = db_fetch_object($result)) {
if (($poll->active) && ($poll->status == $status[posted])) {
$content = poll_view($poll, 0, 1);
- $output = "<b>" . $content[title] . "</b><br>" . $content[content] . "<br><div align=\"center\">[ <a href=\"node.php?id=" . $poll->nid . "\">" . t("Read more") . "</a> ]</div>";
+ $output = "<b>" . $content[title] . "</b><br>" . $content[content] . "<br><div align=\"center\">[ <a href=\"node.php?id=" . $poll->nid . "\">" . t("read more") . "</a> ]</div>";
break;
}
}