Commit 7bd45884 authored by Steven Wittens's avatar Steven Wittens
Browse files

- Fixed naughty $op behaviour, causing block.module to go fubar.

parent f12fa061
......@@ -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) . "'");
......
......@@ -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) . "'");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment