Fix when adding poll = template tibiacom broken

With Exception and red message
This commit is contained in:
slawkens 2020-10-12 21:58:20 +02:00
parent 65b4b2d183
commit e213c3e7d8
2 changed files with 4 additions and 5 deletions

View File

@ -6,7 +6,7 @@ if(PAGE !== 'news') {
$poll = $db->query('SELECT `id`, `question` FROM `z_polls` WHERE end > ' . time() . ' ORDER BY `end` LIMIT 1');
if($poll->rowCount() > 0) {
$poll = $poll->fetch();
$poll = $poll->fetch(PDO::FETCH_ASSOC);
$twig->display('poll.html.twig', array(
'poll' => $poll
));

View File

@ -1,7 +1,6 @@
<div id="CurrentPollBox" class="Themebox"
style="background-image:url({{ template_path }}/images/themeboxes/current-poll/currentpollbox.gif);">
<div id="CurrentPollText">{{ poll['question'] }}</div>
<a class="ThemeboxButton" href="{{ getLink('polls') . '/' . poll['id'] }}" onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" style="background-image:url({{ template_path }}/images/global/buttons/sbutton.gif);"><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/global/buttons/sbutton_over.gif);"></div><div class="ButtonText" style="background-image:url({{ template_path }}/images/global/buttons/_sbutton_votenow.gif);"></div>
<div id="CurrentPollBox" class="Themebox" style="background-image:url({{ template_path }}/images/themeboxes/current-poll/currentpollbox.gif);">
<div id="CurrentPollText">{{ poll.question }}</div>
<a class="ThemeboxButton" href="{{ getLink('polls') }}/{{ poll.id }}" onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" style="background-image:url({{ template_path }}/images/global/buttons/sbutton.gif);"><div class="BigButtonOver" style="background-image:url({{ template_path }}/images/global/buttons/sbutton_over.gif);"></div><div class="ButtonText" style="background-image:url({{ template_path }}/images/global/buttons/_sbutton_votenow.gif);"></div>
</a>
<div class="Bottom" style="background-image:url({{ template_path }}/images/general/box-bottom.gif);"></div>
</div>