• Resolved charis_r

    (@charis_r)


    Hello everyone:

    I have an issue with my site, it shows that there is a division by zero, must be the ratings. You can check my site: https://www.brightsimply.com and see it on the bottom (under the thumbnail).

    The weird thing is that I had the theme installed and this message didn’t appear, but then I run a Reset plugin and re-installed the theme and now it doesn’t go away.

    Here’s the code in the lines that have the issue:

    if(count($r) > 0)
    	{
    		$nr_ratings = $r[0]->cnt;
    		$sum 		= $r[0]->smm;
    		$sdd = ceil($sum/$nr_ratings);     ! ! ! THIS IS 1711
    
    		for($i=1;$i<=$sdd;$i++)
    		{
    			$concat .= ' <img src="'.get_bloginfo('template_url').'/images/star_full.png" width="15" />';
    		}
    
    		for($i=$sdd;$i<=5;$i++)
    		{
    			$concat .= ' <img src="'.get_bloginfo('template_url').'/images/star_empty.png" width="15" />';
    		}	
    
    	}
    	else
    	{
    		for($i=1;$i<=5;$i++)
    		{
    			$concat .= ' <img src="'.get_bloginfo('template_url').'/images/star_empty.png" width="15" />';
    		}	
    
    	}
    
    	return $concat." (".$nr_ratings.")";
    }
    
    function PricerrTheme_get_post_thumbs_fnc()

Viewing 10 replies - 16 through 25 (of 25 total)
Viewing 10 replies - 16 through 25 (of 25 total)
  • The topic ‘Having issue with a Warning: division by zero’ is closed to new replies.