mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 12:48:24 +01:00
Fix for poll preview not shown issue #2660, Also fix broken 'forum post form poll preview' with one minor known caveat.
This commit is contained in:
parent
018dc53f06
commit
f5bc5d1cce
@ -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 = '';
|
||||
|
Loading…
x
Reference in New Issue
Block a user