summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2001-05-22 21:40:54 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2001-05-22 21:40:54 +0000
commit376e71f1f8f82cc9cc5959f7f15f5fb53871df25 (patch)
tree92f2b13c00e9152947b6f6bae78b0222690d75d9
parent9c075b10071ad83e86d38bd76b4febd341545646 (diff)
downloadbrdo-376e71f1f8f82cc9cc5959f7f15f5fb53871df25.tar.gz
brdo-376e71f1f8f82cc9cc5959f7f15f5fb53871df25.tar.bz2
(Hopefully) a fix for the "n.active" watchdog error... forgot that node_get_XXXX() only queries node properties.
-rw-r--r--modules/poll.module11
-rw-r--r--modules/poll/poll.module11
2 files changed, 14 insertions, 8 deletions
diff --git a/modules/poll.module b/modules/poll.module
index a786a820d..eefa9740c 100644
--- a/modules/poll.module
+++ b/modules/poll.module
@@ -228,10 +228,13 @@ function poll_save($edit) {
}
function poll_block() {
- $poll = node_get_object(array("type" => "poll", "active" => 1));
- if ($poll) {
- $poll = poll_view($poll, 0, 1);
- $output = "<b>" . $poll[title] . "</b><br>" . $poll[content];
+ $result = _node_get(array("type" => "poll"));
+ while ($poll = db_fetch_array($result)) {
+ if ($poll[active]) {
+ $poll = poll_view($poll, 0, 1);
+ $output = "<b>" . $poll[title] . "</b><br>" . $poll[content];
+ break;
+ }
}
$blocks[0][subject] = "Latest poll";
$blocks[0][content] = $output ? $output : "No active polls.";
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index a786a820d..eefa9740c 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -228,10 +228,13 @@ function poll_save($edit) {
}
function poll_block() {
- $poll = node_get_object(array("type" => "poll", "active" => 1));
- if ($poll) {
- $poll = poll_view($poll, 0, 1);
- $output = "<b>" . $poll[title] . "</b><br>" . $poll[content];
+ $result = _node_get(array("type" => "poll"));
+ while ($poll = db_fetch_array($result)) {
+ if ($poll[active]) {
+ $poll = poll_view($poll, 0, 1);
+ $output = "<b>" . $poll[title] . "</b><br>" . $poll[content];
+ break;
+ }
}
$blocks[0][subject] = "Latest poll";
$blocks[0][content] = $output ? $output : "No active polls.";