diff --git a/e107_plugins/poll/poll_class.php b/e107_plugins/poll/poll_class.php index f6aaa531a..20012d805 100644 --- a/e107_plugins/poll/poll_class.php +++ b/e107_plugins/poll/poll_class.php @@ -334,8 +334,20 @@ class poll $ns = e107::getRender(); $tp = e107::getParser(); $sql = e107::getDb(); - + + $sc = e107::getScBatch('poll'); + global $POLLSTYLE; + + if ($type == 'preview') + { + $POLLMODE = 'notvoted'; + $sc->pollType = $type; + } + elseif ($type == 'forum') + { + $sc->pollPreview = true; + } switch ($POLLMODE) { @@ -360,6 +372,9 @@ class poll $POLLMODE = 'results'; break; + case 'notvoted': + break; + default: if(ADMIN) { @@ -453,7 +468,6 @@ class poll } - $sc = e107::getScBatch('poll'); $sc->setVars($pollArray); if ($pollArray['poll_comment']) // Only get comments if they're allowed on poll. And we only need the count ATM @@ -467,14 +481,7 @@ class poll $sc->pollRenderType = $type; - if ($type == 'preview') - { - $POLLMODE = 'notvoted'; - } - elseif ($type == 'forum') - { - $sc->pollPreview = true; - } + $text = '';