kaparzo231
New Member
I have this warning When I go to the ots website (localhost)

Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\layouts\tibiacom\layout.php on line 543
layout.php:
How can I fix it?
Thanks in advance

Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\layouts\tibiacom\layout.php on line 543
layout.php:
PHP:
if($config['site']['screenoftheday'] == 1)
echo '<div id="ScreenshotBox" class="Themebox" style="background-image:url('.$layout_name.'/images/themeboxes/screenshot/screenshotbox.gif);">
<a href="?subtopic=gallery" >
<img id="ScreenshotContent" class="ThemeboxContent" src="images/screenshotoftheday.gif" alt="Screenshot of the Day" /></a>
<div class="Bottom" style="background-image:url('.$layout_name.'/images/general/box-bottom.gif);"></div>
</div>';
?>
<?PHP
$time = time();
$viewpoll = $SQL->query('SELECT * FROM z_polls where end > '.$time.' ORDER BY id DESC LIMIT 1');
foreach($viewpoll as $p)
$polls .= '<center>'.$p['question'].'</center>';
if(count($p['id']) > 0) // Warning on this line
echo '<div id="CurrentPollBox" class="Themebox" style="background-image:url('.$layout_name.'/images/themeboxes/current-poll/currentpollbox.gif);">
<div id="CurrentPollText">'.$polls.'</div>
<a class="ThemeboxButton" href="?subtopic=polls&id= '.$p['id'].'" onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif);"><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div>
<div class="ButtonText" style="background-image:url('.$layout_name.'/images/buttons/_sbutton_votenow.gif);"></div>
</a>
<div class="Bottom" style="background-image:url('.$layout_name.'/images/general/box-bottom.gif);"></div>
</div>';
?>
How can I fix it?
Thanks in advance