mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 14:17:49 +02:00
Merge pull request #2714 from arunshekher/poll_preview_fix
Fixes #2660 Poll preview not shown issue
This commit is contained in:
@@ -335,8 +335,20 @@ class poll
|
||||
$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)
|
||||
{
|
||||
case 'query' : // Show poll, register any vote
|
||||
@@ -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 = '';
|
||||
|
Reference in New Issue
Block a user