diff --git a/modules/poll.module b/modules/poll.module index 9141b1dea23d316ad704210d0221d40a543a5c7f..2f388b803da57757d640b18844d2cead413588f4 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 9141b1dea23d316ad704210d0221d40a543a5c7f..2f388b803da57757d640b18844d2cead413588f4 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) . "'");