mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02: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:
@@ -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 = '';
|
||||||
|
Reference in New Issue
Block a user