summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2001-07-07 15:19:29 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2001-07-07 15:19:29 +0000
commit7bd45884d8fd4e340289ad81b21855a3c12455ea (patch)
tree00bb4f16c3cf7aa100b20dad6a006807bc06f694
parentf12fa0615245760565dbc1fb53160c29243c63e2 (diff)
downloadbrdo-7bd45884d8fd4e340289ad81b21855a3c12455ea.tar.gz
brdo-7bd45884d8fd4e340289ad81b21855a3c12455ea.tar.bz2
- Fixed naughty $op behaviour, causing block.module to go fubar.
-rw-r--r--modules/poll.module6
-rw-r--r--modules/poll/poll.module6
2 files changed, 8 insertions, 4 deletions
diff --git a/modules/poll.module b/modules/poll.module
index 9141b1dea..2f388b803 100644
--- a/modules/poll.module
+++ b/modules/poll.module
@@ -101,11 +101,13 @@ function poll_graph($val) {
function poll_view($node, $main = 0, $block = 0) {
global $theme, $op, $user, $chid, $REQUEST_URI;
+
+ $pollop = $op;
if (($node->active) && (!field_get($node->voters, $user->userid))) $voting = 1;
- if ((!$voting) && ($op != "View")) $op = "View";
+ if ((!$voting) && ($pollop != "View")) $pollop = "View";
- switch ($op) {
+ switch ($pollop) {
case "Vote":
if (($node->active) && (!field_get($node->voters, $user->userid))) {
$result = db_query("UPDATE poll_choices SET chvotes=chvotes+1 WHERE nid='" . $node->nid . "' && chid='" . check_input($chid) . "'");
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index 9141b1dea..2f388b803 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -101,11 +101,13 @@ function poll_graph($val) {
function poll_view($node, $main = 0, $block = 0) {
global $theme, $op, $user, $chid, $REQUEST_URI;
+
+ $pollop = $op;
if (($node->active) && (!field_get($node->voters, $user->userid))) $voting = 1;
- if ((!$voting) && ($op != "View")) $op = "View";
+ if ((!$voting) && ($pollop != "View")) $pollop = "View";
- switch ($op) {
+ switch ($pollop) {
case "Vote":
if (($node->active) && (!field_get($node->voters, $user->userid))) {
$result = db_query("UPDATE poll_choices SET chvotes=chvotes+1 WHERE nid='" . $node->nid . "' && chid='" . check_input($chid) . "'");