mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 13:17:24 +02:00
Fix for PHP Warning in PHP 7.1
This commit is contained in:
@@ -1422,7 +1422,7 @@ class comment
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
function getCommentData($amount = '', $from = '', $qry = '', $cdvalid = FALSE, $cdreta = FALSE)
|
function getCommentData($amount = '', $from = 0, $qry = '', $cdvalid = FALSE, $cdreta = FALSE)
|
||||||
{
|
{
|
||||||
|
|
||||||
if($this->engine != 'e107')
|
if($this->engine != 'e107')
|
||||||
|
@@ -396,13 +396,15 @@ class poll
|
|||||||
// $voteArray = array_slice($voteArray, 0, -1);
|
// $voteArray = array_slice($voteArray, 0, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$voteTotal = array_sum($voteArray);
|
$voteTotal = intval(array_sum($voteArray));
|
||||||
$percentage = array();
|
$percentage = array();
|
||||||
|
|
||||||
if (count($voteArray))
|
if (count($voteArray))
|
||||||
{
|
{
|
||||||
foreach ($voteArray as $votes)
|
foreach ($voteArray as $votes)
|
||||||
{
|
{
|
||||||
|
$votes = intval($votes);
|
||||||
|
|
||||||
if ($voteTotal > 0)
|
if ($voteTotal > 0)
|
||||||
{
|
{
|
||||||
$percentage[] = round(($votes/$voteTotal) * 100, 2);
|
$percentage[] = round(($votes/$voteTotal) * 100, 2);
|
||||||
|
Reference in New Issue
Block a user