summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2002-04-20 01:51:05 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2002-04-20 01:51:05 +0000
commit0a966e1ed42d1b7d0827b0318bcefb7101ac56df (patch)
treebdc4d12abea52551cab213a0628673e84c4c506f
parentab551f8c470eebac2b98c998f1322ceaf630e839 (diff)
downloadbrdo-0a966e1ed42d1b7d0827b0318bcefb7101ac56df.tar.gz
brdo-0a966e1ed42d1b7d0827b0318bcefb7101ac56df.tar.bz2
Updated poll.module:
- Removed obsolete lid column (changed update.php and database.mysql) - Added short help
-rw-r--r--database/database.mysql1
-rw-r--r--modules/poll.module8
-rw-r--r--modules/poll/poll.module8
-rw-r--r--update.php7
4 files changed, 14 insertions, 10 deletions
diff --git a/database/database.mysql b/database/database.mysql
index 08d6f73f8..91ba88792 100644
--- a/database/database.mysql
+++ b/database/database.mysql
@@ -295,7 +295,6 @@ CREATE TABLE page (
#
CREATE TABLE poll (
- lid int(10) unsigned NOT NULL auto_increment,
nid int(10) unsigned NOT NULL default '0',
runtime int(10) NOT NULL default '0',
voters text NOT NULL,
diff --git a/modules/poll.module b/modules/poll.module
index d08d949dc..26d01c421 100644
--- a/modules/poll.module
+++ b/modules/poll.module
@@ -28,9 +28,9 @@ function poll_block() {
function poll_cron() {
// Close polls that have exceeded their allowed runtime
- $result = db_query("SELECT p.lid FROM poll p LEFT JOIN node n ON p.nid=n.nid WHERE (n.created + p.runtime) < '" . time() . "' AND p.active = '1' AND p.runtime != '0'");
+ $result = db_query("SELECT p.nid FROM poll p LEFT JOIN node n ON p.nid=n.nid WHERE (n.created + p.runtime) < '" . time() . "' AND p.active = '1' AND p.runtime != '0'");
while ($poll = db_fetch_object($result)) {
- db_query("UPDATE poll SET active='0' WHERE lid='$poll->lid'");
+ db_query("UPDATE poll SET active='0' WHERE nid='$poll->nid'");
}
}
@@ -43,7 +43,7 @@ function poll_form(&$node, &$help, &$error) {
$admin = user_access("administer nodes");
$_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");
+ $_active = array(0 => t("Closed"), 1 => t("Active"));
$node->choices = $node->choices ? $node->choices : max(2, count($node->choices) ? count($node->choices) : 5);
@@ -90,7 +90,7 @@ function poll_form(&$node, &$help, &$error) {
}
function poll_help() {
- ?>
+ ?><p>Drupal's poll module allows users to submit multiple-choice questions that others can vote on.</p>
<?php
}
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index d08d949dc..26d01c421 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -28,9 +28,9 @@ function poll_block() {
function poll_cron() {
// Close polls that have exceeded their allowed runtime
- $result = db_query("SELECT p.lid FROM poll p LEFT JOIN node n ON p.nid=n.nid WHERE (n.created + p.runtime) < '" . time() . "' AND p.active = '1' AND p.runtime != '0'");
+ $result = db_query("SELECT p.nid FROM poll p LEFT JOIN node n ON p.nid=n.nid WHERE (n.created + p.runtime) < '" . time() . "' AND p.active = '1' AND p.runtime != '0'");
while ($poll = db_fetch_object($result)) {
- db_query("UPDATE poll SET active='0' WHERE lid='$poll->lid'");
+ db_query("UPDATE poll SET active='0' WHERE nid='$poll->nid'");
}
}
@@ -43,7 +43,7 @@ function poll_form(&$node, &$help, &$error) {
$admin = user_access("administer nodes");
$_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");
+ $_active = array(0 => t("Closed"), 1 => t("Active"));
$node->choices = $node->choices ? $node->choices : max(2, count($node->choices) ? count($node->choices) : 5);
@@ -90,7 +90,7 @@ function poll_form(&$node, &$help, &$error) {
}
function poll_help() {
- ?>
+ ?><p>Drupal's poll module allows users to submit multiple-choice questions that others can vote on.</p>
<?php
}
diff --git a/update.php b/update.php
index 64f4c4acb..9762f35fc 100644
--- a/update.php
+++ b/update.php
@@ -51,7 +51,8 @@ $mysql_updates = array(
"2002-04-08" => "update_24",
"2002-04-14 : modules/themes web config" => "update_25",
"2002-04-14 : new taxonomy system" => "update_26",
- "2002-04-16" => "update_27"
+ "2002-04-16" => "update_27",
+ "2002-04-20" => "update_28"
);
// Update functions
@@ -411,6 +412,10 @@ function update_27() {
update_sql("ALTER TABLE book ADD log TEXT;");
}
+function update_28() {
+ update_sql("ALTER TABLE poll DROP lid;");
+}
+
/*
** System functions
*/