1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 06:07:32 +02:00

Merge pull request #2714 from arunshekher/poll_preview_fix

Fixes #2660 Poll preview not shown issue
This commit is contained in:
Cameron
2017-07-05 14:31:34 -07:00
committed by GitHub

View File

@@ -334,8 +334,20 @@ class poll
$ns = e107::getRender(); $ns = e107::getRender();
$tp = e107::getParser(); $tp = e107::getParser();
$sql = e107::getDb(); $sql = e107::getDb();
$sc = e107::getScBatch('poll');
global $POLLSTYLE; global $POLLSTYLE;
if ($type == 'preview')
{
$POLLMODE = 'notvoted';
$sc->pollType = $type;
}
elseif ($type == 'forum')
{
$sc->pollPreview = true;
}
switch ($POLLMODE) switch ($POLLMODE)
{ {
@@ -360,6 +372,9 @@ class poll
$POLLMODE = 'results'; $POLLMODE = 'results';
break; break;
case 'notvoted':
break;
default: default:
if(ADMIN) if(ADMIN)
{ {
@@ -453,7 +468,6 @@ class poll
} }
$sc = e107::getScBatch('poll');
$sc->setVars($pollArray); $sc->setVars($pollArray);
if ($pollArray['poll_comment']) // Only get comments if they're allowed on poll. And we only need the count ATM 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; $sc->pollRenderType = $type;
if ($type == 'preview')
{
$POLLMODE = 'notvoted';
}
elseif ($type == 'forum')
{
$sc->pollPreview = true;
}
$text = ''; $text = '';